前言
以下是亲生经历了很多次才成功的,那么就分享下自己成功的经历吧
1、下载
cd /opt
mkdir mongodb
cd mongodb
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz
2、解压
tar -zxvf mongodb-linux-x86_64-3.0.6.tgz
3、拷贝
mv mongodb-linux-x86_64-3.0.6/ /usr/local/mongodb
4、创建全局环境变量
export PATH=/usr/local/mongodb/bin:$PATH
5、新建配置相关内容文件
cd /
mkdir data
cd data
mkdir
cd mongo
touch mongo.log
touch mongo.conf
vi mongo.conf # 编辑文本
6、配置conf文件内容
fork = true
bind_ip = 127.0.0.1
port = 27017
quiet = true
dbpath = /data/mongo/
logpath = /data/mongo/mongod.log
logappend = true
journal = true
7、执行配置文件
mongod -f /data/mongo/mongo.conf
8、出现下面的证明成功配置
[root@iZm5eh24fk64pzZ mongo]# mongod -f /data/mongo/mongo.conf
about to fork child process, waiting until server is ready for connections.
forked process: 19646
ERROR: child process failed, exited with error number 100
9、运行mongo
mongo