Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to use rockmongo, to connect to our cluster.

Our setup is a setup of two shards each consisting of a replicaset. I try to connect to the mongos instance and while rockmongo connects I get an error when trying to list the dbs:

Execute failed:not master function (){ return db.getCollectionNames(); }

This has something to do with the replica sets and everybody points to:

$MONGO["servers"][$i] = array("replicaSet" => "xxxxx");

This is all fine, but I have two replicasets and as far as I understand I should connect to the mongos instance and not directly to the members of the set.

So how does one use rockmongo to connect to a mongo sharded setup with replicasets?

share|improve this question
add comment

1 Answer

When you are running in a sharded setup you should not be connecting to the replica sets individually, rather you just connect to mongos and it will proxy connections back to the appropriate shard. Have you tried replacing your current config to point to just the mongos host (and port) rather than the replica set?

I assume no, since the mongos would not return the "not master" error. Given that error though I would also take a look at each replica set individually and run rs.status() to verify your replica sets each have a primary.

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.