0

Are there any guidelines for choosing names for MongoDB replica sets? The documentation seems to mostly contain examples like rs1, rs-test, ... Is replica set name fully redundant, or could it reflect some entity?

I am setting up a new MongoDB service in my organization. Eventually we plan to serve multiple applications, so I think the replica set names that appear in the customer's connection string should be generic, but meaningful. Would love to hear the words of wisdom from the experienced DBAs.

1
  • Name it natalia if you prefer. It's fully up to you. However, using rs as pre- or postfix might be useful. – Wernfried Domscheit Apr 3 at 9:32
0

Replica set names are like hostnames... You can basically choose whatever you like, as long as you use letters, numbers and strict set of special characters (_-).

Of course, following your companies naming logic is preferred. Maybe name includes datacenter information, if your different replica sets are in different DCs (what is good thing).

1
  • thanks for the comments. It seems like underscores are not allowed, but that is OK. Can the "host name" include the domain name, like in rs-mongodb-prod.example.com? That would conveniently indicate the location (a good thing indeed), or it must be a short name? – Natalia Apr 5 at 19:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.