1.MongoDB 默认存储数据目录为/data/db/ (或者 c:\data\db), 默认端口27017,默认HTTP 端口28017。
2.MongoDB 也支持同mysql 一样的读取启动配置文件的方式来启动数据库
启动时加上”-f”参数,并指向配置文件即可
3.MongoDB 提供了一种后台Daemon 方式启动的选择,只需加上一个”--fork”参数即可,这就使我们可以更方便的操作数据库的启动,但如果用到了”--fork”参数就必须也启用”--logpath”参数,这是强制的
Start MongoDB
Start the mongod process by issuing the following command (as root, or with sudo):
You can verify that the mongod process has started successfully by checking the contents of the log file at/var/log/mongo/mongod.log.
You may optionally, ensure that MongoDB will start following a system reboot, by issuing the following command (with root privileges:)
Restart MongoDB
You can restart the mongod process by issuing the following command (as root, or with sudo):
Follow the state of this process by watching the output in the /var/log/mongo/mongod.log file to watch for errors or important messages from the server.