将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]
>
请帮忙。需要立即修复它。感谢。
答案 0 :(得分:13)
本地数据库包含副本集信息等。您可以删除本地数据库而不会产生不良影响 使用以下注释删除本地数据库。
use local
db.dropDatabase()
重启mongod
后,警告消息应该消失答案 1 :(得分:4)
use local;
db.dropDatabase();
db.system.replset.remove ({});
退出mongo shell ..重启服务以防万一“service mongod restart”
mongo --host bind_ip --port bind_port