停止副本集MongoDB [英] Stop Replica Set MongoDB
本文介绍了停止副本集MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在MongoDB Shell中启动副本集的命令是rs.initiate().
The command to start a Replica Set in the MongoDB Shell is rs.initiate().
此命令的反义词.如何停止副本集?
What is the opposite of this command. How do I stop the replica set?
有些命令可以重新配置集合或删除成员,但是我不知道要删除最后一个成员,因此会销毁副本集.
There are commands to reconfigure the set or remove members but no way that I know off to remove the last member and therefore destroy the Replica Set.
推荐答案
这完全取决于您的目标.如果要将现有的mongod
重用作为独立服务器而不是副本集成员,则要执行的步骤是:
It all depends on what your goal is. If you want to reuse the existing mongod
as a standalone server rather than a replica set member then the steps to do that would be:
- 不使用
--replSet
参数重新启动mongod进程. -
删除本地数据库:
- Restart mongod process without
--replSet
argument. Drop the local database:
use local;
db.dropDatabase();
这篇关于停止副本集MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文