Linux moves the memory pages that have not been accessed for some time to the swap space, even if there is enough free memory available. This is called swap out. On the other hand, reading swapped out data from the swap space to memory is called swap in. Swapping is necessary in many situations, but as Java Virtual Machine (JVM) does not behave well under swapping, HBase may run into trouble if swapped. The ZooKeeper session expiring is a typical problem that may be introduced by a swap.
In this recipe, we will describe how to tune the Linux vm.swappiness
parameter to avoid swap.
Make sure you have root privileges on your nodes in the cluster.
How to do it... To tune the Linux parameter to avoid swapping, invoke the following on each node in the cluster:
1. Execute the following command to set
vm.swappiness
to0:
root# sysctl -w vm.swappiness=0 vm.swappiness = 0
This change will persist until the next reboot of the server.
2. Add the...