Configuring the Zabbix server for high availability

A high-availability cluster for a Zabbix server is easier to configure compared to Apache or a database server. Whether it's a standalone server or a node that is a part of a distributed setup, the procedure is exactly the same, as shown in the following diagram:

Configuring the Zabbix server for high availability

Once you have installed Corosync and Pacemaker on the two nodes (see the previous sections for details), you will also install Zabbix on the nodes that will make the cluster. You will then need to configure Zabbix to listen to the virtual IP address that you have identified for the cluster. To do so, change both SourceIP and ListenIP to the appropriate value in the zabbix_server.conf configuration file:

SourceIP=10.10.1.9
ListenIP=10.10.1.9

Tip

Needless to say, change the IP value to the one that you have reserved as a virtual IP for the Zabbix cluster and that is appropriate for your environment.

You can now proceed to disable STONITH using the following command:

$ crm configure property stonith-enabled="false"

If you have just two nodes, you also need to disable Quorum; otherwise, the cluster won't know how to obtain a majority:

$ crm configure property no-quorum-policy=ignore

And finally, set the service stickiness high enough so that you don't have a service going back and forth between the nodes and it stays where it is unless you manually move it or the active node goes down:

$ crm configure property default-resource-stickiness="100"

Much like the Apache/HTTPD cluster configuration, you now need to define a primitive for the virtual IP:

$ crm configure primitive Zbxvip ocf:heartbeat:IPaddr2 
params ip="10.10.1.9" iflabel="httpvip" 
op monitor interval="5"

For the Zabbix server, define the primitive using the following command:

$ crm configure primitive Zabbix lsb::zabbix_server 
op monitor interval="5"

Just as in the previous section, all that is now left to do is group the primitives together, set up colocation, and service StartOrder—and you are done:

$ crm configure group Zbx_server Zbxvip Zabbix meta target-role="Started"
$ crm configure colocation Ip_Zabbix inf: Zbxvip Zabbix
$ crm configure order StartOrder inf: Zbxvip Zabbix

As you can see, the simpler the components, the easier it is to set them up in a cluster configuration using Pacemaker. While it is still fairly easy and simple, things start to change when you turn to configure the most critical part of any high-availability setup: the database and data storage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.56.251