Configuring Edge in Failover HA mode

From Datonis
Jump to: navigation, search

Configuring Edge failover to support high availability use case

Datonis Edge now natively provides failover mechanism. It uses master/slave topology where one instance is active and others are in standby. More than one slaves can be configured for failover.

Edge provides failover capability using a lock file from the shared data directory. The shared data directory holds the persistent state. As failover relies on the file system lock, the file system storing the data directory has to be accessible across  instances(using SAN, NFS, …​). Refer: https://en.wikipedia.org/wiki/Clustered_file_system.

When a first instance starts, if the lock is available, it takes the lock and becomes the master. Whenever a second instance starts, it tries to acquire the lock. As the lock is already held by the master, the instance becomes a slave, in standby mode (not active).

Configuring failover in traditional installation

In the install/upgrade scripts (e.g. install_edge_service.sh/upgrade_edge_service.sh), add a new option --datadirpath that will point to the shared data directory across instances e.g. --datadirpath "/shared-vol/datonis-edge-data".  After this step, install or upgrade edge service on all instances and edge services will start in failover mode, the first service to start will become master node.

Configuring failover in docker installation

In the Docker command line, edit option --mount to point the source volume to the shared data directory e.g.  --mount type=bind,source=/shared-vol/datonis-edge-data,target=/opt/datonis-edge-data. The Docker containers started with shared mounts will configure edge program to run in failover mode. The first started docker container will become master node.