I have configured 4 node couchbase cluster. Now application team wants to use this cluster for their application deployments and testing so please let me know how can you provide best connection configurations to their application for high availability like “single host name DNS registration which maps internally to these 4 cluster nodes” then can we provide this DNS host name to application team or is there any other best configurations available?
Thanks in advance.
Let me explain how the Couchbase SDKs connect to the cluster. When the application starts up it will bootstrap against one node using the configure provide to the SDK. Once it has connected successful to the node then it will pull the cluster map directly from that node, from that point on the SDK will only get the cluster map direct from the nodes in cluster. When the application server restarts the SDK will go through the bootstrap process again.
There are a few different options for bootstrapping:
Every client can bootstrap using a list of nodes. If one node is unavailable it will try and boot strap against the next node in the list. This does mean that the SDK config has to be kept up to date if all the nodes in the bootstrap list were to be removed from the cluster. For more information see: Connecting to a Bucket
The other option is to use DNS SRV records. In this case the SRV record will contain a list of nodes. The SDK will read the DNS SRV record and use that as the bootstrap list. This means that the SRV record can be updated outside of the SDK config. For more information see: Using DNS SRV records
Given the information you have provided it sounds like option 2 is what you’re looking for.
Please let me know if you have any more questions.
Thank you Pvarley for your explanation. DNS SRV looks like as follows
_couchbase._tcp.example.com. 3600 IN SRV 0 0 0 node1.example.com.
_couchbase._tcp.example.com. 3600 IN SRV 0 0 0 node2.example.com.
_couchbase._tcp.example.com. 3600 IN SRV 0 0 0 node3.example.com.
Is the Second option can be used at Couchbase client?
What do you mean by the second option? If you mean DNS SRV then yes the Couchbase clients can use it.
Thank you Pvarley for your update. I am thinking to create a DNS hostname which points to my 4 node cluster ips. By using this DNS hostname , can we connect to couchbase cluster for high availability as well as for node unavailability? The proposed DNS hostname points to all cluster node ips is equivalent to a scan concept in oracle Real Application (RAC) cluster.