2013-08-16 74 views
2

我们的mongodb服务器部署有2个分片,每个分片有1个主服务器和2个从服务器。 四台从服务器运行mongo config作为代理,两台从服务器运行仲裁器。 但是现在mongodb coundn't。MongoDB分片问题

我可以连接到192.168.0.1:8000(mongos)和exec查询,如'use database'或'show dbs',但是我不能在选择的数据库中执行查询,如'db.foo.count( )”, 'db.foo.findOne()'

以下是错误日志:

mongos> db.dev.count() 
Fri Aug 16 12:55:36 uncaught exception: count failed: { 
    "assertion" : "DBClientBase::findN: transport error: 10.81.4.72:7100 query: { setShardVersion: \"\", init: true, configdb: \"10.81.4.72:7300,10.42.50.26:7300,10.81.51.235:7300\", serverID: ObjectId('520db0a51fa00999772612b9'), authoritative: true }", 
    "assertionCode" : 10276, 
    "errmsg" : "db assertion failure", 
    "ok" : 0 
} 




Fri Aug 16 11:23:29 [conn8431] DBClientCursor::init call() failed 
Fri Aug 16 11:23:29 [conn8430] Socket recv() errno:104 Connection reset by peer 10.81.4.72:7100 
Fri Aug 16 11:23:29 [conn8430] SocketException: remote: 10.81.4.72:7100 error: 9001 socket exception [1] server [10.81.4.72:7100] 
Fri Aug 16 11:23:29 [conn8430] DBClientCursor::init call() failed 
Fri Aug 16 11:23:29 [conn8430] DBException in process: could not initialize cursor across all shards because : DBClientBase::findN: transport error: 10.81.4.72:7100 query: { setShardVersion: "", init: true, configdb: "10.81.4.72:7300,10.42.50.26:7300,10.81.51.235:7300", serverID: ObjectId('520d99c972581e6a124d0561'), authoritative: true } @ s01/10.36.31.36:7100,10.42.50.24:7100,10.81.4.72:7100 

我只能在mongos开始,查询不会EXEC如果超过1个mongos在运行同时错误日志:

mongos> db.dev.count() Fri Aug 16 15:12:29 uncaught exception: count failed: { "assertion" : "DBClientBase::findN: transport error: 10.81.4.72:7100 query: { setShardVersion: \"\", init: true, configdb: \"10.81.4.72:7300,10.42.50.26:7300,10.81.51.235:7300\", serverID: ObjectId('520dd04967557902f73a9fba'), authoritative: true }", "assertionCode" : 10276, "errmsg" : "db assertion failure", "ok" : 0 } 
+0

没有之前的工作?你有没有改变配置中的任何东西?你是如何设置副本集的? – Tilo

+0

从运行mongos的服务器,你可以尝试直接通过mongo shell作为第一个测试来连接到每个mongods(config和master)吗?另外,为什么您使用主/从配置超过副本集? –

+0

我只能在mongos上启动,如果超过1个mongos同时运行,查询将不会执行,错误日志:mongos> db.dev.count() Fri Aug 16 15:12:29未捕获的异常:count失败:{ \t“assertion”:“DBClientBase :: findN:transport error:10.81.4.72:7100 query:{setShardVersion:\”\“,init:true,configdb:\”10.81.4.72:7300,10.42.50.26 :7300,10.81.51.235:7300 \ “SERVERID:物件( '520dd04967557902f73a9fba'),权威:真正}”, \t “assertionCode”:10276, \t “ERRMSG”: “DB断言失败”, \t“OK “:0 } –

回答

0

Coul如果你现在正在设置它,你是否应该澄清一下你的设置是否在工作?

若要修复MongoDB的,你可能想请点击此链接:(!) http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/

参考

MongoDB Documentation : Deploying a Shard-Cluster

MongoDB Documentation : Add Shards to an existing cluster

旧的,过时的信息:

YouTube Video on Setting-up Sharding for MongoDB

Corresponding Blog on blog.serverdensity.com

+0

它以前运行良好,因为服务器崩溃并重新启动 –

+1

@feiyan你检查了腐败吗? – Sammaye