1、首先修改mongodb的配置文件 让其监听所有外网ip
vi mongod.conf
修改bindIp
bindIp: 0.0.0.0
2、重启mongodb
service nginx restart
3、远程连接
mongo --port 27017 -u "admin" -p "adminpasswd" --authenticationDatabase "admin"
1、首先修改mongodb的配置文件 让其监听所有外网ip
vi mongod.conf
修改bindIp
bindIp: 0.0.0.0
2、重启mongodb
service nginx restart
3、远程连接
mongo --port 27017 -u "admin" -p "adminpasswd" --authenticationDatabase "admin"