for that i shutdown the whole cluster and started them with --replSet.
I also added another members and an arbiter.
This is the current configuration:
config0 - localhost:20000
mongos - localhost:27017
shard0 - localhost:10000 / replSet - localhost:10010 / arbiter -
localhost:10020
shard1 - localhost:10001 / replSet - localhost:10011 / arbiter -
localhost:10021
shard2 - localhost:10002 / replSet - localhost:10012 / arbiter -
localhost:10022
All work well between them, the failover works, but the real problem is
in the cluster.
because the cluster does not know that those shards are replicasets.
If i had built the cluster from scratch with those replicasets i know i
would have used: db.runCommand({ addshard : shard0/localhost:10000}); to
add a replicaset named shard0 to the cluster.
This will not work because the cluster already knows localhost:10000 and
i get an error
"can't add shard shard0/localhost:10000 because a local database
'shardDb' exists in another shard0000:localhost:10000
How can i modify the cluster configuration so it will be aware those
shards have replicasets?
Thanks!
Is this a test configuration? If not, this seems like a bad idea.
> --
> 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.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>
>
Thanks!!
> db.shards.find();
{ "_id" : "shard0000", "host" : "localhost:10001" }
{ "_id" : "shard0001", "host" : "localhost:10002" }
{ "_id" : "shard0002", "host" : "localhost:10003" }
{ "_id" : "shard0", "host" : "shard0/localhost:10000" }
That's my config server, i have shutdown mongos and connect directly to
the config server.
Thanks!
example:
> db.shards.update( { _id: "shard0000" }, { _id: "shard1", "host" :
"shard1/localhost:10001" });
> db.shards.find();
{ "_id" : "shard0001", "host" : "localhost:10002" }
{ "_id" : "shard0002", "host" : "localhost:10003" }
{ "_id" : "shard0", "host" : "shard0/localhost:10000" }
{ "_id" : "shard1", "host" : "shard1/localhost:10001" }
mongos fails here.., he can't find shard0000 while doing a balance.
> db.shards.update({ _id : "shard0000" }, { _id : "shard0000", "host" :
"shard1/localhost:10001" });
> db.shards.find();
{ "_id" : "shard0001", "host" : "localhost:10002" }
{ "_id" : "shard0002", "host" : "localhost:10003" }
{ "_id" : "shard0", "host" : "shard0/localhost:10000" }
{ "_id" : "shard0000", "host" : "shard1/localhost:10001" }
mongos works, he can find shard0000 and also know it's a replicaset,
shard1/localhost...
Fri Jan 14 11:30:24 [Balancer] updated set to:
shard1/localhost:10001,localhost:10011
Correct?