发布于 2015-09-14 15:10:41 | 180 次阅读 | 评论: 0 | 来源: 网络整理

shutdown

The shutdown command cleans up all database resources and then terminates the process. You must issue the shutdown command against the admin database in the form:

{ shutdown: 1 }

注解

Run the shutdown against the admin database. When using shutdown, the connection must originate from localhost or use an authenticated connection.

If the node you’re trying to shut down is a replica set primary, then the command will succeed only if there exists a secondary node whose oplog data is within 10 seconds of the primary. You can override this protection using the force option:

{ shutdown: 1, force: true }

Alternatively, the shutdown command also supports a timeoutSecs argument which allows you to specify a number of seconds to wait for other members of the replica set to catch up:

{ shutdown: 1, timeoutSecs: 60 }

The equivalent mongo shell helper syntax looks like this:

db.shutdownServer({timeoutSecs: 60});
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务