Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

ARTICLE NOT POLISHED

It may happen upon restarting a mongo addon that the replicaSet is lost - meaning that all hosts in the replicaSet are not valid anymore (because of IP/host change) therefore meaning that the cluster is stale.

If this happens you can follow the instructions below to recover the replica set:

  1. First choose a container in your mongo addon - preferrably the last master if you can identify it

    nex-cli cubes --addon name_of_mongo_addon
  2. Stop all other mongo containers

    nex-cli cubes:stop other_container_id
  3. SSH to the rack hosting the container that is still alive

    nex-cli racks:ssh 10.1.1.1
  4. Connect to the container

    sudo nex-attach my_container_id
  5. Connect to Mongo using the Shell

    mongo -u $MONGO_USER -p $MONGO_PASSWORD admin

  6. Delete the local replication information

    use local
    db.dropDatabase()
  7. Exit the MongoShell and the container
  8. On the rack issue a restart of the container. Upon restart the mongo instance will initiate a new replicaSet (previous one being deleted)

    # Restart
    nex-restart --name my_container_id
    
    
    # Monitor logs
    docker logs -f my_container_id
  9. Exit the rack and bring up the other nodes using the nex-cli

    nex-cli cubes:start other_container_id
  • No labels