MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Removing a Mongos Node

Hi,

What is the recommended way of Removing a Mongos Instance? I didn’t find anything on the documentation.

Thank You!

Hey @Mohammad_Fahim_Abrar

Here is the doc for start and stop a mongodb

https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes/

And here are the docs to remove a replica set member
https://docs.mongodb.com/manual/tutorial/remove-replica-set-member/

Hope this helps

Hi,

I tried the shutdown command to remove mongos router node. But the mongos collection in config database still contains the entry of the removed node. Is that a normal behavior?

Thank you!

Yes. Don’t worry about it. Just shut it down and you’re fine.

Internal MongoDB Metadata

The config database is internal: applications and administrators should not modify or depend upon its content in the course of normal operation.

The mongos collection stores a document for each mongos instance affiliated with the cluster. mongos instances send pings to all members of the cluster every 30 seconds so the cluster can verify that the mongos is active. The ping field shows the time of the last ping, while the up field reports the uptime of the mongos as of the last ping. The cluster maintains this collection for reporting purposes.

https://docs.mongodb.com/manual/reference/config-database/#config.mongos

3 Likes