How do I change my heartbeat protocol from v2 to v3?


#1

Title

Changing Heartbeat Protocol from v2 to v3

Details

In server version 3.10, we introduced the option to use heartbeat protocol v3. This knowledge-base covers the steps needed to make the transition on a running cluster along with the changes in Heartbeat v3.

Changes in v3 vs v2

The major improvements in v3 are as follows:

  1. Ability to scale the cluster size dynamically dynamically for both mesh and multicast setup (obsoleted paxos-max-cluster-size).

  2. Improved cluster management - ability to use cluster-name to be able to specify names to the clusters to avoid accidental addition of nodes to a production cluster.

Steps

To move from v2 to v3, the following steps need to be followed in order to not disrupt any inter-node heartbeat traffic:

  1. Verify the current Heartbeat protocol and interval settings:
asadm> show config like heartbeat.protocol
~~~~~~~~~~~~~~~~~~~~Network Configuration~~~~~~~~~~~~~~~~~~
NODE              :   ip1:3000   ip2:3000   ip3:3000   
heartbeat.protocol:   v2         v2         v2

asadm> show config like heartbeat.interval
~~~~~~~~~~~~~~~~~~~~Network Configuration~~~~~~~~~~~~~~~~~~~
NODE              :   ip1:3000   ip2:3000   ip3:3000   
heartbeat.interval:   150        150        150                                               
  1. Set the Heartbeat interval (the interval at which the heartbeat packets are sent out) to a high value (5 minutes in the example below) to avoid any heartbeat packets sent out during the transition when nodes can be running on different heartbeat versions:
asinfo -v 'set-config:context=network;heartbeat.interval=300000'
ip1:3000 (172.31.31.aa) returned:
ok

ip2:3000 (172.31.31.bb) returned:
ok

ip3:3000 (172.31.31.cc) returned:
ok
  1. Set the heartbeat protocol version to v3:
asadm> asinfo -v 'set-config:context=network;heartbeat.protocol=v3'
ip1:3000 (172.31.31.aa) returned:
ok

ip2:3000 (172.31.31.bb) returned:
ok

ip3:3000 (172.31.31.cc) returned:
ok

Verify all nodes have the correct heartbeat protocol version set:

asadm> show config like heartbeat.protocol
~~~~~~~~~~~~~~~~~~~~Network Configuration~~~~~~~~~~~~~~~~~~
NODE              :   ip1:3000   ip2:3000   ip3:3000   
heartbeat.protocol:   v3         v3         v3
  1. Set the heartbeat interval back to the original value that you had for the cluster.
asadm> asinfo -v 'set-config:context=network;heartbeat.interval=150'
ip1:3000 (172.31.31.aa) returned:
ok

ip2:3000 (172.31.31.bb) returned:
ok

ip3:3000 (172.31.31.cc) returned:
ok

Verify all nodes have the correct heartbeat interval set:

asadm> show config like heartbeat.interval
~~~~~~~~~~~~~~~~~~~~Network Configuration~~~~~~~~~~~~~~~~~~~
NODE              :   ip1:3000   ip2:3000   ip3:3000   
heartbeat.interval:   150        150        150                                               
  1. Edit the configuration file to retain the protocol change on subsequent restarts:
        heartbeat {
                -----------
                protocol v3
                -----------
        }

References

Configuration reference:

Keywords

Heartbeat protocol v2 v3 cluster size cluster name

Timestamp

12/09/2016


Enabling and Validating TLS
FAQ - Increasing maximum cluster size in an Aerospike cluster
FAQ - What are the unanimous configuration parameters