【问题标题】:Encountered a MongoDB warning after converting a replica set to stand alone server将副本集转换为独立服务器后遇到 MongoDB 警告
【发布时间】:2013-07-06 20:27:24
【问题描述】:

在将 mongodb 副本集转换为独立服务器后,我遇到了以下警告。我做了 rs.remove('host') 并在启动 mongo db 时删除了 replSet 参数。

[root@sam ~]# mongo
MongoDB shell version: 2.4.3
connecting to: test
Server has startup warnings: 
Tue Jul  9 17:18:46.076 [initandlisten] 
Tue Jul  9 17:18:46.076 [initandlisten] ** WARNING: mongod started without --replSet yet 1 documents are present in local.system.replset
Tue Jul  9 17:18:46.077 [initandlisten] **          Restart with --replSet unless you are doing maintenance and no other clients are connected.
Tue Jul  9 17:18:46.077 [initandlisten] **          The TTL collection monitor will not start because of this.
Tue Jul  9 17:18:46.077 [initandlisten] **          For more info see http://dochub.mongodb.org/core/ttlcollections
Tue Jul  9 17:18:46.077 [initandlisten] 
> 

请帮忙。需要立即修复。谢谢。

【问题讨论】:

    标签: mongodb replication database-replication


    【解决方案1】:

    本地数据库包含副本集信息等。您可以删除本地数据库而不会产生不良影响。
    使用以下 cmets 删除本地数据库。

    use local
    db.dropDatabase()
    

    重启 mongod 后警告信息应该会消失

    【讨论】:

    • 我遇到了完全相同的问题,但消息仍然出现。我还收到以下消息:> use local switched to db local > db.dropDatabase() { "dropped" : "local", "ok" : 1 } > rs.status() { "ok" : 0, "errmsg" : "not running with --replSet" }
    【解决方案2】:
    use local;
    db.dropDatabase();
    db.system.replset.remove ({});
    

    退出 mongo shell .. 重启服务以防万一“service mongod restart”

    mongo --host bind_ip --port bind_port
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-24
      • 1970-01-01
      • 2017-01-31
      • 2021-03-08
      • 2019-10-01
      • 1970-01-01
      • 2021-03-11
      相关资源
      最近更新 更多