阿里云linux从0部署node+nginx+mongo (5)

2019-02-20  本文已影响0人  塔塔七

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
上一篇下一篇

猜你喜欢

热点阅读