安装keepalived

主机名  网络IP                     VIP
node1 192.168.2.161     192.168.2.165
node2 192.168.2.162

[[email protected] ~]# wget http://www.keepalived.org/software/keepalived-1.2.13.tar.gz
[[email protected] ~]# tar zxvf keepalived-1.2.13.tar.gz
[[email protected] keepalived-1.2.13]# cd keepalived-1.2.13
[[email protected] keepalived-1.2.13]# ./configure --prefix=/usr/local/keepalived --disable-fwmark
[[email protected] keepalived-1.2.13]# make
[[email protected] keepalived-1.2.13]# make install
[[email protected] keepalived-1.2.13]# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
[[email protected] keepalived-1.2.13]# cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
[[email protected] keepalived-1.2.13]# cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/
[[email protected] keepalived-1.2.13]# cd /etc/init.d/
[[email protected] init.d]# chkconfig --add keepalived
[[email protected] init.d]# chkconfig keepalived on
[[email protected] init.d]# mkdir -p /etc/keepalived

#vim /etc/keepalived/keepalived.conf

! Configuration File for keepalived

global_defs {
notification_email {
[email protected]
}
notification_email_from [email protected]
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}

vrrp_instance VI_1 {
state MASTER #备用服务器上改为 BACKUP
interface eth1
virtual_router_id 51
priority 100 #备用服务器上改为99
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.2.165/24 dev eth1 scope global
}
}
[[email protected] haproxy]# service keepalived start
Starting keepalived: [ OK ]
[[email protected] sbin]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:c5:66:52 brd ff:ff:ff:ff:ff:ff
inet 192.168.228.156/24 brd 192.168.228.255 scope global eth0
inet6 fe80::20c:29ff:fec5:6652/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:c5:66:5c brd ff:ff:ff:ff:ff:ff
inet 192.168.2.161/24 brd 192.168.2.255 scope global eth1
inet 192.168.2.165/24 scope global secondary eth1
inet6 fe80::20c:29ff:fec5:665c/64 scope link
valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0

报错:

checking for openssl/ssl.h... no
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!
[[email protected] keepalived-1.2.14]# yum install openssl*

checking for kernel macvlan support... no
checking whether SO_MARK is declared... no
configure: error: No SO_MARK declaration in headers
[[email protected] keepalived-1.2.14]# ./configure --prefix=/usr/local/keepalived --disable-fwmark

时间: 2024-11-08 23:32:13

安装keepalived的相关文章

CentOS 7.0 安装keepalived

1.安装目录包 yum install -y net-tools psmisc 2.安装keepalived yum install -y ipvsadm keepalived 3.master配置文件 ! Configuration File for keepalived global_defs {    notification_email {      [email protected]      [email protected]      [email protected]    }

CentOS安装Keepalived

一.VRRP(虚拟路由器冗余协议) 虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是由IETF提出的解决局域网中配置静态网关出现单点失效现象的路由协议,1998年已推出正式的RFC2338协议标准.VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及及时在实际第一跳路由器使用失败的情形下仍能够维护路由器间的连通性. 二.Keepalived Keepalived是基于VRRP

centos6 安装 keepalived

安装keepalived yum -y install kernel-devel ln -s /usr/src/kernels/2.6.32-642.15.1.el6.x86_64/ /usr/src/linux cd /usr/local/src/ wget http://www.keepalived.org/software/keepalived-1.2.20.tar.gz tar -zxvf keepalived-1.2.20.tar.gz cd keepalived-1.2.20 ./c

Centos7 安装keepalived实现高可用

场景:尝试安装keepalived实现高可用,进而在suse环境中部署. 测试过程需要配合Nginx的相关知识:Centos7 Nginx安装 1 安装过程 问题 !!! OpenSSL is not properly installed on your system. !!! !!! Can not include OpenSSL headers files. 解决方法: yum -y install openssl-devel

编译安装keepalived 1.2.16

1.官网下载地址: http://www.keepalived.org/download.html   #截止目前最新版本为1.2.16 2.解压安装包: [[email protected] ~]# tar xvf keepalived-1.2.16.tar.gz 3.进入安装目录: [[email protected] ~]# cd keepalived-1.2.16 4.安装 解决依赖: [[email protected] keepalived-1.2.16]# yum install

自动安装keepalived、inotify-tools与检测

下面是我写的在linux5.6下自动安装keepalived.inotify-tools的脚本文件,里面添加了检测功能,脚本名称取名为task_install.sh,keepalived的版本为keepalived-1.1.20.tar.gz,inotify-tools的版本为inotify-tools-3.14.tar.gz.下面是脚本源文件: #!/bin/bash touch /etc/yum.repos.d/dvd.repo echo "[cd]" > /etc/yum.

CentOS6.5环境 安装Keepalived和高可用服务相关参数说明

一.硬件环境准备kep1 192.168.89.100    masterkep2 192.168.89.101    slave 二.安装keepalived(两台服务器都要安装)yum -y install keepalived 三.启动keepalived并检查1.两台服务器上启动keep服务[[email protected] ~]# /etc/init.d/keepalived start正在启动 keepalived:                                 

Keepalived系列一:安装Keepalived

1:简介 它是一个基于VRRP协议来实现的WEB服务高可用方案,可以利用其来避免单点故障.一个WEB服务至少会有2台服务器运行Keepalived,一台为主服务器(MASTER),一台为备份服务器(BACKUP),但是对外表现为一个虚拟IP,主服务器会发送特定的消息给备份服务器,当备份服务器收不到这个消息的时候,即主服务器宕机的时候,备份服务器就会接管虚拟IP,继续提供服务,从而保证了高可用性. 2:安装依赖包 首先需要安装ipvsadm: yum -y install ipvsadm yum

centos7 安装keepalived

node1 192.168.5.101 node2 192.168.5.102 1.安装 openssl openssl-devel yum install openssl openssl-devel -y 2. 安装keepalived tar -zxvf keepalived-1.4.0.tar.gz ./configrue --prefix=/app/keepalived make&&make install 3.配置keepalived配置文件 ! Configuration Fi

ansible-playbook自动化安装Keepalived实现Nginx服务双机热备自动化配置

脚本实现通过ansible-playbook自动化安装Keepalived和配置,主要解决问题如下: Keepalived自动化安装: keepalived_vrid配置,自动根据vip获取最后一段作为vrid,确保同一网段不会出现vrid冲突导致HA切换失败的问题: 自动配置Keepalived: HA检测脚本自定义,根据脚本内容,来做redis或nginx或其他软件的双机热备: 自动配置vip给Keepalived 设置Keepalived开机启动,加入系统服务: Keepalived安装脚