config servers are not in sync【mongo】
来源:互联网 发布:联想网络同传软件下载 编辑:程序博客网 时间:2024/06/16 10:55
今天两台开发机突然挂掉了,只剩下一台,机器重新恢复后,在恢复mongos的过程中,config server报错,
具体日志见:
ERROR: could notverify that config servers are in sync :: caused by :: config servers xx.xx.xx.xx:20000 and yy.yy.yy.yy:20000 differ: { chunks:"f0d00cf4266edb17c63538d24e51b545", colle
ctions:"331a71ef5fd89be1d4e02d0ad6ed1e55", databases:"8653e07cb59685b0e89b1fd094a30133", shards:"0a1b3f23160cd5dc731fd837cfb6d081", version:"9ec885c985db1d9fb06e6e7d61814668" } vs { chunks:"99771bf8ac9d42dfbb7332e7fa08d377",
collections:"331a71ef5fd89be1d4e02d0ad6ed1e55", databases:"8653e07cb59685b0e89b1fd094a30133", shards:"0a1b3f23160cd5dc731fd837cfb6d081", version:"9ec885c985db1d9fb06e6e7d61814668" }
2014-08-04T17:03:40.232+0800[mongosMain] configServer connection startup check failed
直接google,发现这种情况的原因在于两个机器的config server记录的信息不一致导致。修复的方法,在mongo官方的jira中已经列出(https://jira.mongodb.org/browse/SERVER-10737)。
这里做个记录,并且简单说明下恢复的方法:
- 连接到每个分片的configserver,在我机器上是20000端口,运行db.runCommand('dbhash')
在每台机器上都运行上述命令,比较理想的情况,会找到两个md5一样的机器。
- 然后将与其他两台不一致的mongo进程都杀死,将另一台机器上的dbpath下的数据都拷到出问题的那台机器上。
- 重启日志中报错的两台机器的config server
- 试着启动mongos,看是否还存在上述问题。
而在我的环境中,由于两台机器先后挂掉,最终比较发现,shard中的3台机器,配置均不一样。所以我决定采用一直存活的mongoconfig的配置,将另外两台机器的进程杀死,数据删除,拷贝数据,重启。由于我的是线下环境,处理比较随意,生产环境请一定选择正确的数据恢复。
- config servers are not in sync【mongo】
- mongos启动报错: could not verify that config servers are in sync
- android in practice_Making sure files are saved with sync
- Could not find server 'XXX' in sys.servers.
- Could not find server '***' in sys.servers,Execute sp_addlinkedserver to add the server to sysy.servers
- This server version is not supported. Only servers up to Microsoft SQL Server 2005 are supported.
- in-source builds are not allowed
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config.
- Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config.
- Could not load the Tomcat server configuration at \Servers\Tomcat v8.0 Server at localhost-config
- could not verify config servers were active and reachable before write
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v8.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config
- Could not load the Tomcat server configuration at \Servers\Tomcat v8.0 Server at localhost-config
- sizeof特性
- ln命令
- 生命的价值在于永垂不朽
- 让chrome支持本地Ajax请求
- nyoj58最少步数
- config servers are not in sync【mongo】
- mysql 导出指定列到文件
- GitHub客户端安装配置简介
- Move semantics(C++11)
- HD 1847 Good Luck in CET-4 Everybody!
- hdu 2089 不要62 数位dp
- main函数参数分析 处理命令行选项
- JDK7最新特性
- stat函数的使用 获取文件状态 可以将文件状态复制保存在一个stat结构地址中,以此取得文件的大小等状态