centos下 keepalived1.2.8配置文件
2013-10-25 18:24
375 查看
一、软件配置文件
vrrp_script chk_http_port { script "/etc/keepalived/nginx_pid.sh" interval 2 weight 2 } global_defs { notification_email { 308616473@qq.com } notification_email_from lizhuan@cdxfuture.com smtp_server smtp.exmail.qq.com smtp_connect_timeout 30 router_id LVS_Twioo } vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 51 mcast_src_ip 192.168.2.251 priority 80 advert_int 1 smtp_alert authentication { auth_type PASS auth_pass 123456 } virtual_ipaddress { 192.168.2.88 } track_script { chk_http_port } } virtual_server 192.168.2.88 80 { delay_loop 6 lb_algo rr lb_kind DR persistence_timeout 5 protocol TCP real_server 192.168.2.251 80 { weight 3 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 192.168.2.80 80 { weight 3 TCP_CHECK { connect_timeout 3 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } }二、检测nginx是否正常检测文件
#!/bin/bash nginxpid=`ps -C nginx --no-header | wc -l` if [ $nginxpid -eq 0 ];then eth0 $nginxpid /usr/local/nginx/sbin/nginx sleep 1 if [ $nginxpid -eq 0 ];then /etc/init.d/keepalived stop fi fi sleep 1 ~ ~ ~ ~ ~ ~ ~ ~
相关文章推荐
- centos 下keepalived-配置文件详解
- CentOS配置git客户端,使用密钥检出项目文件
- CentOS配置smaba与Windows共享文件
- CentOS的文件权限与目录配置
- CentOS 网卡配置文件
- centos6.0的基本网络配置文件
- CentOS系统rsync文件同步 安装配置
- 解决Centos下vsftp无法上传文件的问题,附vsftp配置详解
- 修改centos网卡配置文件
- centos7.2 配置NFS文件服务器,远程共享文件
- Centos中查看nginx、apache、php、mysql配置文件路径
- CentOS6.3配置samba文件服务器
- CentOS配置smaba与Windows共享文件
- Centos重新启动网络配置文件,/etc/resolv.conf被覆盖或清空问题解决
- CentOS 7配置LNMP开发环境及配置文件管理详解
- CentOS下Samba文件服务器的安装与配置
- CentOS7 设置redis重启配置文件
- keepalived配置文件及相关应用
- CentOS下Samba文件服务器的安装与配置
- CentOS 6.4多配置文件方式部署mariadb多实例 推荐