mongoDB学习笔记

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):

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.

You may optionally, ensure that MongoDB will start following a system reboot, by issuing the following command (with root privileges:)

chkconfig mongod on

Stop MongoDB

Stop the mongod process by issuing the following command (as root, or with sudo):

service mongod stop

Restart MongoDB

You can restart the mongod process by issuing the following command (as root, or with sudo):

service mongod restart

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.

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/#control-mongodb


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值