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?


2 Answers 2


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


You can try to stop

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


To shut down a specific mongod instance use below command:

kill mongod process ID


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .