rs.initiate({ _id: "shard1ReplSet", members: [ { _id: 0, host: "shard1-0.shard1.mongodb.svc.cluster.local:27018" }, { _id: 1, host: "shard1-1.shard1.mongodb.svc.cluster.local:27018" }, { _id: 2, host: "shard1-2.shard1.mongodb.svc.cluster.local:27018" } ] }) rs.status().members.map(m => ({ name: m.name, state: m.stateStr })) exit