I have three instances on EC2, each one with service mongo, set up with replica set, ie, a primary (192.168.1.1), a secondary (192.168.1.2) and an arbiter (192.168.1.3).
I have several applications that connect with mongo.
My question is as follows:
If I add another member in the replica, I have to change all applications in the connection setup to include the new member?
Because I ask it.
Suppose ip with final .1 be primary, .2 is secondary, then add a new member to the end ip .4. And I do not include this new member in the application database settings. And did the primary falls, the arbiter chooses ip with .4 to be the new primary. All applications will begin throw exception.
How can I "fix" it, in a way that always I have to add a new member does not need to be changing the configuration of the application database. Imagine if I have to add 'n' members.
Do you have any way to configure the application, knowing that my application is in PHP, to identify the primary alone without having to add the host configuration?