Mongodb 操做linux
The MongoDB instance stores its data files in the /var/lib/mongo and its log files in /var/log/mongo, and run using themongod user account. If you change the user that runs the MongoDB process, you must modify the access control rights to the/var/lib/mongo and /var/log/mongo directories.mongodb
Start the mongod process by issuing the following command (as root or with sudo):centos
service mongod start
You can verify that the mongod process has started successfully by checking the contents of the log file at/var/log/mongo/mongod.log.ui
You may optionally ensure that MongoDB will start following a system reboot by issuing the following command (with root privileges:)url
chkconfig mongod on
Stop the mongod process by issuing the following command (as root or with sudo):spa
service mongod stop
You can restart the mongod process by issuing the following command (as root or with sudo):rest
service mongod restart
url:http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/get