审核中~
溜忙之道
首页
溜忙手册
offer之道
项目Git
写文章
登录
·
注册
登录
没有账号,去注册
注册
已有账号,去登录
博客
linux下mongo启动关闭重启方法
南易_站长
阅读量:30900
关注
linux下mongo启动关闭重启方法
# 启动 启动mongodb首先要指定mongo的数据目录和日志文件路径, 如: /data/mongodb/ /var/log/mongodb/mongodb.log 启动命令: /usr/local/mongdb/bin/mongod -port 10001 --dbpath /data/mongodb/ --logpath /var/mongodb/mongodb.log # 通过配置文件配置: vim mongodb.conf port=10001 【代表端口号,如果不指定则默认为 27017 】 dbpath= /data/mongodb/ 【数据库路径】 logpath= /data/mongodb/ 【日志路径】 logappend=true 【日志文件自动累加,而不是覆盖】 启动命令: /usr/loca/mongodb/bin/mongod -f mongodb.conf # 后台启动 --fork 选项将会通知 mongod 在后台运行 /usr/local/mongodb/bin/mongod -port 10001 --dbpath /data/mongodb/ --logpath /var/mongodb/mongodb.log --fork #使用&后台启动 /usr/local/mongodb/bin/mongod -port 10001 --dbpath /data/mongodb/ --logpath /var/mongodb/mongodb.log & #关闭 pkill mongod 进入mongo shell :运行 db.shuidownServer()
评论
表情
发送
0
评论