和上一篇一样,装个这个踩了无数个坑……
1、下载
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel55-3.2.12.tgz
2、新建data、logs
mkdir data
touch logs
3、启动mongoDB服务(感谢博客园博主爱你爱自己:http://www.cnblogs.com/grimm/p/5301135.html)
sudo ./mongod -dbpath=/data/mongodb-linux-x86_64-rhel55-3.2.12/data -logpath=/data/mongodb-linux-x86_64-rhel55-3.2.12/logs 有可能报错: ./mongod: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory 解决方法:(感谢csdn博主xinguan1267:链接:http://blog.csdn.net/xinguan1267/article/details/47727943)yum install libssl.so.6
ln -sf /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.6
ln -sf /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.6
4、将mongoDB服务随系统启动
sudo vi/etc/rc.local
rm -rf /data/mongodb-linux-x86_64-rhel55-3.2.12/data/db/mongod.lock && /data/mongodb-linux-x86_64-rhel55-3.2.12/bin/mongod -dbpath=/data/mongodb-linux-x86_64-rhel55-3.2.12/data -logpath=/data/mongodb-linux-x86_64-rhel55-3.2.12/logs --logappend
5、验证:127.0.0.1:27017 It looks like you are trying to access MongoDB over HTTP on the native driver port. 成功!