I have this configuration:
mongos> db.adminCommand('getShardMap')
{
"map" : {
"RS13" : "RS13/mongo09-02:27003,mongo09-01:27001",
"RS13/mongo09-02:27003,mongo09-01:27001" : "RS13/mongo09-02:27003,mongo09-01:27001",
"RS26" : "RS26/mongo09-04.de.prod:27008,mongo09-01:27002",
"RS26/mongo09-04.de.prod:27008,mongo09-01:27002" : "RS26/mongo09-04.de.prod:27008,mongo09-01:27002",
"RS45" : "RS45/mongo09-02:27004,mongo09-03:27005",
"RS45/mongo09-02:27004,mongo09-03:27005" : "RS45/mongo09-02:27004,mongo09-03:27005",
"RS67" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"config" : "mongo09-01:27011,mongo09-02:27012,mongo09-03:27013",
"mongo09-01:27001" : "RS13/mongo09-02:27003,mongo09-01:27001",
"mongo09-01:27002" : "RS26/mongo09-04.de.prod:27008,mongo09-01:27002",
"mongo09-02:27003" : "RS13/mongo09-02:27003,mongo09-01:27001",
"mongo09-02:27004" : "RS45/mongo09-02:27004,mongo09-03:27005",
"mongo09-03.de.prod:27006" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"mongo09-03:27005" : "RS45/mongo09-02:27004,mongo09-03:27005",
"mongo09-03:27006" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"mongo09-04.de.prod:27007" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"mongo09-04.de.prod:27008" : "RS26/mongo09-04.de.prod:27008,mongo09-01:27002"
},
"ok" : 1
}
Actually mongo09-03 it seems to be duplicated:
"mongo09-03.de.prod:27006" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
"mongo09-03:27006" : "RS67/mongo09-03:27006,mongo09-03.de.prod:27006,mongo09-04.de.prod:27007",
And please consider replica set RS67 is also part of a sharding cluster.
May I remove a mongodb replica set when it is into a sharding cluster ? And if yes, how?
Can I use rs.remove(hostname) ?
It isn't an easy run one command type thing. See the following on the doc site
http://docs.mongodb.org/manual/tutorial/remove-shards-from-cluster/
To remove a replicaset member
We have successfully configured the replica set executing this command:
The shard map now it is correctly configured and extra mongo09-03 has been disappeared.
please also consider that: