Received: by 10.58.187.138 with SMTP id fs10mr58058vec.8.1348848140018; Fri, 28 Sep 2012 09:02:20 -0700 (PDT) X-BeenThere: mongodb-user@googlegroups.com Received: by 10.52.92.207 with SMTP id co15ls3405756vdb.5.gmail; Fri, 28 Sep 2012 09:02:04 -0700 (PDT) Received: by 10.52.37.12 with SMTP id u12mr1028362vdj.8.1348848124547; Fri, 28 Sep 2012 09:02:04 -0700 (PDT) Date: Fri, 28 Sep 2012 09:02:03 -0700 (PDT) From: Petr Borisov To: mongodb-user@googlegroups.com Message-Id: <7717841a-83ed-44c7-886d-7586e2e9cfa1@googlegroups.com> Subject: Can't read data from degraded replica set MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_711_29068655.1348848123971" ------=_Part_711_29068655.1348848123971 Content-Type: multipart/alternative; boundary="----=_Part_712_4361195.1348848123972" ------=_Part_712_4361195.1348848123972 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi all, I have linux rhel 6.3, mongodb 2.2 with sharding - 1 mongos, 3 configsrv, 2 shards. Each shard - 3 head joined into replica set. 2 head of first replica set is down. status of third head is secondary second replica set is up I have database with shardered collections named user_data. When I try read data from first shard - I got exception: mongos> db.user_data.find({"uid" : "10007570"}) error: { "$err" : "socket exception [CONNECT_ERROR] for shard1/webtest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118", "code" : 11002 } If I connect directly to live head of first shard and type rs.slave(true) - all works ok, I can read data. How can I do same from mongos? Thanks. mongos.log: Fri Sep 28 19:54:38 [conn38] trying reconnect to webtest4h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] reconnect webtest4h.mydomain.com:27118 failed couldn't connect to server webtest4h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] ReplicaSetMonitor::_checkConnection: caught exception webtest4h.mydomain.com:27118 socket exception [CONNECT_ERROR] for webtest4h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] trying reconnect to webtest5h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] reconnect webtest5h.mydomain.com:27118 failed couldn't connect to server webtest5h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] ReplicaSetMonitor::_checkConnection: caught exception webtest5h.mydomain.com:27118 socket exception [CONNECT_ERROR] for webtest5h.mydomain.com:27118 Fri Sep 28 19:54:38 [conn38] ReplicaSetMonitor::_checkConnection: webtest6h.mydomain.com:27118 { setName: "shard1", ismaster: false, secondary: true, hosts: [ "webtest6h.mydomain.com:27118", "webtest5h.mydomain.com:27118", "webtest4h.mydomain.com:27118" ], me: "webtest6h.mydomain.com:27118", maxBsonObjectSize: 16777216, localTime: new Date(1348847678165), ok: 1.0 } Fri Sep 28 19:54:39 [conn38] warning: No primary detected for set shard1 Fri Sep 28 19:54:39 [conn38] warning: socket exception when initializing on shard1:shard1/webtest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118, current connection state is { state: { conn: "", vinfo: "mpfs.user_data @ 9|1||5065a647b6f0ce641dc4665c", cursor: "(none)", count: 0, done: false }, retryNext: false, init: false, finish: false, errored: false } :: caused by :: 11002 socket exception [6] server [shard1/webtest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118] mongos shardconnection connectionpool error: connect failed to set shard1/webtest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118 Fri Sep 28 19:54:39 [conn38] DBException in process: socket exception [CONNECT_ERROR] for shard1/webtest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118 ------=_Part_712_4361195.1348848123972 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all,

I have linux rhel 6.3, mongodb 2.2 with sharding - 1 mongos,= 3 configsrv, 2 shards. Each shard - 3 head joined into replica set.
2 head of first replica set is down. status of third head is secondary
= second replica set is up

I have database with shardered collections = named user_data.

When I try read data from first shard - I got excep= tion:
mongos> db.user_data.find({"uid" : "10007570"})
error: {
=     "$err" : "socket exception [CONNECT_ERROR] for shard1/we= btest4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.= com:27118",
    "code" : 11002
}

If I connect d= irectly to live head of first shard and type rs.slave(true) - all works ok,= I can read data.

How can I do same from mongos?

Thanks.
<= br>mongos.log:
Fri Sep 28 19:54:38 [conn38] trying reconnect to webtest4= h.mydomain.com:27118
Fri Sep 28 19:54:38 [conn38] reconnect webtest4h.my= domain.com:27118 failed couldn't connect to server webtest4h.mydomain.com:2= 7118
Fri Sep 28 19:54:38 [conn38] ReplicaSetMonitor::_checkConnection: c= aught exception webtest4h.mydomain.com:27118 socket exception [CONNECT_ERRO= R] for webtest4h.mydomain.com:27118
Fri Sep 28 19:54:38 [conn38] trying = reconnect to webtest5h.mydomain.com:27118
Fri Sep 28 19:54:38 [conn38] r= econnect webtest5h.mydomain.com:27118 failed couldn't connect to server web= test5h.mydomain.com:27118
Fri Sep 28 19:54:38 [conn38] ReplicaSetMonitor= ::_checkConnection: caught exception webtest5h.mydomain.com:27118 socket ex= ception [CONNECT_ERROR] for webtest5h.mydomain.com:27118
Fri Sep 28 19:5= 4:38 [conn38] ReplicaSetMonitor::_checkConnection: webtest6h.mydomain.com:2= 7118 { setName: "shard1", ismaster: false, secondary: true, hosts: [ "webte= st6h.mydomain.com:27118", "webtest5h.mydomain.com:27118", "webtest4h.mydoma= in.com:27118" ], me: "webtest6h.mydomain.com:27118", maxBsonObjectSize: 167= 77216, localTime: new Date(1348847678165), ok: 1.0 }
Fri Sep 28 19:54:39= [conn38] warning: No primary detected for set shard1
Fri Sep 28 19:54:3= 9 [conn38] warning: socket exception when initializing on shard1:shard1/web= test4h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.c= om:27118, current connection state is { state: { conn: "", vinfo: "mpfs.use= r_data @ 9|1||5065a647b6f0ce641dc4665c", cursor: "(none)", count: 0, done: = false }, retryNext: false, init: false, finish: false, errored: false } :: = caused by :: 11002 socket exception [6] server [shard1/webtest4h.mydomain.c= om:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27118] mongos = shardconnection connectionpool error: connect failed to set shard1/webtest4= h.mydomain.com:27118,webtest5h.mydomain.com:27118,webtest6h.mydomain.com:27= 118
Fri Sep 28 19:54:39 [conn38] DBException in process: socket exceptio= n [CONNECT_ERROR] for shard1/webtest4h.mydomain.com:27118,webtest5h.mydomai= n.com:27118,webtest6h.mydomain.com:27118


------=_Part_712_4361195.1348848123972-- ------=_Part_711_29068655.1348848123971--