2

May be a dumb question,

In a sharded database configuration, I launched my mongos with the following command :

mongos --configdb config1:27019,config2:27019,config3:27019

I now need to stop mongo to enable internal Authentification and use a .conf file, problem is, whereas I can just do a systemctl stop mongod under the other config/shard servers, mongos behave differently.

ps aux | grep mongo give me this :

root      5200  0.4  1.3 317544 13588 ?        Sl   Dec30   6:01 mongos --config /etc/mongos.conf

I don't want to kill the process and risking making a mess, is there a way to gently stop mongos?

Thanks!

2 Answers 2

3

Log on to the mongos, run use admin, then db.shutdownServer() to gracefully shut down the mongos and leave the shards running.

0
1

You can try to stop

mongod --dbpath /path/to/your/db --shutdown

or

To shut down a specific mongod instance use below command:

kill mongod process ID

WARNING:

Never use kill -9 (i.e. SIGKILL) to terminate a mongod instance.
1
  • I was trying to stop mongos, not mongod, but thanks anyway
    – Irrational
    Jan 4, 2016 at 14:55

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.