编译安装配置keepalived-2.0.17

安装:
官网下载源码包
wget https://www.keepalived.org/software/keepalived-2.0.17.tar.gz

安装keepalived所需要的 一些依赖包
yum install openssl-devel popt-devel libnl-devel kernel-devel gcc -y

解压源码,安装到/usr/local/keepalived

tar zxvf keepalived-2.0.17.tar.gz
cd keepalived-2.0.17
 ./configure --prefix=/usr/local/keepalived
 make && make install

启动keepalived服务

systemctl enable keepalived
systemctl start keepalived

启动报错,默认读取配置文件为/etc/keepalived/keepalived.conf

mkdir -p /etc/keepalived
ln -s /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
systemctl start keepalived
systemctl status keepalived

配置:
master:

! Configuration File for keepalived

global_defs {
   notification_email {
       [email protected]
   }
   notification_email_from  [email protected]
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id MASTER
     script_user root
   enable_script_security
}

vrrp_script check_haproxy {
   script "/etc/keepalived/scripts/check_haproxy.sh"
   interval 3
}

vrrp_instance http {
    state BACKUP
    interface eth0
    dont_track_primary
    nopreempt

    track_interface {
    eth0
    }

    garp_master_delay 6
    virtual_router_id 60
    priority 110
    advert_int 1

    authentication {
    auth_type PASS
    autp_pass 1234
    }

    virtual_ipaddress {
    192.168.12.53/24 brd 192.168.12.255 dev eth0 label eth0:1
    }

    track_script {
    check_haproxy
    }

    notify_master /etc/keepalived/scripts/state_master.sh
    notify_backup /etc/keepalived/scripts/state_backup.sh
    notify_fault  /etc/keepalived/scripts/state_fault.sh
}

backup:

! Configuration File for keepalived

global_defs {
   notification_email {
       [email protected]
   }
   notification_email_from  [email protected]
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id BACKUP
     script_user root
   enable_script_security
}

vrrp_script check_haproxy {
   script "/etc/keepalived/scripts/check_haproxy.sh"
   interval 3
}

vrrp_instance http {
    state BACKUP
    interface eth0
    dont_track_primary
    nopreempt

    track_interface {
    eth0
    }

    garp_master_delay 6
    virtual_router_id 60
    priority 105
    advert_int 1

    authentication {
    auth_type PASS
    autp_pass 1234
    }

    virtual_ipaddress {
    192.168.12.53/24 brd 192.168.12.255 dev eth0 label eth0:1
    }

    track_script {
    check_haproxy
    }

    notify_master /etc/keepalived/scripts/state_master.sh
    notify_backup /etc/keepalived/scripts/state_backup.sh
    notify_fault  /etc/keepalived/scripts/state_fault.sh
}

原文地址:https://blog.51cto.com/7585527/2420737

时间: 2024-10-02 08:09:38

编译安装配置keepalived-2.0.17的相关文章

[转]Centos6.5安装配置keepalived

参考博文: Centos6.5安装配置keepalived CentOS6.5 keepalived详解及实现Nginx服务的高可用性 CentOS6.5 LVS + KeepAlived搭建步骤 我采用yum 方式  直接安装  版本为1.2.13 # yum -y install keepalived global_defs { #全局定义 notification_email { #定义邮件提醒 一行一个 多个人写多行 acassen@firewall.loc failover@firew

编译安装配置nginx1.6以及其一些基本配置等

实验环境: centos 6.6 [该节点IP为172.16.3.101] 配置好的yum源[可以把yum源指向搜狐或者阿里的镜像站点,也可以是自己的光盘] 编译安装配置nginx1.6 # 安装之前最好先把如下包组安装上 [[email protected] httpd-2.2.29]# yum grouplist | grep -i 'develop'    Additional Development    Development tools    Server Platform Deve

centos 6.5 编译安装了 Nginx1.6.0+MySQL5.6.19+PHP5.5.14

centos 6.5 编译安装了 Nginx1.6.0+MySQL5.6.19+PHP5.5.14--------------------------------------------------------------------------------------------- 安装包:http://pan.baidu.com/s/1jG8iose SecureCRT下载地址:http://pan.baidu.com/s/1kTtnfKV FlashFXP下载地址:http://pan.b

cloudera impala编译 安装 配置 启动

无论是采用GDB调试impala或者尝试修改impala源码,前提都是需要本地环境编译impala,这篇文章详细的分享一下impala编译方法以及编译过程遇到的棘手的问题: 前言: impala官方的git上其实是有impala编译的步骤的,但是在后来的git版本迭代中,被藏在了一个诡异的地方,https://github.com/cloudera/Impala/tree/v1.2.2,虽i然官方给出了步骤,但该博文并不是官方的一个简单翻译,其中涵盖了很多我加入的细节提醒和遇到的bug以及错误的

Lvs+keepalived安装配置(v1.0)

测试环境 系统:centos6.5_x86_64 主DR IP:192.168.1.216 备DR IP:192.168.1.218 VIP:192.168.1.253/254 real_server1:192.168.1.220 real_server2:192.168.1.219 一.安装ipvsadm 1.1 安装依赖包 yum -y install  libnl-devel  libnl popt popt-static 1.2 下载并安装ipvsadm wget http://www.

heartbeat 编译安装配置

一.heartbeat介绍 heartbeat是HA高可用集群的一个重要组件,heartbeat实现了资源转移和心跳信息传递.它的常用组合方式为heartbeat v1,heartbeat v2+crm,heartbeat v3 + pacemaker,目前版本为v3版本. 二.编译前准备 heartbeat官方站点http://hg.linux-ha.org/   Cluster Glue官方站点https://github.com/ClusterLabs/cluster-glue   Res

linux 6下编译安装配置LAMP平台

LAMP(Linux- Apache-MySQL-PHP)网站架构是目前国际流行的Web框架,该框架包括:Linux操作系统,Apache网络服务器,MySQL数据库,Perl.PHP或者Python编程语言,所有组成产品均是开源软件,是国际上成熟的架构框架,很多流行的商业应用都是采取这个架构,和Java/J2EE架构相比,LAMP具有Web资源丰富.轻量.快速开发等特点,微软的.NET架构相比,LAMP具有通用.跨平台.高性能.低价格的优势,因此LAMP无论是性能.质量还是价格都是企业搭建网站

linux下编译安装配置php5.6.30过程

在第一次编译安装php5.6.30失败后,参考了http://www.phpworld.cn/system/php/11.html的一些内容,第二次编译安装成功,特此记录过程. 一.编译安装php5.6.30 安装环境: # cat /etc/redhat-release  CentOS release 6.8 (Final) # /application/nginx/sbin/nginx -v nginx version: nginx/1.6.3 下载php5.6.30安装包 wget htt

Ubuntu14.04 安装配置Hadoop2.6.0

目前关于Hadoop的安装配置教程书上.官方教程.博客都有很多,但由于对Linux环境的不熟悉以及各种教程或多或少有这样那样的坑,很容易导致折腾许久都安装不成功(本人就是受害人之一).经过几天不断尝试,终于成功了.现将整个关于Hadoop的安装配置步骤分享出来,一方面为了希望能对有需要的朋友有所帮助,一方面为了总结所遇到的问题和解决方案.接下来开始正文. 准备工作 提前下载好以下工具: JDK安装包 Eclipse安装包 Hadoop安装包 Eclipse的Hadoop插件插件 本人用的JDK版