MongoDB-集合在_id上缺少唯一索引 [英] MongoDB - Collection lacks a unique index on _id

查看:302
本文介绍了MongoDB-集合在_id上缺少唯一索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在2.0.6版上运行的MongoDB服务器.我使用版本2.6.3的新服务器设置了副本集.

I have a MongoDB server running on version 2.0.6. I set up a replicaset with a new server with version 2.6.3.

完成复制配置(运行正常)后,每次我登录辅助服务器时,都会出现以下警告:

After finalizing the replication configuration (which is working properly), every time I log on the secondary server, I have the following warning:

2014-07-31T12 :08:40.666-0300 [initandlisten] WARNING: the collection 'xxx.yyy' lacks a unique index on _id. This index is needed for replication to Function Properly 
2014-07-31T12 :08:40.666-0300 [initandlisten] To fix this, you need to create a unique index on _id. See http://dochub.mongodb.org/core/build-replica-set-indexes 

我对此一无所知.谁能帮我吗?

I have no idea about it. Can anyone help me?

推荐答案

2.0和2.6在副本集中彼此不兼容.请先将2.0服务器升级到2.2,然后是2.4,然后是2.6. 2.4将是与2.6兼容的第一个版本在副本集中.您可以在发行说明中找到所有版本为0.2(例如2.2-> 2.4)的升级说明. 部分.

2.0 and 2.6 are not compatible with each other in a replica set. Please upgrade the 2.0 server incrementally to 2.2, then 2.4, then 2.6. 2.4 will be the first version compatible with 2.6 in a replica set. You can find upgrade instructions for all version increments of 0.2 (e.g. 2.2 -> 2.4) in the release notes sections of the docs.

这篇关于MongoDB-集合在_id上缺少唯一索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆