1

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?

2
  • What version of MongoDB are you running (as reported by db.version() in the mongo shell)?
    – Stennie
    Commented Mar 14, 2018 at 21:35
  • the version is 3.2.10. Commented Mar 15, 2018 at 3:38

2 Answers 2

1
  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.
0

Solution is start it as replica set (command line or config parameter) and run rs.initiate() after that. Now you have one node replica set, what you can expand to three node, if you want.

2
  • Thanks. But according to the document, after rs.initiate(), we need to set configsvrMode to "sccc", then add other two members. Finally remove the sccc in the first member. However, we only use one member for development, so we confused how to handle it. Commented Mar 15, 2018 at 3:38
  • That documentation is stating how you convert your old config server without downtime. With only one config server it is of course impossible. And because that, you can keep your config server port number as it was, no need to change it.
    – JJussi
    Commented Mar 15, 2018 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.