If I have a 4 node cluster + 1 hot swappable node, does the SDK config for connecting to the cluster have to only have 4 of the node names/ips or can it have all 5? If we wanted to do maintenance on each node in the cluster, one at a time, and would swap it in/out with the extra node, can all nodes be listed in the SDK config, or do we have to change it each time we remove one and add a new one? We are using the PHP SDK.
Specifically how do we best configure the PHP SDK adapter code to use the plus one server?
If we’re using 4 +1, do we just put 4 servers in the config and then add the 5th when needed, or do we put all 5 in the array and hope it never needs to hit the 5th one while its not in the cluster?
Thanks for using our product. PHP SDK once it connects to cluster, it will connect to all nodes in cluster. You could make connection to either a node in cluster or all nodes as in document below
If you have any more question, drop me a line at thuan at couchbase dot com
If you’re looking to dynamically manage the nodes in the cluster outside the code, that’s what the DNS SRV records are intended for. Have a look at the section there that @thuan points to.
Also, note that adding other hostnames/IPs for “future expansion” wouldn’t be a problem, but could slow down bootstrap a little bit.