Ubuntu under Installation and remote connection
Install, view services, whether the service starts automatically on boot, view ports, local connections, remote connections.
Installation
Apt Install MongoDB
View Services
Ll/etc/init.d
-rwxr-xr-x 1 root root 7768 June mongodb*
Service MongoDB Status
Mongodb.service-an object/document-oriented Database
Loaded:loaded (/lib/systemd/system/mongodb.service; enabled; Vendor Preset:
Active:active (running) since three 2018-08-01 12:43:19 CST; 1min 12s ago
Docs:man:mongod (1)
Main pid:3017 (Mongod)
CGroup:/system.slice/mongodb.service
└─3017/usr/bin/mongod--config/etc/mongodb.conf
Obviously, the service starts automatically after installation.
Whether the service starts automatically with boot
Reboot
Obviously, the MongoDB service starts automatically with the boot.
View ports
Netstat-anpl|grep MONGO
TCP 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994/mongod
Local connection
Mongo
MongoDB Shell version:2.6.10
Connecting To:test
Welcome to the MongoDB shell.
For interactive help, type ' help '.
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the Support group
Http://groups.google.com/group/mongodb-user
>
Remote connection
1 Modify the configuration file.
Vim/etc/mongodb.conf
Comment out the bind_ip=127.0.0.1 line or modify it to bind_ip=0.0.0.0
2 Restart the service (depending on the situation if necessary).
/etc/init.d/mongodb restart
3 Firewall Open ports (depending on the situation).
Iptables-a input-p tcp-m State--state new-m TCP--dport 27017-j ACCEPT
MONGO Client
Mongod Server
Mongodb ubuntu under installation with remote connection