lvs+keepalived+DR安装

lvs+keepalived+DR安装

ID:40568596

大小:56.50 KB

页数:3页

时间:2019-08-04

lvs+keepalived+DR安装_第1页
lvs+keepalived+DR安装_第2页
lvs+keepalived+DR安装_第3页
资源描述:

《lvs+keepalived+DR安装》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、一,Lvs客户端(ubuntu脚本)1,[root@huludao-2~]#vi/usr/local/bin/lvs_real#!/bin/bash#description:startrealserverVIP=192.168.6.134case"$1"instart)echo"startLVSofREALServer"/sbin/ifconfiglo:0$VIPbroadcast$VIPnetmask255.255.255.255upecho"1">/proc/sys/net/ipv4/conf/lo/arp_ignoreech

2、o"2">/proc/sys/net/ipv4/conf/lo/arp_announceecho"1">/proc/sys/net/ipv4/conf/all/arp_ignoreecho"2">/proc/sys/net/ipv4/conf/all/arp_announce;;stop)/sbin/ifconfiglo:0downecho"closeLVSDirectorserver"echo"0">/proc/sys/net/ipv4/conf/lo/arp_ignoreecho"0">/proc/sys/net/ipv4/c

3、onf/lo/arp_announceecho"0">/proc/sys/net/ipv4/conf/all/arp_ignoreecho"0">/proc/sys/net/ipv4/conf/all/arp_announce;;*)echo"Usage:$0{start

4、stop}"exit1esac配置脚本写好保存,给予脚本执行权限。脚本启停以/usr/local/bin/lvs_realstart

5、stop来启动。通过来ipadd检查网络状态。从输出可以看出,lo:0确实绑定了我们指定的vip地址。那么当我们执行/usr/l

6、ocal/bin/lvs_real时,vip应当从lo:0接口卸载。2,打开二,LvsLD(centos5.3)1,Ipvsadmin默认已安装(安装系统时候,勾上cluster)2,keepalived的安装#tar-zxvfkeepalived-1.1.19.tar.gz#cdkeepalived-1.1.19./configure--prefix=/usr/local/keepalived--with-kernel-dir=/usr/src/kernels/2.6.18-128.el5PAE-i686/(注意编译时一定要支持

7、IPVS)#make;makeinstall#cp/usr/local/keepalived/etc/rc.d/init.d/keepalived/etc/rc.d/init.d/#cp/usr/local/keepalived/etc/sysconfig/keepalived/etc/sysconfig/#mkdir/etc/keepalived#cp/usr/local/keepalived/etc/keepalived/keepalived.conf/etc/keepalived/#cp/usr/local/keepaliv

8、ed/sbin/keepalived/usr/sbin/#servicekeepalivedstart

9、stop

10、status#chkconfig--addkeepalived#chkconfig--level345keepalivedon3,在/etc/sysconfig/network-scripts下新建一个vilo:0DEVICE=lo:0IPADDR=192.168.6.134NETMASK=255.255.255.255NETWORK=192.168.6.0#Ifyou'rehavingproblemswithgate

11、dmaking127.0.0.0/8amartian,#youcanchangethistosomethingelse(255.255.255.255,forexample)BROADCAST=192.168.6.134ONBOOT=yesNAME=loopback启动lo:0ifuplo:0(重启机器后一定要记得执行)4,keepalived.conf的编辑vi/etc/keepalived/keepalived.conf!ConfigurationFileforkeepalivedglobal_defs{notificatio

12、n_email{sysadmin@firewall.loc}notification_email_fromAlexandre.Cassen@firewall.locsmtp_server127.0.0.1smtp_connect_timeout30

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。