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.

  • Choosing the right AWS Services and software tools
  • Packer instance accessing private Docker registry in AWS
  • Docker data-only container on AWS ECS
  • How install the Amazon ECS Container Agent in Debian? (ecs-init)
  • Using AWS EFS with Docker
  • Docker for AWS and Selenium Grid - Connection refused / No route to host (Host unreachable)
  • 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.

  • Docker daemon restart and reattaching to containers
  • API HOST name from env variable node js
  • How to mix several python scripts into a shell script?
  • Using Docker to create “restorable” MySQL database for UI testing
  • Using the RUN instruction in a Dockerfile with 'source' does not work
  • How to download file from docker container?
  • 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.