0
./mongos --configdb mongodb0.test.net:27030,mongodb1.test.net:27030,mongodb2.test.net:27030 --port 27040 --logpath routing.log --fork

I run this script to setup my routing server.

For mongod, I can use --shutdown or enter to mongo and write db.shutdownServer() but it is not the case for mongos.

are there any ways to shutdown? Thank you.

fmchan
  • 760
  • 1
  • 11
  • 29

1 Answers1

1

The routers (mongos) do not actually maintain any persisted data themselves. Instead all data is managed by separate mongod instances for the config servers or otherwise in members of the shards they are accessing.

As such can simply be shutdown with signal handling from the kill command.

For more information on tracking the pid for created processes see the --pidfilepath option in the documentation.

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
  • thank you. I also think kill command is the only way. btw, I would like to request professional advices about this topic: http://stackoverflow.com/questions/22956722/spring-data-mongodb-how-to-config-more-than-one-routing-servers – fmchan Apr 10 '14 at 06:54
  • @fmchan Well you can either do it that way or use other daemon management tools, but most methods will internally to the same thing – Neil Lunn Apr 10 '14 at 07:30