在linux下实现负载均衡我们已经对它的配置说过很多了,现在我们介绍的是关于在这个系统下的双网卡负载均衡的设定过程,总的可以分为四个步骤,首先我们要对虚拟网络接口文件进行改动,然后是对网卡的信息文件的改动,之后是两个文件的编辑。
双网卡负载均衡1:
建立虚拟网络接口ifcfg-bond0文件
[root@yangwenjun ~]# cd /etc/sysconfig/network-scripts/
[root@yangwenjun network-scripts]# cp ifcfg-eth0 ifcfg-bond0
其内容为:
[root@yangwenjun network-scripts]# more ifcfg-bond0
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=bond0
BROADCAST=192.168.1.255
IPADDR=192.168.1.3
NETMASK=255.255.255.0
NETWORK=192.168.1.0
MTU=1500
GATEWAY=192.168.1.1
[root@yangwenjun network-scripts]#
双网卡负载均衡2:
编辑原有网卡eth0和eth信息文件,使其内容为:
[root@yangwenjun network-scripts]# more ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
slave=ye