Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

There are old entries in my "config.mongos"; they reference hosts which previously had "mongos" running on them but no longer do.

Can I safely remove those entries?

e.g.,:
# Old entries
{ "_id" : "silicon:27117", "ping" : ISODate("2012-12-27T19:51:04.560Z"), "up" : 9301, "waiting" : true }
...
# Current entries
{ "_id" : "app1:27017", "ping" : ISODate("2013-06-07T17:12:02.856Z"), "up" : 5593404, "waiting" : true }
{ "_id" : "app2:27017", "ping" : ISODate("2013-06-07T16:17:49.812Z"), "up" : 5590271, "waiting" : false }
{ "_id" : "app4:27017", "ping" : ISODate("2013-06-07T17:12:02.110Z"), "up" : 5593413, "waiting" : true }
{ "_id" : "app3:27017", "ping" : ISODate("2013-06-07T17:12:02.854Z"), "up" : 5593578, "waiting" : true }

Update:

One reason why having these old entries in config.mongos is a problem is that making changes to the shard takes a long time, while we wait for old mongoses to time out.

For example, stopping the balancer takes a long time (several minutes):

mongos> sh.stopBalancer()
Waiting for active hosts...
Waiting for active host magnesium:27117 to recognize new settings... (ping : Thu Dec 22 2011 03:08:14 GMT+0000 (UTC))
Waited for active ping to change for host magnesium:27117, a migration may be in progress or the host may be down.
Waiting for active host Boron:27017 to recognize new settings... (ping : Tue Jan 31 2012 21:48:12 GMT+0000 (UTC))
Waited for active ping to change for host Boron:27017, a migration may be in progress or the host may be down.
Waiting for active host Beryllium:27017 to recognize new settings... (ping : Wed Feb 01 2012 17:34:15 GMT+0000 (UTC))
Waited for active ping to change for host Beryllium:27017, a migration may be in progress or the host may be down.
Waiting for active host helium:27017 to recognize new settings... (ping : Mon Jun 10 2013 19:07:41 GMT+0000 (UTC))
Waited for active ping to change for host helium:27017, a migration may be in progress or the host may be down.
Waiting for active host boron:27017 to recognize new settings... (ping : Sun Jun 02 2013 08:46:57 GMT+0000 (UTC))
Waited for active ping to change for host boron:27017, a migration may be in progress or the host may be down.
Waiting for the balancer lock...
share|improve this question
    
same question as I asked on mongodb-users group - why do you want to remove them? –  Asya Kamsky Jun 8 '13 at 21:21
    
@AsyaKamsky, I updated my question with an example of stopBalancer taking a long time... –  Chris W. Jun 10 '13 at 20:09
1  
the timeout is not based on the number of mongos entries in that collection, it's strictly a time based timeout (60 seconds). –  Asya Kamsky Jun 10 '13 at 20:50
add comment

1 Answer

up vote 1 down vote accepted

You can remove these entries, but there is really no reason to do so. The config.mongos collection just records all mongos processes that have connected to the config server in question. Hence any that reconnect at any point will just show up again - it's a book keeping thing, and only takes up a few KB at most, there's no need to delete them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.