0

I have few mongoDB instances running as replication set. For each of them, I have prepared configuration file with replSetName, so starting mongo by mongod without -replSet is still adding it to replication set. But, to maintenance instance, I need to run it with replSet disabled - is it possible to override replSetName from configuration by some mongod parameter (like mongod -port, which overrides port: from conf file)

rzysia
  • 737
  • 1
  • 11
  • 26

1 Answers1

1

Simple answer is no...

When I need to start node to maintenance mode, I have "ready made string" on my "notepad++" what includes all needed parameters as command line parameters (of course different port number) to bring node up without --replSet..

JJussi
  • 1,540
  • 12
  • 12
  • So the only way is to prepare second, let's say, maintenance-config file without replication and pass it when starting mongod for maintenance? – rzysia Jan 12 '17 at 08:48
  • 1
    Yes.. That's one good solution too.. It's easy to say mongod -f /etc/mongo.maintenace.. However, remember run that with same user credentials than normal mongod process.. So, if you normally say 'service mongod start', what uses mongod user, you should remember to use mongod user when you run mongod at maintenance mode.. OR after maintenance mode, you say something like chown -R monogd: /data/db to be sure that all data files are still owned by mongod user... – JJussi Jan 13 '17 at 11:39