<kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

              <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                      <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                              <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                                      <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                                              <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                                                      <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                                                              <kbd id='V8ci57GrquPLhHJ'></kbd><address id='V8ci57GrquPLhHJ'><style id='V8ci57GrquPLhHJ'></style></address><button id='V8ci57GrquPLhHJ'></button>

                                                                  申博太阳城_DR直接路由实现负载平衡示例
                                                                  作者:申博太阳城文化传媒公司 2018-01-08 20:32 90

                                                                  要求:通过行使LVS的直接路由来实现处事器的负载平衡

                                                                  注:在做尝试之前必然要先封锁每台主机的防火墙与SELinux

                                                                  拓扑图

                                                                  DR直接路由实现负载均衡示例

                                                                  LVS处事器设置:

                                                                  1> 开启转发成果

                                                                  [root@localhost ~]# echo 1 > /proc/sys/net/ipv4/ip_forward

                                                                  2> 安装lvs节制软件ipvsadm

                                                                  [root@localhost ~]# mount /dev/cdrom /mnt/cdrom

                                                                  mount: block device /dev/cdrom is write-protected, mounting read-only

                                                                  [root@localhost ~]# cd /mnt/cdrom/Cluster

                                                                  [root@localhost Cluster]# rpm -ivh ipvsadm-1.24-10.i386.rpm

                                                                  warning: ipvsadm-1.24-10.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

                                                                  Preparing...            ###################################### [100%]

                                                                  1:ipvsadm              ###################################### [100%]

                                                                  3> 建想法则

                                                                  [root@localhost Cluster]# ipvsadm -A -t 192.168.2.11:80 -s rr

                                                                  [root@localhost Cluster]# ipvsadm -a -t 192.168.2.11:80 -r 192.168.2.20 -g

                                                                  [root@localhost Cluster]# ipvsadm -a -t 192.168.2.11:80 -r 192.168.2.30 -g

                                                                  4> 生涯法则并启动处事

                                                                  [root@localhost Cluster]# service ipvsadm save

                                                                  Saving IPVS table to /etc/sysconfig/ipvsadm:              [  OK  ]

                                                                  [root@localhost Cluster]# service ipvsadm start

                                                                  Clearing the current IPVS table:                          [  OK  ]

                                                                  Applying IPVS configuration:                              [  OK  ]

                                                                  Http server 1 设置

                                                                  1>    安装http处事器软件

                                                                  [root@localhost ~]# mount /dev/cdrom /mnt/cdrom

                                                                  mount: block device /dev/cdrom is write-protected, mounting read-only

                                                                  [root@localhost ~]# cd /mnt/cdrom/Server/

                                                                  [root@localhost Server]# rpm -ivh httpd-2.2.3-31.el5.i386.rpm

                                                                  warning: httpd-2.2.3-31.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

                                                                  Preparing...              ################################## [100%]

                                                                  1:httpd                  #################################### [100%]

                                                                  [root@localhost Server]#

                                                                  2>    开启处事

                                                                  [root@localhost Server]# service httpd start

                                                                  Starting httpd:                                            [  OK  ]

                                                                  3>    为http处事建设一个主页

                                                                  [root@localhost Server]# echo "111111" > /var/www/html/index.html

                                                                  4>    开启arp过滤

                                                                  先查察arp支持的状态

                                                                  [root@localhost Server]# sysctl -a | grep arp

                                                                  dev.parport.parport0.devices.lp.timeslice = 200

                                                                  dev.parport.parport0.devices.active = none

                                                                  dev.parport.parport0.modes = PCSPP,TRISTATE

                                                                  dev.parport.parport0.dma = -1

                                                                  dev.parport.parport0.irq = 7

                                                                  dev.parport.parport0.base-addr = 888                                                      0

                                                                  dev.parport.parport0.spintime = 500

                                                                  dev.parport.default.spintime = 500

                                                                  dev.parport.default.timeslice = 200

                                                                  net.ipv4.conf.eth1.arp_accept = 0

                                                                  net.ipv4.conf.eth1.arp_ignore = 0

                                                                  net.ipv4.conf.eth1.arp_announce = 0

                                                                  net.ipv4.conf.eth1.arp_filter = 0

                                                                  net.ipv4.conf.eth1.proxy_arp = 0

                                                                  net.ipv4.conf.eth0.arp_accept = 0

                                                                  net.ipv4.conf.eth0.arp_ignore = 0

                                                                  net.ipv4.conf.eth0.arp_announce = 0

                                                                  net.ipv4.conf.eth0.arp_filter = 0

                                                                  net.ipv4.conf.eth0.proxy_arp = 0

                                                                  net.ipv4.conf.lo.arp_accept = 0

                                                                  net.ipv4.conf.lo.arp_ignore = 0

                                                                  net.ipv4.conf.lo.arp_announce = 0

                                                                  net.ipv4.conf.lo.arp_filter = 0

                                                                  net.ipv4.conf.lo.proxy_arp = 0

                                                                  net.ipv4.conf.default.arp_accept = 0

                                                                  net.ipv4.conf.default.arp_ignore = 0

                                                                  net.ipv4.conf.default.arp_announce = 0

                                                                  net.ipv4.conf.default.arp_filter = 0

                                                                  net.ipv4.conf.default.proxy_arp = 0

                                                                  net.ipv4.conf.all.arp_accept = 0

                                                                  net.ipv4.conf.all.arp_ignore = 0

                                                                  net.ipv4.conf.all.arp_announce = 0

                                                                  net.ipv4.conf.all.arp_filter = 0

                                                                  net.ipv4.conf.all.proxy_arp = 0

                                                                  对其举办过滤

                                                                  [root@localhost ~]# echo "net.ipv4.conf.all.arp_ignore = 2" >> /etc/sysctl.conf

                                                                  [root@localhost ~]# echo "net.ipv4.conf.eth0.arp_announce = 1" >> /etc/sysctl.conf

                                                                  5>    添加到主机192.168.2.11的路由

                                                                  [root@localhost ~]# route add -host 192.168.2.11 dev lo:0