prod_repl:SECONDARY> rs.status(){"set" : "prod_repl","date" : ISODate("2012-08-30T22:07:07Z"),"myState" : 2,"members" : [{"_id" : 0,"name" : "ip-10-xxx-xxx-xxx:27017","health" : 1,"state" : 2,"stateStr" : "SECONDARY","uptime" : 329,"optime" : Timestamp(1346361547000, 1),"optimeDate" : ISODate("2012-08-30T21:19:07Z"),"self" : true},{"_id" : 1,"health" : 1,"state" : 6,"stateStr" : "UNKNOWN","uptime" : 329,"optime" : Timestamp(0, 0),"optimeDate" : ISODate("1970-01-01T00:00:00Z"),"lastHeartbeat" : ISODate("2012-08-30T22:07:06Z"),"pingMs" : 0,"errmsg" : "still initializing"},{"_id" : 2,"name" : "ec2- xxx-xxx-xxx-xxx .compute-1.amazonaws.com:27017","health" : 1,"state" : 6,"stateStr" : "UNKNOWN","uptime" : 329,"optime" : Timestamp(0, 0),"optimeDate" : ISODate("1970-01-01T00:00:00Z"),"lastHeartbeat" : ISODate("2012-08-30T22:07:06Z"),"pingMs" : 1,"errmsg" : "still initializing"}],"ok" : 1}
> rs.status(){"startupStatus" : 4,"errmsg" : "can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE)","ok" : 0}
Just a few quick thoughts and questions...
1. Are there any exceptions in the secondary servers' mongo.log?
2. Is communication open among the replica set servers' EC2 security groups? Can you telnet from one of the secondary servers to the listen port of the primary? Are all three in the same AWS region?
3. Can you confirm the names of the hosts' names are still valid and each of the servers can be resolved from each replica set member?
Regards,
Brian
[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
[rsStart] replSet info you may need to run replSetInitiate -- rs.initiate() in the shell -- if that is not already done
[rsStart] getaddrinfo("ip-xx-xxx-xxx-xxx") failed: Name or service not known[rsStart] couldn't connect to ip-xx-xxx-xxx-xxx:27017: couldn't connect to server ip- xx-xxx-xxx-xxx:27017
Did the 3 servers have Elastic IP addresses? If not, the public DNS name would have changed unless you rebooted an EBS-backed instance.
Can you recreate the replica set with instances that have EIPs and see whether the behavior changes?
Regards,
Brian
Regards,
Brian
prod_repl:SECONDARY> rs.conf(){"_id" : " prod_repl ","version" : 3,"members" : [{"_id" : 0,"host" : "ip-10-xxx-xx-xxx:27017"},{"_id" : 1,},{"_id" : 2,}]}> rs.conf()null> rs.conf()null
Please confirm how you're verifying connectivity. Please show the output from each of the servers when running the mongo command (connecting to other servers using the connection syntax Scott proposed). I'm willing to bet the problem lies in connecting from host 2 and 3 back to host 1.
Did you have a chance to stand up a second replica set with different hosts?
Regards,
Brian
ubuntu@ip-xx-xxx-xx-xxx:/var/lib/mongodb$ mongo ec2-xxx-xx-xxx-xx.compute-1.amazonaws.com:27017MongoDB shell version: 2.2.0connecting to: ec2-xxx-xx-xxx-xx.compute-1.amazonaws.com:27017/testprod_repl:SECONDARY>
I fixed this by running "rs.slaveOk()" in the shell session, which allowed me to read from the collection and verify that the replication was indeed working properly.error: { "$err" : "not master and slaveOk=false", "code" : 13435 }
--
Thanks for posting your results and, more importantly, glad to hear you worked through your issue. Name resolution in EC2 is always interesting. I would say, where possible, use the public DNS when addressing hosts.
Regards,
Brian