构建LVS负载均衡群集
- 实验环境
实验环境
201:客户端
101:调度器 (需要用到2个网卡)
102:web
103:web
104:NFS存储
101:(添加一个网卡)
2 [root@localhost ~]# cd /etc/sysconfig/network-scripts/
3
4 //查看另一个网卡的名字ens36
5 [root@localhost network-scripts]# ifconfig
6 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
7 inet 192.168.10.101 netmask 255.255.255.0 broadcast 192.168.10.255
8 inet6 fe80::f6d:8bdc:c21a:5b47 prefixlen 64 scopeid 0x20<link>
9 ether 00:0c:29:8b:11:fe txqueuelen 1000 (Ethernet)
10 RX packets 240 bytes 25054 (24.4 KiB)
11 RX errors 0 dropped 0 overruns 0 frame 0
12 TX packets 200 bytes 28380 (27.7 KiB)
13 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
14
15 ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
16 inet6 fe80::d9a8:ee94:b8fb:e3e8 prefixlen 64 scopeid 0x20<link>
17 ether 00:0c:29:8b:11:08 txqueuelen 1000 (Ethernet)
18 RX packets 0 bytes 0 (0.0 B)
19 RX errors 0 dropped 0 overruns 0 frame 0
20 TX packets 23 bytes 3210 (3.1 KiB)
21 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
22
23 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
24 inet 127.0.0.1 netmask 255.0.0.0
25 inet6 ::1 prefixlen 128 scopeid 0x10<host>
26 loop txqueuelen 1000 (Local Loopback)
27 RX packets 0 bytes 0 (0.0 B)
28 RX errors 0 dropped 0 overruns 0 frame 0
29 TX packets 0 bytes 0 (0.0 B)
30 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
31
32 //拷贝一下配置文件给ens36,并进行修改
33 [root@localhost network-scripts]# cp ifcfg-ens33 ifcfg-ens36
34 [root@localhost network-scripts]# vim ifcfg-ens36
35 TYPE=Ethernet
36 PROXY_METHOD=none
37 BROWSER_ONLY=no
38 BOOTPROTO=static
39 IPADDR=172.16.16.172 //修改ip
NETMASK=255.255.255.0
41 #GATEWAY=192.168.10.254 //注释掉网关
42 DNS1=114.114.114.114
43 DNS2=8.8.8.8
44 DEFROUTE=yes
45 IPV4_FAILURE_FATAL=no
46 IPV6INIT=yes
47 IPV6_AUTOCONF=yes
48 IPV6_DEFROUTE=yes
49 IPV6_FAILURE_FATAL=no
50 IPV6_ADDR_GEN_MODE=stable-privacy
51 NAME=ens36