Failover cluster with replication to two nodes

Installation is carried out from the image ibatyr-ubuntu-2X.04-v2.XX.0-replication.iso (OC+WAF) on a virtual or physical server. Servers on which you plan to install iBatyr WAF must meet the minimum system requirements from section 2.1.

First you need to install the OS (an example of OS installation is given in Appendix B). After installation and authentication to the OS, the WAF installation will automatically start.

Before installing a Management cluster of two nodes, you should allocate three IP addresses from the same subnet - one for each node and one for Virtual IP, which will always be associated with this master node.

Next you need to do the following:

  1. In the window that appears, select installation with replication (see screenshot 56).

Illustration 1 — Failover cluster with replication to two nodes

Screenshot 56 - Selecting Installation Type

  1. In the next window that appears, select the main node (see screenshot 57).

Illustration 2 — Failover cluster with replication to two nodes

Screenshot 57 - Selecting Primary Node

  1. In the next window, enter the password for interaction between the main (master) node and the backup (slave) (see screenshot 58).

Illustration 3 — Failover cluster with replication to two nodes

Screenshot 58 - Password for communication between primary and backup nodes

  1. Next, you need to confirm the password (see screenshot 59).

image59

Screenshot 59 – Password Confirmation

  1. Then enter the IP address of the primary node (see screenshot 60).

Illustration 5 — Failover cluster with replication to two nodes

Screenshot 60 - Primary Node IP Address

  1. Then enter the address of the backup node (see screenshot 61).

Illustration 6 — Failover cluster with replication to two nodes

Screenshot 61 - Backup Node IP Address

  1. Next, enter the VIP address (see screenshot 62).

Illustration 7 — Failover cluster with replication to two nodes

Screenshot 62 - VIP Address

  1. In the window that appears, select simple installation on one node (see screenshot 63).

Illustration 8 — Failover cluster with replication to two nodes

Screenshot 63 - Selecting Installation Type

  1. Next, in the installation mode selection window, select Reverse proxy (see screenshot 64).

Illustration 9 — Failover cluster with replication to two nodes

Screenshot 64 - Selecting Installation Mode

  1. Then, in the appropriate windows, specify the IP address and port of the protected application (see screenshot 65, screenshot 66). The values entered at this stage can be changed after installation.

Illustration 10 — Failover cluster with replication to two nodes

Screenshot 65 - Protected Application IP Addresses

Illustration 11 — Failover cluster with replication to two nodes

Screenshot 66 – Protected Application Port

  1. Display overview information about the installation results for verification using the command:

sudo grep -A 1 RECAP /var/tmp/install.log

The indicator of successful installation will be the absence of installation errors “failed=0” (see screenshot 67).

image60

Screenshot 67 – Installation without errors

  1. To check if ports correspond to services, use the command (see Screenshot 68):

ss -ntl

image61

Screenshot 68 – Service Port Mapping

Ports for services must correspond to:

  • nginx: port 8443;

  • ibatyr-dashboard: port 5088;

  • mongod: port 27017;

  • ibatyr-analyzer@0: port 6666;

  • ibatyr-redis@mgmt: port 6378;

  • ibatyr-redis@0: port 6379;

  • ibatyr-nginx: the port you specified when installing WAF;

  • sshd: port 22;

  • postgresql: port 5432.

  1. Next, you need to check the status of the cluster using the sudo crm status command (see screenshot 69).

image62

Screenshot 69 - Cluster Health Check Results

  1. Then initialize the replication slot by restarting the pgsql resource with the command (see screenshot 70):

sudo crm resource restart pgsql

image63

Screenshot 70 - Initializing the replication slot

When this command is executed, the resource will first go into Slaves status (see screenshot 71). You need to wait for it to return to Masters state (see screenshot 72). The cluster status is checked with the following command:

sudo crm status

image64

Screenshot 71 – Slaves Status

image65

Screenshot 72 – Master Status

If the allocated addresses have a mask other than 255.255.255.0 (24), then you need to change the mask in the configuration file for the waf-virtual-ip VIP resource. To do this you should:

  1. Run the command sudo crm configure edit.

  2. In the vim editor that opens, find the resource in the file and change cidr_netmask=24 to the desired mask (see screenshot 73).

image66

Screenshot 73 – Changing the netmask

For security reasons, SSH access was denied to the waf user during installation. If you need to allow such access, then in the configuration file /etc/sshd/sshd_config you should delete the last line DenyUsers waf and restart the service using the command (see screenshot 74):

sudo systemctl restart sshd

image67

Screenshot 74 – SSH Permission