The first thread has the info you need - in short, stop mongos, modify
the config server collection "config.shards" (on all config servers)
with the replica set connection strings (i.e.
name/host1:port,host2:port), restart mongos. The doc page is meant for
upgrading single servers to replica sets.
> With a mongos connected to my config server and a mongo connected to
> that mongos, I still see the same result for listshards, even after
> restarting the config server.
Was mongos running when you removed the primary? Also, there have been
some issues reported when not explicitly specifying port #s in conn
strings, like "testr/10.177.193.252", I'd recommend always using port #s
for now.
Yes, mongos should have detected this change and updated the config
server data.
There's two levels of changes here - changes to the shards sometimes
require a restart of mongos, but changes to the replica set should not.
I suspect it may be related to the port # thing, but I've opened a JIRA
in any case to look more: https://jira.mongodb.org/browse/SERVER-3333
> If not, is there anything I can do if I change a shard to a replica
> set but I accidentally left a mongos running?
Basically the mongos just caches what's in the config server, so
restarting the mongos will get it up-to-date again. Definitely try to
avoid manually editing the config server with running mongoses though.
> What if my original configuration already had hosts added without port
> numbers?
You can use the same trick as before, just shut down all the mongos
instances, update config.shards, and restart the mongos instances.
On Fri, 2011-06-24 at 11:28 -0700, raylu wrote: