Stop mongos process

mongodb

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!

Best Answer

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

Related Topic