Mongodb – When converting a replica set with an arbiter to a shard, does the arbiter also get added to the shard

mongodbmongodb-3.2sharding

I'm converting an existing replica set that has an arbiter to a shard as shown in this guide:

https://docs.mongodb.com/v3.2/tutorial/convert-replica-set-to-replicated-shard-cluster/

and it's unclear if the arbiter needs needs to be included in the sh.addShard() method as shown here:

https://docs.mongodb.com/v3.2/tutorial/convert-replica-set-to-replicated-shard-cluster/#add-initial-replica-set-as-a-shard

I'd guess that it doesn't since it doesn't carry a copy of the data but I couldn't find a distinct answer one way or the other.

Best Answer

When you add a new shard using sh.addShard(...) you are providing a seed list of members which will be used to discover the current replica set configuration. You can specify as few as one member of the replica set or as many as all, and you do not need to specifically include the arbiter.

FYI, the sh.addshard() mongoshell helper wraps the underlying addShard command (which has a few additional options not currently exposed via the sh.addShard() helper).