RedHatAS4.2 install cluster LVS Environment Description: This article uses three linux systems when configuring LVS, one for Directorserver (192.168.0.25) and two for realserver (192.168.0.20.192.168.0.12, in the configuration of lvs + heartbeat added a (192.168.0.126) as the backup master node, virtual VIP: 192.168.0.100 Software List: ipvsadm-1.2 RedHatAS4.2 install cluster LVS
Environment Description:
This article uses three linux systems when configuring LVS, one for Directorserver (192.168.0.25), two for realserver (192.168.0.127 192.168.0.12), and one for configuring lvs + heartbeat (192.168.0.126) as the backup master node, virtual VIP: 192.168.0.100
Software List:
Ipvsadm-1.24.tar.gz
Libnet.tar: The http://www.packetfactory.net/libnet/ stable version is: 1.1.2.1
E2fsprogs can be used to install the CD with rpm
Heartbeat-2.0.2.tar.gz
2.6 The kernel has been integrated with the IPVS kernel, so you do not need to re-compile the kernel.
This cluster is configured in the following situations:
(1) configure the DR-mode Lvs Cluster
(2) configure the Lvs Cluster Based on tunnel mode
(3) Configure high-availability Lvs + heartbeat
(4) This configuration method can enhance the high security of the master node of LVS (DR for the master node, backup the DRbak for the master node). To make full use of resources, you can use DRbak as the realserver.
1. Configure the DR-mode Lvs Cluster
1. Download The ipvsadm Management Program
Http://www.linuxvirtualserver.org/software/
Note that the corresponding kernel version
Ipvsadm-1.24.tar.gz
Tar zxvf ipvsadm-1.24.tar.gz
Cd ipvsadm-1.24
Make
Make install
Note that many errors may occur during make. follow the steps below to compile properly.
Ln-s/usr/src/kernels/2.6.9-22. EL-i686 // usr/src/linux
Cd ipvsadm-1.24
Make
Make install
2. Configure the VIP script
[Root @ ns ~] # More/etc/init. d/lvsDR
#! /Bin/sh
# Create in 20060812 by ghb
# Description: start LVS of Directorserver
VIP = 192.168.0.100
RIP1 = 192.168.0.127
RIP2 = 192.168.0.128
# RIPn = 192.168.0.128 ~ 254
GW = 192.168.0.1
./Etc/rc. d/init. d/functions
Case $1 in
Start)
Echo "start LVS of DirectorServer"
# Set the Virtual IP Address
/Sbin/ifconfig eth0: 0 $ VIP broadcast $ VIP netmask 255.255.255.255 up
/Sbin/route add-host $ VIP dev eth0: 0
# Clear IPVS table
/Sbin/ipvsadm-C
# Set LVS
/Sbin/ipvsadm-A-t $ VIP: 80-s rr # (if session persistence is required,-p is maintained for 300 seconds by default)
/Sbin/ipvsadm-a-t $ VIP: 80-r $ RIP1: 80-g
/Sbin/ipvsadm-a-t $ VIP: 80-r $ RIP2: 80-g
#/Sbin/ipvsadm-a-t $ VIP: 80-r $ RIP3: 80-g
# Run LVS
/Sbin/ipvsadm
# End
;;
Stop)
Echo "close LVS Directorserver"
/Sbin/ipvsadm-C
;;
*)
Echo "Usage: $0" {start | stop}
Exit 1
Esac
(-S rr uses the wheel call algorithm. You can select the corresponding algorithm and change the rr. ipvsadm-h to view help. -G is the direct routing mode using lvs working DR, which can also be modified by yourself)
If there are multiple realservers, you can directly add them, and then start this script.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service