How To Setup "XLR 6.0.0 Active/Hot-standby" High Availability Cluster

Follow

Shashank Srivastava -

This post explains how we can setup "XLR 6.0.0 Active/Hot-standby" High Availability Cluster so that we have a highly available XL Release instance, as described in the below documentation link.

https://docs.xebialabs.com/xl-release/how-to/configure-active-hot-standby.html

For this tutorial, we will need 4 nodes as outlined below.

  • 1 HAProxy Load-balancer that also acts as/runs an NFS server - IP address 192.168.0.60
  • 2 XLR nodes also acting as NFS clients - IP address 192.168.0.50 & 192.168.0.61
  • 1 MySQL Database server - IP address 192.168.0.51

Please note that my Node1's name is "shashank-server" & Node2s name is "node1".

HAProxy Configuration : -

I have attached the configuration file for HAProxy. Please make suitable changes in this file for your setup. I am explaining the last 2 lines below.

server shashank-server 192.168.0.50:5516 check inter 2000 rise 2 fall 3
server node1 192.168.0.61:5516 check inter 2000 rise 2 fall 3

As we can see, the second field on both the lines depicts hostnames of XLR nodes & is followed by their IP addresses.

Rest of the configuration is self-explanatory.

XL Release Configuration : -

I have attached the xl-release.conf file for node 1 which is almost the same on the other XLR node. Only difference is in the node ID & hostname. We will need to make changes accordingly in both the files.

The most important part of this configuration is the artifacts location as mentioned below. Remember that the XLR artifacts need to be on a shared filesystem such as NFS.

location="/home/shashank/nfs-share"

This location refers to an NFS mount-point. You will need to create this location on your both XLR nodes & then mount this filesystem pointing to your NFS server like below.

mount -t nfs 192.168.0.60:/home/shashank/nfs-artifacts /home/shashank/nfs-share/

As you know, 192.168.0.60 is IP address of NFS server.

 

NFS Server Configuration : -

Below is the output of /etc/exports file from our NFS server. As you can see, this directory has been exported to both of our XLR nodes.

/home/shashank/nfs-artifacts 192.168.0.50(rw,sync,no_root_squash,no_subtree_check)
/home/shashank/nfs-artifacts 192.168.0.61(rw,sync,no_root_squash,no_subtree_check)
With everything correctly configured, you can see HAProxy GUI by pointing your browser to "localhost:1936". Credentials are stats/stats. You can change these settings in /etc/haproxy.cfg file. This file is also attached. Below is the screenshot of HAProxy GUI. You can see that Node1 is up (Even when both the nodes are up & running, HAProxy will only see the active one as up. Other node will be seen as up when Node2 is down).
 
HAProxy.png

 

Below is the XLR log that shows the cluster in action : -

2016-12-05 06:43:48.693 [xlr_cluster-akka.actor.default-dispatcher-17] {sourceThread=xlr_cluster-akka.actor.default-dispatcher-17, akkaSource=akka.cluster.Cluster(akka://xlr_cluster), sourceActorSystem=xlr_cluster, akkaTimestamp=05:43:48.692UTC} INFO  a.c.Cluster(akka://xlr_cluster) - Cluster Node [akka.tcp://xlr_cluster@192.168.0.50:5531] - Node [akka.tcp://xlr_cluster@192.168.0.61:5531] is JOINING, roles

2016-12-05 06:43:49.458 [xlr_cluster-akka.actor.default-dispatcher-6] {sourceThread=xlr_cluster-akka.actor.default-dispatcher-5, akkaSource=akka.cluster.Cluster(akka://xlr_cluster), sourceActorSystem=xlr_cluster, akkaTimestamp=05:43:49.458UTC} INFO  a.c.Cluster(akka://xlr_cluster) - Cluster Node [akka.tcp://xlr_cluster@192.168.0.50:5531] - Leader is moving node [akka.tcp://xlr_cluster@192.168.0.61:5531] to [Up]
2016-12-05 06:43:49.464 [xlr_cluster-akka.actor.default-dispatcher-4] {sourceThread=xlr_cluster-akka.actor.default-dispatcher-16, akkaTimestamp=05:43:49.464UTC, akkaSource=akka.tcp://xlr_cluster@192.168.0.50:5531/user/$a, sourceActorSystem=xlr_cluster} INFO  c.x.x.a.c.h.HotStandbyDetector - Active -- Cluster member Member(address = akka.tcp://xlr_cluster@192.168.0.61:5531, status = Up) joined
 

I created a new Release on Node 1 & it was visible on Node2 as well.

Release_on_Node1.png

I now shutdown XLR on Node1 & HAProxy showed this node as down & Node2 as up.
 
HAProxy-Node1_Down.png
 
I then created a new Release on Node2 & that Release was visible on Node1 after I brought it up. I then completed this Release on Node1.
 
Release_on_Node2.png
Node1_Up_again.png
 
Release_completed_on_Node1.png
 
Have more questions? Submit a request
Powered by Zendesk