keepaliced+nginx安装配置.docx

  1. 1、本文档共16页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
keepalicednginx安装配置keepalicednginx安装配置

Keepalived安装1.1安装版本keepalived-1.2.2.tar.gz1.2安装步骤# tar zxvf keepalived-1.2.7.tar.gz# cd keepalived-1.2.7# ./configure--prefix=/data/keepalived# make# make install# cp /data/keepalived/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/# cp /data/keepalived/etc/sysconfig/keepalived /etc/sysconfig/#mkdir /etc/keepalived# cp /data/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/# cp /data/keepalived/sbin/keepalived /usr/sbin/# chkconfig --add keepalived# chmod 755 /etc/init.d/keepalived# chkconfig keepalived on做成系统启动服务方便管理.# vi /etc/rc.local/etc/init.d/keepalived start1.3配置1.3.1主服务器配置# vi /etc/keepalived/keepalived.conf 加入以下内容! Configuration File for keepalived#邮件通知,可以不加global_defs {notification_email {acassen@firewall.loc#收件地址failover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre@firewall.loc#发件地址smtp_server #smtp服务器smtp_connect_timeout 30#连接smtp超时时间router_id LVS_DEVEL}vrrp_instance VI_1 {state MASTER#设置为主服务器interface eth0??#监控网卡virtual_router_id 51 # 保持主备服务器一致priority 100 # 优先级 (主服务器应比备份服务器高)advert_int 1 # 心跳广播时间间隔(秒)authentication {auth_type PASS?# 加密auth_pass 1111??#加密的密码,两台服务器一定要一样}virtual_ipaddress {40}}1.3.2备服务器配置# vi /etc/keepalived/keepalived.conf加入以下内容! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.locfailover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre@firewall.locsmtp_server smtp_connect_timeout 30router_id LVS_DEVEL}vrrp_instance VI_1 {state BACKUPinterface eth0virtual_router_id 51 # 保持主备服务器一致priority 90 # 优先级 (主服务器应比备份服务器高)advert_int 1 # 心跳广播时间间隔(秒)authentication {auth_typePASSauth_pass 1111}virtual_ipaddress {40}}1.4修改防火墙keepalived使用vrrp协议, vrrp协议使用8地址组播,修改防火墙负责主备服务器不能及时互换# vi /etc/sysconfig/iptables加入-I RH-Firewall-1-INPUT -d 8 -j ACCEPT重启防火墙# /etc/rc.d/init.d/iptables restart1.5测试# service keepalived start# ip a1: lo: LOOPBACK,UP mtu 16436 qdisc noqueuelink/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet /8 scope host loinet6 ::1/128 scope hostvalid_lft forever p

文档评论(0)

cxiongxchunj + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档