MongoDB tip: MongoDB 3.4, creating replica set using config file
In my previous post, MongoDB tip: MongoDB 3.4, adding replica set members, issue/resolution , we created the replica set using rs.add(), in this post, I am going to use the config file option to achieve the same result. First, let's spin up 3 mongod instances. This can be done in single servers or multiple servers, doesn't really matter, as long as for multiple servers, they can resolve the IP/hostname and communicate with one another. I edited the /etc/hosts to make sure the hostname can be resolved 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain 10.155.208.169 demo2.net demo2 10.155.228.75 demo3.net demo3 10.155.208.207 demo1.net demo1 To validate, same ping from one of the servers to the other two by, assuming from demo3 ping demo1 ping demo2 On all servers, start the mongod process as # assign ownership of /data/demo to user mongod chown -R mongod. /data/demo # this starts mongod process as user mongo...