1、新建文件夹
mkdir -p usr/local/mongod/nshades.data
--> db
log
mongodb.conf
mkdir -p usr/local/mongod/ishuber.data
--> db
log
mongodb.conf
2、编辑mongodb.conf
vi /usr/local/mongod/nshades.data/mongodb.conf
注:mongodb.conf内容
port = 15015
dbpath = /usr/local/mongod/nshades.data/db
logpath = /usr/local/mongod/nshades.data/log/mongod.log
fork = 1
auth = 0
bind_ip = 0.0.0.0
3、启动MongoDB
mongod -f /usr/local/mongod/ishuber.data/mongodb.conf
4、远程连接修改账号密码
5、重启MongoDB
netstat -nalp | grep mongod
kill 8786
netstat -nalp | grep mongod
mongod -f /usr/local/mongod/ishuber.data/mongodb.conf
网友评论