How does Round Robin DNS work with Aerospike?
Round-robin DNS (or Resource Distribution Pool) is supported by most Aerospike client libraries (including the C, C# and Java client libraries). This feature is used to seed a cluster using a DNS entry that does round-robin across different IP addresses for the nodes in the cluster.
For Aerospike Clients
- For clients configured to use DNS, all of the IP addresses appear as aliases to the base DNS name. The client will validate and add these aliases as server nodes. If one or more connections are made, the cluster will be initialized properly.
- The seed is only referenced on these 2 occasions:
- When no nodes are responding to cluster tend info requests.
- This technique is used to abstract the IP addresses of a cluster from the client’s seed.
- A good example for this feature is when you need to facilitate the addition of new nodes in a cluster or to even fully point a client to a new cluster.
- The client and all server nodes must reference the same DNS server where round-robin addresses have been configured for this to work.
- This does not affect any client operations outside of the initial seeding of the cluster.
- When one node in the cluster goes down, there is a lag (usually 1 – 2 seconds) until the client gets a new partition map. The client will continue to direct commands to the node that went down until the map is updated. To succeed transactions in such windows, it is recommended to use appropriate client policy settings so that transactions are retried and eventually succeed.
For Aerospike Server
- The server mesh configuration (mesh-seed-address-port) can be configured to use DNS name for versions 3.10 and above.
- If the DNS name resolves to more than 1 IP, the server will try to connect to all IPs in round robin fashion.
- However, it will only add the first one it is able to connect to the mesh seed node list at startup.
- Thus, in situations when the DNS resolves to itself, we could have situations of node unable to join the cluster. It is not recommended to use DNS round-robin in the server configuration and rather specify the IP address or have DNS resolve only to 1 single IP.
dns round robin client server seed