Changing netmask on a running cluster


How to change the netmask of a cluster while the nodes stay running


To change the network subnet mask of the nodes in a cluster (but not the IP of the nodes) while the cluster and all nodes stay up and running. Production traffic must remain flowing.


The way to achieve this without restarting any nodes is to shut down the paxos protocol between nodes on a temporary basis. To do this we have a process with 4 discrete stages.

  1. Check current configuration
  2. Shut down paxos protocol
  3. Make change
  4. Reset paxos protocol so that nodes start communicating again

1. Check current configuration

To do this we use the asadm command and run ‘show-config’ once inside. The two parameters we need to make a note of are paxos-protocol and heartbeat-protocol. A truncated output would look something like as follows:

Admin> show config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Service Configuration~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NODE                               :                   

paxos-protocol                     :   v3                           v3                           

~~~~~~~~~~~~~~~~Network Configuration~~~~~~~~~~~~~~~~~~~

heartbeat-protocol : v2 v2   

We make a note of these two values. Notice this is shown for both nodes.

2. Shut down paxos protocol

We shut down the paxos protocol and the heartbeats from the principal node, again we use asadm. When we use ‘asadm -e’ we can issue an ‘asinfo’ command to all nodes in the cluster concurrently.

[vagrant@dc1xdr1 ~]$ asadm -e 'asinfo -v "set-config:context=network.heartbeat;protocol=none"' ( returned:
ok ( returned:
[vagrant@dc1xdr1 ~]$ asadm -e 'asinfo -v "set-config:context=service;paxos-protocol=none"' ( returned:
ok ( returned:

3. Make network submask changes

We use ifconfig to change the values, variables are shown here, these should be replaced with values for the new netmask and the applicable network interface. We have to add the route to the default gateway as changing the netmask will remove this.


route add default gw $GATEWAYIP 

4. Reset paxos protocol and heartbeat so the nodes start to communicate again.

Here we simply reverse the process from step 2 using the values we noted down in step 1.

[vagrant@dc1xdr1 ~]$ asadm -e 'asinfo -v "set-config:context=service;paxos-protocol=v3"' ( returned:
ok ( returned:
Config files location: /home/vagrant/.aerospike/
[vagrant@dc1xdr1 benchmarks]$ asadm -e 'asinfo -v "set-config:context=network.heartbeat;protocol=v2"' ( returned:
ok ( returned:

We then check cluster using asadm ‘get-config’ and ‘info’ commands.