我可以启动简单、小型、单个 mongodb 实例,然后轻松切换到复制集,还是应该使其“可复制”?从第一天开始?
我需要尽快把事情做好,现在就完成。
稍后,比如说一个月或更短的时间,或者更长的时间,我将希望将我的数据库复制到更多的机器上。
我想知道,我是否可以简单地开始处理我的单个实例,然后开始担心复制,或者我现在需要考虑一些事情,以便以后更容易复制。
I need to get things done, quick and fast and now.
Later on, down the road, say in a month or less, or more, I will want to have my database replicated in few more machines.
I wonder, if I can simply start working on my single instance, and start worrying about replication later on, or there are things I need to take into account now to make it easier to replicate later on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您通常可以稍后再担心。如果您切换到副本集,您将必须重新启动 mongod 进程并在那时设置副本集。如果您想避免这种情况,您还可以考虑在一台计算机上简单地运行 3 成员复制集,以避免以后出现任何麻烦。
这应该可以让您很好地了解优点/缺点: http:// www.mongodb.org/display/DOCS/Upgrading+to+Replica+Sets
You mostly can worry about it later on. If you switch to replica sets you will have to restart your mongod process and set up a replica set at that time though. If you want to avoid that you can also consider simply running a 3 member replication set on a single machine to save yourself any headaches later on.
This should give you a good overview of the pros/cons : http://www.mongodb.org/display/DOCS/Upgrading+to+Replica+Sets
要添加@Remon的答案,您甚至可以将系统从单个节点(或单个副本集)转换为集群,甚至无需重新启动 mongod 实例(不过,您必须重新启动应用程序)。
To add to @Remon's answer, you can even convert your system from a single node (or a single replica set) to a cluster, without even restarting your mongod instances (you'll have to restart your app, though).