Hi
Why is this happening? ]I am very concerned with mongo given that I have done the best I can trying to follow the docs.
in /etc/hosts the ip and hostname are set for both servers
and yet..adding a node using this command leads to a corrupt cluster when this shouod be soooo easy. Both servers have the same config.
'
mongo 111.111.111.111 --eval 'printjson(rs.add("2-shard1-mongo-aws-development-sydney:27017"))'
The mongo docs leave me with no where to go on how to to make a rep set to work
Thanks
mongo 111.111.111.111 --eval 'printjson(rs.status())'
MongoDB shell version: 2.6.5
connecting to:
54.66.146.54/test{
"set" : "devSiteminder",
"date" : ISODate("2014-11-11T04:21:10Z"),
"myState" : 4,
"members" : [
{
"_id" : 0,
"name" : "1-shard1-mongo-aws-development-sydney:27017",
"health" : 1,
"state" : 4,
"stateStr" : "FATAL",
"uptime" : 539,
"optime" : Timestamp(1415678624, 1),
"optimeDate" : ISODate("2014-11-11T04:03:44Z"),
"self" : true
},
{
"_id" : 1,
"name" : "2-shard1-mongo-aws-development-sydney:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 523,
"optime" : Timestamp(1415677283, 1),
"optimeDate" : ISODate("2014-11-11T03:41:23Z"),
"lastHeartbeat" : ISODate("2014-11-11T04:21:09Z"),
"lastHeartbeatRecv" : ISODate("1970-01-01T00:00:00Z"),
"pingMs" : 1,
"electionTime" : Timestamp(1415679145, 11),
"electionDate" : ISODate("2014-11-11T04:12:25Z")
}
],
"ok" : 1
}
On the other node
mongo 222.222.222.222 --eval 'printjson(rs.status())'
MongoDB shell version: 2.6.5
connecting to:
54.66.234.102/test{
"set" : "devSiteminder",
"date" : ISODate("2014-11-11T04:20:57Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "2-shard1-mongo-aws-development-sydney:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 512,
"optime" : Timestamp(1415677283, 1),
"optimeDate" : ISODate("2014-11-11T03:41:23Z"),
"electionTime" : Timestamp(1415679145, 11),
"electionDate" : ISODate("2014-11-11T04:12:25Z"),
"self" : true
}
],
"ok" : 1
}