【问题标题】:unable to set replica set in mongodb3.2无法在 mongodb3.2 中设置副本集
【发布时间】:2016-07-02 11:58:30
【问题描述】:

我正在尝试从MongoDB 3.2 中的standalone MongoDB 设置一个演示副本,并在mongod.conf 中使用以下选项:

#replication:
 oplogSizeMB: 10240
 replSetName: "rs0"

但是当我尝试启动 mongodb 时,它会抛出错误:

Starting mongod (via systemctl):  Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details. [FAILED]

journalctl -xe 的输出说:

Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....
-- Subject: Unit mongod.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has begun starting up.
Jul 02 07:53:56 smartJN3-LTest-Blr1 runuser[29989]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
Jul 02 07:53:56 smartJN3-LTest-Blr1 runuser[29989]: pam_unix(runuser:session): session closed for user mongod
Jul 02 07:53:56 smartJN3-LTest-Blr1 mongod[29982]: Starting mongod: [FAILED]
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: mongod.service: control process exited, code=exited status=1
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Unit mongod.service entered failed state.
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: mongod.service failed.
Jul 02 07:53:56 smartJN3-LTest-Blr1 polkitd[2089]: Unregistered Authentication Agent for unix-process:29977:8668980 (system bus name :1.114, object path /org

这是在 CentOS 7.2 上。谢谢

任何人都可以帮助。谢谢

【问题讨论】:

  • 你能添加你的设置副本集脚本吗?您是否更改了每个 mongod 的端口?

标签: mongodb centos7


【解决方案1】:

自己修好了。愚蠢的我,我没有取消注释部分标题replication,这就是为什么从未选择设置的原因。

【讨论】:

    猜你喜欢
    • 2018-03-15
    • 2017-02-28
    • 1970-01-01
    • 2017-04-30
    • 2017-01-23
    • 1970-01-01
    • 2013-10-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多