0

我已经完成了本教程并成功部署了一个 3 节点副本集。我可以从其他主机连接到它,一切都很好。我的问题是在教程中它指出

Start MongoDB

Once the configuration files have been edited, start the database process manual:mongod on each instance by:

    Log on onto the instance

    Run the following command to start the process:

    mongod --config /etc/mongod.conf

    This should start the manual:mongod process

对我来说,这似乎副本集作为用户进程运行,而不是像命令中那样作为系统服务运行

sudo service mongodb start

那么如果其中一台机器重新启动会发生什么?这个过程死了吗?如何将整个副本集配置为作为服务运行?

4

1 回答 1

0

在机器重新启动时,mongod 进程将停止,您必须重新启动它。

在系统脚本中,我不确定是否在盒子重新启动时, mongod restart 会自动处理。但是,当您使用 mongodb apt-get/yum 软件包安装时,您可以拥有 mongod 进程的服务脚本,这些脚本会自动获得。

于 2013-06-26T14:18:49.593 回答