yum install mongodb

yum install mongodb-server mongodb

edit /etc/mongod.conf

[root@centos7-base ~]# sed -i 's#bind_ip = 127.0.0.1#bind_ip = 0.0.0.0#' /etc/mongod.conf 
[root@centos7-base ~]# grep 0.0.0.0 /etc/mongod.conf
bind_ip = 0.0.0.0

look for port and status of the mongod

systemctl start mongod.service 
systemctl status mongod.service
ss -lnatup | grep 27017
netstat -lnatup | grep mongod
ps -ef | grep mongod

connect mongod server

原文地址:https://www.cnblogs.com/anyux/p/11914507.html