停止数据库
来源:互联网 发布:linux 下载速度 编辑:程序博客网 时间:2024/06/02 16:19
发送 Unix 系统中断信号等
Control-C
如果处理连接状态,那么直接可以通过 Control-C 的方式去停止 MongoDB 实例,具体如下:
[root@localhost ~]# /Apps/mongo/bin/mongo --port 28013
MongoDB shell version: 1.8.1
connecting to: 127.0.0.1:28013/test
> use test
switched to db test
> ^C[root@localhost ~]#
shutdownServer()指令
如果处理连接状态,那么直接可以通过在 admin 库中发送 db.shutdownServer()指令去停止
MongoDB 实例,具体如下:
[root@localhost ~]# /Apps/mongo/bin/mongo --port 28013
MongoDB shell version: 1.8.1
connecting to: 127.0.0.1:28013/test
> use admin
switched to db admin
> db.shutdownServer()
Thu May 31 23:22:00 DBClientCursor::init call() failed
Thu May 31 23:22:00 query failed : admin.$cmd { shutdown: 1.0 } to: 127.0.0.1:28013
server should be down...
Thu May 31 23:22:00 trying reconnect to 127.0.0.1:28013
Thu May 31 23:22:00 reconnect 127.0.0.1:28013 failed couldn't connect to server
127.0.0.1:28013
Thu May 31 23:22:00 Error: error doing query: unknown shell/collection.js:150
>
Unix 系统指令
在找到实例的进程后,可能通过发送 kill -2 PID 或 kill -15 PID 来停止进程
[root@localhost ~]# ps aux|grep mongod
root 19269 0.3 1.3 76008 3108 Sl 23:24 0:00 /Apps/mongo/bin/mongod --fork
--port 28013
[root@localhost ~]# kill -2 19269
注意:
不要用 kill -9 PID 来杀死 MongoDB 进程,这样可以会导致 MongoDB 的数据损坏
- 停止数据库
- 启动和停止数据库
- 备份 停止 数据库
- mongodb停止数据库
- informix数据库启动/停止
- 停止数据库的用户连接
- oracle 启动和停止数据库
- oracle数据库启动和停止
- oracle 数据库启动和停止
- 如何启动/停止Oracle数据库
- 如何启动/停止Oracle数据库
- 数据库的启动停止命令
- 如何停止单个db2数据库
- Oracle数据库启动与停止
- 如何停止单个DB2数据库
- Oracle数据库启动与停止
- oracle数据库启动停止操作
- MongoDB数据库启动和停止
- div位置定位问题
- git和github2(使用2)
- POJ 2234 Matches Game(博弈论)
- Request的getParameter和getAttribute方法的区别
- instsrv.exe——来自Windows 2000 Resource Kits的一个小工具
- 停止数据库
- 数据结构实验之栈二:一般算术表达式转换成后缀式 SDUT 2132
- android studio编译aidl文件出现问题
- TCP服务器和客户端交互
- 树莓派99——nano文本编辑器常用命令
- Linux 修改系统时间
- zookeeper原理及应用
- easyui-tree-url-param
- stack、queue、deque的区别