【发布时间】:2014-11-13 17:42:32
【问题描述】:
我正在尝试将独立的 mongodb 实例转换为副本集,以便可以使用 elasticsearch 设置河流。如何从命令行启动一个的说明看起来很简单,但是,我希望它在服务器重新启动时作为副本集自动启动。我目前通过配置文件设置启动 mongodb。我对如何设置配置以适用于独立副本集感到困惑。另外,我是否必须先使用http://docs.mongodb.org/manual/tutorial/convert-standalone-to-replica-set/ 的说明进行设置,或者配置文件引导处理这个。
我感到困惑的配置文件部分是:
# Replication Options
# in master/slave replicated mongo databases, specify here whether
# this is a slave or master
#slave = true
#source = master.example.com
# Slave only: specify a single database to replicate
#only = master.example.com
# or
master = true
#source = slave.example.com
# in replica set configuration, specify the name of the replica set
#replSet = rs0
假设我的服务器位于 123.456.789.000,副本集的名称是 rs0。
【问题讨论】:
-
1. stackexchange 是一个面向软件开发人员的社区,而不是面向数据库管理员的社区。但是我们也有一个供数据库管理员使用的。可以在dba.stackexchange.com 上找到它。我提名了你的迁移问题。 2.
123.456.789.000不是一个有效的IP地址:) -
感谢您的指点,我将在以后的问题中使用该指点。
标签: mongodb