Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

45.Keepalived High availability Cluster

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Keepalived High availability Cluster

Keepalived uses VRRP hot backup protocol to realize the multi-computer hot backup function of linux server in a software way. When one party fails, it automatically switches the backup server to work.

Keepalived deployment environment: one master scheduling server, one slave scheduling server, and multiple node servers

Keepalived deployment steps:

V install support components

# yum-y install kernel-devel openssl-devel popt-devel ipvsadm

V source code installation keepalived tool

# tar xzvf keepalived-1.2.13.tar.gz

# cd keepalived-1.2.13

#. / configure-prefix=/-with-kernel-dir=/usr/src/kernels/2.6.32-431.e16.x86_64

# make & & make install

V configure the main scheduler

# vim / etc/keepalived/keepalived.conf

Modify the relevant content:

Global_defs {

Name of the router_id R1 master scheduler

}

Vrrp_instance VI_1 {

Hot standby status of state MASTER master scheduler

The lower interface of interface eth0 master scheduler

Virtual_router_id 1 group number

Priority 100priority

Advert_int 1

Authentication {Master-Slave Hot standby Authentication Information

Auth_type PASS

Auth_pass 1111

}

Virtual_ipaddress {Cluster virtual IP address

1.1.1.100

}

Virtual_server 1.1.1.100 80 {Virtual Service address Port

Interval between delay_loop 6 health check-ups

Scheduling algorithm for lb_algo rr polling

Cluster operation mode of lb_kind DR direct routing

! Persistence_timeout 50 hold time

Protocol TCP protocol

Real_server 1.1.1.1 80 {Real Server address Port

Weight 1 weight

TCP_CHECK {Health check method

Connect_port 80 checks the target port

Connect_timeout 3 connection timeout

Number of nb_get_retry 3 retries

Delay_before_retry 3 retry interval

}

}

}

V restart the keepalived service

# Service keepalived restart

V verify that the configuration file is in effect

# ip addr to see if a virtual cluster IP has been created automatically

V configure slave scheduler

# vim / etc/keepalived/keepalived.conf

Modify the content:

Global_defs {

Router_id R2 slave scheduler name

}

Vrrp_instance VI_1 {

State BACKUP slave hot standby status of the scheduler

Interface eth0 from the lower interface of the scheduler

Virtual_router_id 1 group number

Priority 99 priority

. Other contents are the same.

V restart the keepalived service

# Service keepalived restart

V configure node server

# ifconfig lo:0 1.1.1.100/32

# route add-host 1.1.1.100 dev lo:0

# vim / etc/sysctl.conf

Add content:

Net.ipv4.conf.all.arp_ignore = 1

Net.ipv4.conf.all.arp_announce = 2

Net.ipv4.conf.lo.arp_ignore = 1

Net.ipv4.conf.lo.arp_announce = 2

Net.ipv4.conf.default.arp_ignore = 1

Net.ipv4.conf.default.arp_announce = 2

# sysctl-p

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report