linux下LVS keepalives负载均衡高可用服务器配置
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-07
IP说明: lvs:10.10.10.3 lvs(备):10.10.10.4 virtual:10.10.10.100 1 lvs和lvs(备)上建目录并将所需软件包放入 #mkdir /usr/local/src/lvs 2 lvs和lvs(备)上安装LVS和Keepalived Lvs的安装 #tar zxvf ipvsadm-1.24.tar.gz #cd ipvsadm-1.24 #make && make install Keepalived的安装 #tar zxvf keepalived-1.1.15.tar.gz #cd keepalived-1.1.15 #./configure && make && make install 将keepalived做成启动脚务,方便管理 #cp/usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/ #cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/ #mkdir /etc/keepalived #cp/usr/local/etc/keepalived/keepalived.conf /etc/keepalived/ #cp /usr/local/sbin/keepalived /usr/sbin/ #service keepalived start|stop 3 在web1、web2服务器上绑定虚拟IP #vim /etc/sysctl.conf 写入 net.ipv4.conf.lo.arp_ignore = 1 net.ipv4.conf.lo.arp_announce = 2 net.ipv4.conf.all.arp_ignore = 1 net.ipv4.conf.all.arp_announce = 2 [code] 添加虚拟ip地址 #cd /etc/sysconfig/network-scripts/ #ls #cp ifcfg-lo ifcfg-lo:0 #vim ifcfg-lo:0 #service network restart #service httpd start 4在主从负载均衡服务器上配置keepalived.conf实现负载均衡和和高可用性 #vim /etc/keepalived/keepalived.conf 编缉keepalived.conf文件,内容如下: ! Configuration File for keepalived global_defs { notification_email { lzc_a@yahoo.cn \接收服务器通告邮箱 } notification_email_from lzc_a@yahoo.cn smtp_server 127.0.0.1 smtp_connect_timeout 30
|
||
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于linux下LVS keepalives负载均衡高可用服务器配置的所有评论