How Does One Setup Clustering

Hi Nicholas,

Glad to hear that your trying to setup multiple nodes. But to answer your question, It depends if your using Multicast or Mesh?

  1. Multicast in this case, multicast IP: PORT is used to broadcast the heartbeat message
  2. Mesh in this case, the address of one Aerospike server is used to join cluster.

Multicast Example

All nodes have to have the same multicast IP address and port to form the cluster.

Node 1:

heartbeat {
   mode multicast
   address 239.1.99.222
   port 9918
   interval 150
   timeout 10
...

Node 2:

 heartbeat {
    mode multicast
    address 239.1.99.222
    port 9918
    interval 150
    timeout 10
    ...

Node 3:

   heartbeat {
      mode multicast
      address 239.1.99.222
      port 9918
      interval 150
      timeout 10
    ...

Mesh Example

Set address to the IP of the local interface intended for intracluster communication. This setting also controls the interface fabric will use.

Set mesh-seed-address-port to be the IP address and heartbeat port of a node in the cluster

Node 1:

heartbeat {
   mode mesh
   port 3002
   address 192.168.1.10
   mesh-seed-address-port 192.168.1.10 3002 # OK to have local node
   mesh-seed-address-port 192.168.1.11 3002
   mesh-seed-address-port 192.168.1.12 3002
   interval 150
   timeout 10
...

Node 2:

heartbeat {
   mode mesh
   port 3002
   address 192.168.1.11
   mesh-seed-address-port 192.168.1.10 3002
   mesh-seed-address-port 192.168.1.11 3002
   mesh-seed-address-port 192.168.1.12 3002
   interval 150
   timeout 10
...

Node 3:

heartbeat {
   mode mesh
   port 3002
   address 192.168.1.12
   mesh-seed-address-port 192.168.1.10 3002
   mesh-seed-address-port 192.168.1.11 3002
   mesh-seed-address-port 192.168.1.12 3002
   interval 150
   timeout 10

With the default settings, a node will be aware of another node leaving the cluster within 1.5 seconds (interval 150 * timeout 10 = 1500 ms convert 1.5 seconds).

Clustering: https://www.aerospike.com/docs/architecture/clustering.html#heartbeat

Network Heartbeat Configuration: https://www.aerospike.com/docs/operations/configure/network/heartbeat/#network-heartbeat-configuration

Let me know if that helps!

1 Like