案例应用拓扑图:案例应用实现详细步骤如下:1.Client-pc客户端配置2.Director服务器配置2.1Director服务器ip地址配置[root@junjie~]#vim/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0BOOTPROTO=noneONBOOT=yesNETMASK=255.255.255.0IPADDR=10.106.6.254GATEWAY=10.106.6.1[root@junjie~]#vim/etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1BOOTPROTO=noneONBOOT=yesNETMASK=255.255.255.0IPADDR=192.168.1.1[root@junjie~]#servicenetworkrestartShuttingdowninterfaceeth0:[OK]Shuttingdowninterfaceeth1:[OK]Shuttingdownloopbackinterface:[OK]Bringinguploopbackinterface:[OK]Bringingupinterfaceeth0:[OK]Bringingupinterfaceeth1:[OK][root@junjie~]#ifconfigeth0eth0Linkencap:EthernetHWaddr00:0C:29:66:E1:DAinetaddr:10.106.6.254Bcast:10.106.6.255Mask:255.255.255.0[root@junjie~]#ifconfigeth1eth1Linkencap:EthernetHWaddr00:0C:29:66:E1:E4inetaddr:192.168.1.1Bcast:192.168.1.255Mask:255.255.255.0[root@junjie~]#hostnamedirector.junjie.com#注销重新登录2.2开启director数据包转发能力[root@director~]#vim/etc/sysctl.conf7net.ipv4.ip_forward=1[root@director~]#sysctl-pnet.ipv4.ip_forward=12.3配置本地yum服务器:[root@director~]#vim/etc/yum.repos.d/server.repo[rhel-server]name=RedHatEnterpriseLinuxserverbaseurl=file:///mnt/cdrom/Server/enabled=1gpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release[rhel-cluster]name=RedHatEnterpriseLinuxclusterbaseurl=file:///mnt/cdrom/Cluster/enabled=1gpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release[root@director~]#mkdir/mnt/cdrom[root@director~]#mount/dev/cdrom/mnt/cdrom/mount:blockdevice/dev/cdromiswrite-protected,mountingread-only[root@director~]#yumlistall2.4安装配置dircetor服务器:[root@director~]#yuminstall-yipvsadm[root@director~]#ipvsadm-lnIPVirtualServerversion1.2.1(size=4096)ProtLocalAddress:PortSchedulerFlags-RemoteAddress:PortForwardWeightActiveConnInActConn[root@director~]#ipvsadm-A-t10.106.6.254:80-swrr[root@director~]#ipvsadm-a-t10.106.6.254:80-r192.168.1.2-m-w1[root@director~]#ipvsadm-a-t10.106.6.254:80-r192.168.1.3-m-w2[root@director~]#ipvsadm-lnIPVirtualServerversion1.2.1(size=4096)ProtLocalAddress:PortSchedulerFlags-RemoteAddress:PortForwardWeightActiveConnInActConnTCP10.106.6.254:80wrr-192.168.1.3:80Masq200-192.168.1.2:80Masq100[root@director~]#serviceipvsadmsaveSavingIPVStableto/etc/sysconfig/ipvsadm:[OK][root@director~]#serviceipvsadmstartClearingthecurrentIPVStable:[OK]ApplyingIPVSconfiguration:[OK]3.配置real-server-1的web服务器:3.1ip地址配置[root@junjie~]#hostnamer1.junjie.com注销重新登录[root@r1~]#vim/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0BOOTPROTO=noneONBOOT=yesHWADDR=00:0c:29:1b:f1:baNETMASK=255.255.255.0IPADDR=192.168.1.2GATEWAY=192.168.1.1[root@r1~]#servicenetworkrestartShuttingdowninterfaceeth0:[OK]Shuttingdownloopbackinterface:[OK]Bringinguploopbackinterface:[OK]Bringingupinterfaceeth0:[OK]3.2配置本地yum服务器:[root@r1~]#vim/etc/yum.repos.d/server.repo[rhel-server]name=RedHatEnterpriseLinuxserverbaseurl=file:///mnt/cdrom/Server/enabled=1gpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release[root@r1~]#mkdir/mnt/cdrom[root@r1~]#mount/dev/cdrom/mnt/cdrom/mount:blockdevice/dev/cdromiswrite-protected,mountingread-only[root@r1~]#yumlistall3.3Real-server-1的Web服务器:[root@r1~]#rpm-ivh/mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpmwarning:/mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...####################################[100%]1:httpd###########################################[100%][root@r1~]#echoweb1/var/[root@r1~]#servicehttpdstartStartinghttpd:httpd:apr_sockaddr_info_get()failedforr1.junjie.comhttpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,using127.0.0.1forServerName[OK]3.4客户端访问real-server-1的web服务:(使用vmnet1)4.配置real-server2的web服务器:4.1ip地址配置[root@junjie~]#hostnamer2.junjie.com注销重新登录[root@r2~]#vim/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0BOOTPROTO=noneONBOOT=yesHWADDR=00:0c:29:1b:f1:baNETMASK=255.255.255.0IPADDR=192.168.1.3GATEWAY=192.168.1.1[root@r2~]#servicenetworkrestartShuttingdowninterfaceeth0:[OK]Shuttingdownloopbackinterface:[OK]Bringinguploopbackinterface:[OK]Bringingupinterfaceeth0:[OK]4.2配置本地yum服务器:[root@r2~]#vim/etc/yum.repos.d/server.repo[rhel-server]name=RedHatEnterpriseLinuxserverbaseurl=file:///mnt/cdrom/Server/enabled=1gpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release[root@r2~]#mkdir/mnt/cdrom[root@r2~]#mount/dev/cdrom/mnt/cdrom/mount:blockdevice/dev/cdromiswrite-protected,mountingread-only[root@r2~]#yumlistall4.3Real-server-2的Web服务器:[root@r2~]#rpm-ivh/mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpmwarning:/mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...####################################[100%]1:httpd###########################################[100%][root@r2~]#echoweb2/var/[root@r2~]#servicehttpdstartStartinghttpd:httpd:apr_sockaddr_info_get()failedforr2.junjie.vomhttpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,using127.0.0.1forServerName[OK]4.4客户端访问real-server-2的web服务:(使用vmnet1)5.客户端测试:wrr5.1客户端访问director的群集服务服务:(网卡使用桥接模式)http://10.106.6.