mongodb replica set master “stateStr” : “REMOVED”

I have a mongodb replicaset running in a docker container (mongo:3.0.11) in a aws vpc (for this specific case just one node, primary).

This server is shutdown every night and started again in the next morning.

  • AWS ECR image list
  • Self hosted kibana 5.1.1 showing blank pages after connected to AWS Elasticsearch 5.1.1
  • Docker + Jenkins + AWS
  • How much maximum heap space does a Play Framework App use per default
  • Proxying http requests to another docker container
  • How do I run an nginx reverse proxy container on ECS using arguments
  • After a few months running seamlessly, I’m having a few errors in the past few weeks. Happens that once or twice a week the mongo startup fails.

    rs.status() returns stateStr: REMOVED

    and as error message: errmsg : "Our replica set config is invalid or we are not a member of it"

    Looking at the mongo logs I have:

    2016-06-07T12:01:48.724+0000 W NETWORK [ReplicationExecutor] getaddrinfo("") failed: Name or service not known

    When this error happens, a simple restart on the docker container will fix, but I’m struggling to understand what is causing this error to happen occasionally.

  • How can I install docker toolbox on windows 7
  • Jenkins Github Plugin can't choose my credentials
  • Why isn't docker commit saving data in my mongo database container?
  • Database in a Docker application
  • How to restore a .sql.gz dump on a Docker MySQL instance?
  • Docker run command, volumes error
  • One Solution collect form web for “mongodb replica set master “stateStr” : “REMOVED””

    Probably the replica loses the configuration when doing the restart. It is possible that the replica loses the reading of the DNS reason why it does not manage to raise when the server is started.

    What you can do is to point to the machine directly through the in the Execute db.isMaster() in primary to not restart.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.