I need to setup master/slave replication for mongodb 3.2 server. Servers are Centos 6.7 and mongodb is latest 3.2 from offical RPMS. My /etc/mongod.conf is pretty much with default options from the RPM package. I know that 3.2 version is using YAML style for config file but no matter how i put master: enable , master: true or whatever mongod startup fails. I tryed to put the option into /etc/sysconfog/mongod file but this does not work also. My question is what is the correct way or command to put in to enable master mode. I putted --master into the startup script of the daemon and its looks OK but i don't think this is the right way to do this.

Thanks in advance.


Referring to MongoDB manual You should try to use replication setting if any chance, and the master-slave behavior you want should be able to be simulated using replication settings.

Also you can convert your current master-slave nodes to a replica set, you can find the paragraph in the same page.

I guess you don't feel it's right because it's not recommended by mongodb to use this command line feature any more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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