March 2019
Intermediate to advanced
394 pages
11h 4m
English
To convert a standalone server into a replica set, we first need to cleanly shut down the mongo server:
> use admin> db.shutdownServer()
Then, we start the server with the --replSet configuration option via the command line (which we will do here), or by using a configuration file, as we will explain in the next section:
> rs.initiate()
> rs.add("<hostname><:port>")
Read now
Unlock full access