How To Configure High Availability (HA) Zabbix Server On Ubuntu 18.04 - Zabbix Only PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ?

| Zabbix Only

Home Categories Zabbix Agent    

Zabbix Only.

How to configure High Availability (HA) Zabbix Server on


Ubuntu 18.04 ?
In How-To May 31, 2018 zabbixonly

The latest release for zabbix is 3.4, we’re going to see together how to con guring high
availability zabbix server on Ubuntu 18.04.

I will divide the tutorial into 3 parts so that I can detail the different procedures.

How to install and con gure HA Zabbix Server on Ubuntu 18.04 ? 1/3
How to install and con gure MySQL on Ubuntu 18.04 ? 2/3
How to install and con gure HA Web on Ubuntu 18.04 ? 3/3

Prerequisite

First time, we need two virtual machines with Ubuntu 18.04 and 3 IP for make high availability
for Zabbix Server 3.4

1st server :  zabbix-node01 – 10.0.0.1


2nd server : zabbix-node02 – 10.0.0.2
Virtual IP* for HA – 10.0.0.3

What’s Virtual IP :

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To nd out more, including how to control cookies, see here: Cookie Policy
Close and accept

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 1/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

A virtual IP address (VIP or VIPA) is an IP address that doesn’t correspond to an actual physical
Home Categories Zabbix Agent    
network interface. Uses for VIPs include network address translation (especially, one-to-many
NAT), fault-tolerance, and mobility. From Wikipedia

Step 1: Con gure DNS

To optimize dns queries and avoid false positives, we need to con gure our /etc/hosts on both
servers.

1 10.0.0.1  zabbix-node01  zabbix-node01.example.com
2 10.0.0.2  zabbix-node02  zabbix-node02.example.com

Step 2: Install Zabbix Server

Add repository Zabbix on both servers

1 wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bio
2 dpkg -i zabbix-release_3.4-1+bionic_all.deb
3 apt update

Install zabbix-server-mysql on both servers

1 apt install zabbix-server-mysql -y

We will separate the mysql server and frontend

Edit le /etc/zabbix/zabbix_server.conf on both servers

1 SourceIP=10.0.0.3 <--- cluster_ip


2 ListenIP=10.0.0.3 <--- cluster_ip
3 DBHost=10.0.0.4 <---- Server SQL
4 DBName=zabbixdb
5 DBUser=zabbix
6 DBPassword=password
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
Close and accept
To nd out more, including how to control cookies, see here: Cookie Policy

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 2/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

Home Categories Zabbix Agent    


Step 3: Con gure Pacemaker

Install pacemaker  and pcs on both servers

1 apt install pacemaker pcs -y


2 passwd hacluster
3 systemctl enable pcsd.service
4 systemctl start pcsd.service

Now only zabbix-node01, con gure authentication

1 pcs cluster auth zabbix-node01  zabbix-node02


2 Username: hacluster

Then create cluster zabbixserver

1 sudo pcs cluster setup --name zabbixserver zabbix-node01 zabbix-node02

Start cluster

1 sudo pcs cluster start --all

if you have a problem please unmask the service pacemaker

1 systemctl unmask pacemaker

On both servers, make sure that Pacemaker and Corosync are started at boot

1 systemctl enable corosync.service


2 systemctl enable pacemaker.service

Check cluster and nodes

1 sudo pcs status cluster


2 sudo pcs status nodes

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To nd out more, including how to control cookies,Disable
Close and accept
stonith
see here: Cookie and ignore low quorum
Policy

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 3/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

1 sudo pcs property set stonith-enabled=false


Home Categories
2 pcs property set Zabbix Agent
no-quorum-policy=ignore    

We need to create VIP for zabbixserver

1 pcs resource create cluster_vip ocf:heartbeat:IPaddr2 ip=10.0.0.3 cidr_netmask=255.255.255.0 op m

Test your VIP and status of pcs

1 ping 10.0.0.3
2 pcs status

Disable zabbix-server on both servers, because Pacemaker will actually control the process

1 sudo systemctl disable zabbix-server

Create a new ressource Zabbix, to verify that the zabbix service still works in cluster

1 sudo pcs resource create zabbix_server lsb:zabbix-server op monitor interval=10s

Check if ressource appear when you launch the command

1 sudo pcs status

Ensuring resources run on the same host

1 sudo pcs constraint colocation add zabbix_server cluster_vip


2 sudo pcs constraint order cluster_vip then zabbix_server

Test your cluster

1 sudo pcs cluster stop zabbix-node01

      

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To nd out more, including how to control cookies, see here: Cookie Policy
Close and accept

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 4/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

zabbixonly
Home Categories Zabbix Agent    

Previous Post:
 Improving data transfer speed in upcoming Zabbix 4.0

Next Post:
How to install and con gure MySQL for Zabbix on Ubuntu 18.04 ? 

Related Posts:

How to install Zabbix Agent 4.2 ? Ubuntu, RHEL, CentOS

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
Close and accept
To nd out more, including how to control cookies, see here: Cookie Policy

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 5/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

Home Categories Zabbix Agent    

Zabbix 4.2: Template and host-level tags

How to conf igure LDAP on Zabbix

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
Close and accept
To nd out more, including how to control cookies, see here: Cookie Policy
Leave a reply:
https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 6/7
29/1/2020 How to configure High Availability (HA) Zabbix Server on Ubuntu 18.04 ? | Zabbix Only

Your email address will not be published.


Home Categories Zabbix Agent    

Name

Email

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

Post Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free 2018-2019 by ZabbixOnly - Zabbix LLC, owns the Zabbix trademark

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To nd out more, including how to control cookies, see here: Cookie Policy
Close and accept

https://zabbixonly.com/how-to-configure-high-availability-ha-zabbix-server-on-ubuntu-18-04/ 7/7

You might also like