4. 配置 Realserver


启动节点


5.启动 LVS 服务 pulse
# /etc/init.d/pulse start
Starting pulse: [ OK ]
如果不报错,表示启动成功!
到此 LVS 的服务器已经配置完成了启动两个程序
1、piranha‐gui 是用来配置 LVS 的
2、pulse 是用来启动 LVS 的
6. 备份 LVS 安装与配置
备份 LVS 安装同主 LVS 安装方法同样.直接将 lvs.conf 拷贝到相应的目录下:
#scp /etc/sysconfig/ha/lvs.cf root@192.168.2.163:/etc/sysconfig/ha/
# /etc/init.d/pulse start 启动服务即可.
7. 配置 Realserver
#yum install -y arptables_jf
#ifconfig eth0:1 192.168.2.253 netmask 255.255.255.255
#arptables -A IN -d 192.168.2.253 -j DROP
#arptables -A OUT -s 192.168.2.253 -j mangle --mangle-ip-s 192.168.2.53
#service arptables_jf save
以上操作会自动生成文件/etc/sysconfig/arptables
#cd /var/www/html/ //进入Apache默认发布目录
#echo `hostname` > index.html
#service httpd start //启动Apache服务
测试:
1).访问虚拟ip查看能否访问到两台realserver节点的httpd服务。刷新页面显示不同内容,说明实现了轮转循环。
2).停掉负载主节点的pulse服务,备用节点自动接管任务。
3).交替stop掉或者全部stop掉两台realserver的httpd服务,查看转发列表的变化。
更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-07/104791.htm
