High availability solution for Linux dual-systems by installing the Linux-HA software

Introduction

By installing the Linux-HA software, a high-availability solution for the Linux dual-system can be realized, which realizes hot backup of the dual-system and can seamlessly switch between the two machines, thereby externally

Provide stable and reliable services, and finally achieve high performance RAS (reliability, availability, and serviceability).

lab environment

High availability solution for Linux dual-systems by installing the Linux-HA software

Here, heartbeat is used to do the HA cluster, and the nginx service is used as the service corresponding to the HA.

Chumjtest01

Eth0 172.31.24.199

Eth0:1 192.168.1.109

VIP: 172.31.24.202

Chumjtest02

Eth0 172.31.24.200

Eth0:1 192.168.1.110

VIP: 172.31.24.202

Experimental preparation

Edit and modify the hosts file, add the IP of the two servers,

Turn off firewall iptables -F; turn off selinux: setenforce 0

Install eprl, install heartbeat, libnet

Main configuration

High availability solution for Linux dual-systems by installing the Linux-HA software

High availability solution for Linux dual-systems by installing the Linux-HA software

Configuring node files

High availability solution for Linux dual-systems by installing the Linux-HA software

Configure the ha profile

High availability solution for Linux dual-systems by installing the Linux-HA software

Slave configuration

Copy the configuration file on the host to the slave

High availability solution for Linux dual-systems by installing the Linux-HA software

Start heartbeat

Start the master first, start at

Host startup situation:

High availability solution for Linux dual-systems by installing the Linux-HA software

Check if the nginx service is started.

[root@chumjtest01 ha.d]# ps aux |grep nginx

Root 6989 0.0 0.0 109336 2036 ? Ss 17:40 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

Nginx 6990 0.0 0.0 109760 2704 ? S 17:40 0:00 nginx: worker process

Nginx 6991 0.0 0.0 109760 2756 ? S 17:40 0:00 nginx: worker process

Root 6995 0.0 0.0 103252 824 pts/1 S+ 17:41 0:00 grep nginx

Slave start situation:

test

Write a simple html file under the host's nginx and access it

High availability solution for Linux dual-systems by installing the Linux-HA software

Also write a simple html file on the slave

High availability solution for Linux dual-systems by installing the Linux-HA software

Under the test VIP access, the description is now running on the host in nginx

Open the firewall and ban the host from pinging

Check the HA log of the host chumjtest01 and see "We are dead", indicating that the host thinks that it is dead, and needs to cut to the slave.

High availability solution for Linux dual-systems by installing the Linux-HA software

View the HA log of the slave chumjtest02 and start ngix from the slave.

High availability solution for Linux dual-systems by installing the Linux-HA software

After accessing the VIP address, it has been switched to the slave.


Area Array Sensor

Area Array Sensor,Passive Infrared Detector,Infrared Heat Detector,Infrared Area Sensor

Ningbo NaXin Perception Intelligent Technology CO., Ltd. , https://www.nicswir.com

Posted on