mongodb
查看 mongo 进程
ps -ef|grep mongo
关闭 mongo 进程
kill -9 进程号
停止关闭服务
找到 启动的参数配置文件 whereis mongodb.cnf
进入到 启动目录
执行命令
启动目录bin/mongod -shutdown -f mongodb.conf
关闭 服务
[root@izbp17dek6gh6fp3fctexdz bin]# ./mongod -shutdown -f ./mongodb.conf
2019-01-17T17:00:40.788+0800 I CONTROL [main] log file "/usr/mongodb/mongodb/logs/mongodb.log" exists; moved to "/usr/mongodb/mongodb/logs/mongodb.log.2019-01-17T09-00-40".
killing process with pid: 26659
[root@izbp17dek6gh6fp3fctexdz bin]#
[root@izbp17dek6gh6fp3fctexdz bin]# ps -ef|grep mongo
root 26734 26520 0 17:00 pts/1 00:00:00 grep --color=auto mongo
启动 mongo 服务
找到 启动的参数配置文件 whereis mongodb.cnf
[root@izbp17dek6gh6fp3fctexdz mongodb]# whereis mongodb.cnf
mongodb: /usr/mongodb/mongodb/bin/mongodb.conf
[root@izbp17dek6gh6fp3fctexdz mongodb]# cd ./mongodb/bin/
- 进入到 mongodb 安装目录 启动项目录
[root@izbp17dek6gh6fp3fctexdz mongodb]# cd ./mongodb/bin/
[root@izbp17dek6gh6fp3fctexdz bin]# ./mongod -f mongodb.conf
about to fork child process, waiting until server is ready for connections.
forked process: 26659
child process started successfully, parent exiting
[root@izbp17dek6gh6fp3fctexdz bin]# ps -ef|grep mongo
root 26659 1 6 16:34 ? 00:00:00 ./mongod -f mongodb.conf
root 26677 26520 0 16:35 pts/1 00:00:00 grep --color=auto mongo
[root@izbp17dek6gh6fp3fctexdz bin]# ps -ef|grep mongo
root 26659 1 5 16:34 ? 00:00:00 ./mongod -f mongodb.conf
root 26679 26520 0 16:35 pts/1 00:00:00 grep --color=auto mongo








网友评论