First, start the LVS Cluster service
LVS load balance management and use there are two ways, one is to ipvsadm command line footsteps and Ldirectord monitoring mode, one is to Piranha tools for management and use. The following are described separately.
1, the use of ipvsadm command line footsteps and Ldirectord monitoring mode management LVS
After everything is configured, follow the steps below to start the LVS Cluster service.
First, start the services for each real server node:
[Root@localhost ~]#/etc/init.d/lvsrs start
Start LVS of Realserver
Then, start the Ldirectord service in Director server:
[Root@localhost ~]#/etc/init.d/ldirectord start
Starting Ldirectord [OK]
View the Ldirectord output log information at this time as follows:
LDIRECTORD|2561] Invoking Ldirectord invoked as:/usr/sbin/ldirectord start
LDIRECTORD|2561] Starting Linux Director v1.186 as Daemon
LDIRECTORD|2563] Added Virtual server:192.168.60.200:80
LDIRECTORD|2563] Added fallback server:127.0.0.1:80 (192.168.60.200:80) (Weight set to 1)
LDIRECTORD|2563] Added Real server:192.168.60.132:80 (192.168.60.200:80) (Weight set to 1)
LDIRECTORD|2563] Deleted fallback server:127.0.0.1:80 (192.168.60.200:80)
LDIRECTORD|2563] Added Real server:192.168.60.144:80 (192.168.60.200:80) (Weight set to 1)
As you can see from the log, Ldirectord first loaded the 80 port of a virtual IP, then loaded two real server nodes 80 ports and 80 ports on Director server native, and set the weights of real server two nodes to 1, Because all two nodes are available, the Director server Native 80 port is removed from the LVS routing table.
Next, start the LVSDR main service in Director server:
[Root@xa_web1 ~]#/ETC/INIT.D/LVSDR start
Start LVS of Directorserver
IP Virtual Server version 1.2.0 (size=4096)
Prot Localaddress:port Scheduler Flags
-> remoteaddress:port Forward Weight activeconn inactconn
TCP 192.168.60.200:http RR Persistent 600
-> 192.168.60.132:http Route 1 3 22
-> 192.168.60.144:http Route 1 9 22
So far, the LVS load Balancing cluster system has started to run.
2, the use of Piranha tools to manage LVS