check config server status from mongos

2,938 views
Skip to first unread message

Tim

unread,
Aug 24, 2012, 10:35:11 AM8/24/12
to mongod...@googlegroups.com
Hello,

How do I check the status of my config server from a mongos process

I login to my mongos

mongo host:port/admin
mongos>

and then? Does config.status() or something like this exists?

Thanks,
best regards,
Tim

markh

unread,
Aug 24, 2012, 11:11:23 AM8/24/12
to mongod...@googlegroups.com
Hi Tim,

What exactly do you mean by "status"?

If you mean "config.status()" like "rs.status()", there's no such a command.

If you want to verify that each of the config servers are up then you could connect directly to each mongod config server through the mongo shell.

Remember that the mongos only has the cached data. One thing you could do to check the status is to run flushRouterConfig and refresh the shard cluster metadata on the mongos. Please note though that this will only contact one config server (not all three).

Thanks

Mark

Tim

unread,
Aug 27, 2012, 7:51:28 AM8/27/12
to mongod...@googlegroups.com
Hi Mark,

Yes, I want to verify that each config server is up. I checked the Server by using "top", there was a mongod instance running. How would I connect from mongos to the config server?

mongo host:port/admin

and then?

thanks,
Tim

Scott Hernandez

unread,
Aug 27, 2012, 8:32:46 AM8/27/12
to mongod...@googlegroups.com
Running db.isMaster() or db.serverStatus() should suffice as a simple
test; this is true with any server instance.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb

Tim

unread,
Aug 27, 2012, 9:32:33 AM8/27/12
to mongod...@googlegroups.com
I thought about checking the config Server status from the mongos shell - is that possible with 'db.isMaster()' or 'db.serverStatus()' ?
Thanks

Eliot Horowitz

unread,
Aug 27, 2012, 4:01:32 PM8/27/12
to mongod...@googlegroups.com
The best thing to do is:
connect to a mongos
use config
db.adminCommand( "fsync" )

That will make sure all config servers are up and healthy.

David Richardson

unread,
Aug 7, 2013, 4:55:47 PM8/7/13
to mongod...@googlegroups.com, el...@10gen.com
I get the same response whether they're all up or not.

mongos> db.adminCommand( "fsync" )
{
        "numFiles" : 151,
        "all" : {
                "shard1_replica_set" : {
                        "numFiles" : 77,
                        "ok" : 1
                },
                "shard2_replica_set" : {
                        "numFiles" : 74,
                        "ok" : 1
                }
        },
        "ok" : 1
}
Reply all
Reply to author
Forward
0 new messages