1. To the official website, select the appropriate version to download
Https://www.mongodb.com/download-center#community
2. Unzip
tar -zxvf mongodb-linux-x86_64-ubuntu1604-3.4.0.tgz
3. Move to the/usr/local/directory
sudo mv -r mongodb-linux-x86_64-ubuntu1604-3.4.0/ /usr/local/mongodb
4. Add the executable file to the path
export PATH=/usr/local/mongodb/bin:$PATH
Service side
- The command for the service is Mongod, and you can view all the parameters through Help
mongod --help
- Config file in/etc/mongod.conf, default port is 27017
- Recommended ways to use the service management
- Start
sudo service mongod start 不同的版本可能是(
mongodb start
)
sudo service mongod stop
sudo service mongod restart
- Review the process after startup to determine whether the startup was successful
ps ajx|grep mongod
- If no Mongod entries in the process are successful, you can view the logs to determine the cause of the error, the log directory is/var/log/mongodb/mongod.log, and the latest information is at the bottom
Client
- The client command is MONGO and can be used to view all parameters
- This shell is the client of MongoDB, and also a JS compiler.
mongo --help
exit或ctrl+c
- Gui:robomongo
- Unzip the package into Ubuntu
tar zxvf robomongo-0.9.0-linux-x86_64-0786489.tar.gz
- Enter the extracted directory and locate the running program in the bin directory
robomongo
Linux Platform Installation MongoDB