-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 2.0.1
-
Component/s: Internal Code
-
Environment:Ubuntu 11.04, Mongodb 2.0.1
-
Linux
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
We are trying to secure our new multi-datacenter mongo cluster using stunnel. To do so we created additional interfaces, assigned them unused ips, and added entries to /etc/hosts. Communication was tested with mongo --host and is working as expected. We use bind_ip to carefully control which of the available interfaces mongod is listening on.
The issue we ran into is that adding the new member runs afoul of the isself() check:
Mon Oct 24 07:13:00 [conn14] run command admin.$cmd { replSetReconfig: { _id: "members-a", version: 7, members: [
{ _id: 0, host: "ecnext80:27017" },
{ _id: 1, host: "ecnext78:27017" },
{ _id: 2, host: "ecnext82:27017" },
{ _id: 3.0, host: "rsmongo008:27017" } ] } }
Mon Oct 24 07:13:00 [conn14] replSet replSetReconfig config object parses ok, 4 members specified
Mon Oct 24 07:13:00 [conn14] getMyAddrs(): [127.0.0.1] [10.27.17.1] [10.27.17.2] [10.27.17.3] [10.27.17.5] [10.27.17.6] [10.27.17.7] [10.27.17.4] [10.28.16.151] [216.12.148.188] [172.18.5.34] [::1] [fe80::5054:ff:fed2:ba9e%eth0] [fe80::5054:ff:fe68:1fa8%eth1] [fe80::5054:ff:fe38:7593%eth2]
Mon Oct 24 07:13:00 [conn14] getallIPs("rsmongo008"): [10.27.17.4]
Mon Oct 24 07:13:00 [conn14] User Assertion: 13278:bad config: isSelf is true for multiple hosts: ecnext82:27017,rsmongo008:27017
Mon Oct 24 07:13:00 [conn14] replSet replSetReconfig exception: bad config: isSelf is true for multiple hosts: ecnext82:27017,rsmongo008:27017
Mon Oct 24 07:13:00 [conn14] command admin.$cmd command: { replSetReconfig: { _id: "members-a", version: 7, members: [
,
{ _id: 1, host: "ecnext78:27017" },
{ _id: 2, host: "ecnext82:27017" },
{ _id: 3.0, host: "rsmongo008:27017" }] } } ntoreturn:1 exception: bad config: isSelf is true for multiple hosts: ecnext82:27017,rsmongo008:27017 code:13278 reslen:183 0ms
Those 10.27.17.* ips are actually stunnel client endpoints. Further, the server itself is not listening on them:
stsmith@ecnext82:~$ grep bind_ip /etc/mongodb-members-a.conf
bind_ip=127.0.0.1,10.28.16.151
Shouldn't isself() account for bind_ip? Specifically, shouldn't getMyAddrs() only return the ips specified via bind_ip – 127.0.0.1 and 10.28.16.151 in this case?
We tried
{force:true}for the reconfig, but it didn't help. We also tried having the interface unconfigured when we added rsmongo008, but bad things happened once we brought up that interface.
We are in a position to quickly build/test any suggested patches.
Thanks,
Stephen J. Smith
Systems Engineer
Manta Media, Inc.