Mongodb – Upgrade Single Config Server to Replica Set

configurationmongodb

Recently we wanted to upgrade our Config Server to Replica Set. Since it is a development environment, we only have one Config Server running.

However, the official mongoDB documentation "Upgrade Config Servers to Replica Set" is written for three Config Servers.

How can we upgrade a configuration with only one Config Server?

Best Answer

  1. Add a the following line in config file

    replication:
       replSetName: csReplSet
    
  2. restart your instance

  3. login and use admin
  4. initiate to replica
  5. add members
  6. configure priority
  7. check your replica cluster.