keepalived 安裝和簡要配置

2021-10-11 18:57:41 字數 1412 閱讀 8726

2、tar -xvzf  keepalived-2.1.5.tar.gz 

3、進入對應目錄,configure --prefix=/usr/local/keepalived

4、顯示缺少openssl

安裝openssl , yum install openssl

5、重新編譯並安裝 make && make install

6、安裝後拷貝需要如下操作

cp /usr/local/keepalived/sbin/keepalived /etc/init.d/

cp /usr/local/keepalived/sbin/keepalived /etc/sysconfig/

cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

7、cd /etc/

mkdir keepalived

cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/

8、配置keepalived.conf

主:! configuration file for keepalived

global_defs

notification_email_from [email protected]  #發件人郵箱

smtp_server 192.168.200.1                      #

smtp_connect_timeout 30

router_id lvs_devel                           #需要配置,成員名 lvs_devel 和備機上不能重複

}vrrp_instance vi_1

virtual_ipaddress

}----其他的配置基本都是用於lvs,可刪除

備:! configuration file for keepalived

global_defs

notification_email_from [email protected]

smtp_server 192.168.200.1

smtp_connect_timeout 30

router_id lvs_devel2           #需要配置

}vrrp_instance vi_1

virtual_ipaddress

}9、啟停keepalived 

systemctl start keepalived

systemctl stop keepalived

10、檢視生效的ip

ip addr  | grep 192.168.64.198

主機停止keepalived,ip 會自動在備機上生效。

Keepalived概述和安裝(1)

一 keepalived概述 本文主要了解開源高可用負載均衡集群利器keepalived,掌握 keepalived 的安裝,運用 keepalived 配置高可用集群,並能夠實現 keepalived 與負載均衡集群 lvs的完美組合。1 什麼是keepalived?keepalived是乙個類似...

keepalived安裝部署

上傳伺服器安裝 tar xvf cd keepalived 1.3.5 configure prefix usr local keepalived make make install ln s usr local keepalived sbin usr bin ln s usr local keep...

Keepalived配置安裝

ubuntu 16.04.3系統兩台機器 vipip hostname port 192.168.0.200 192.168.0.129 master wjt ceshiji 80192.168.0.200 192.168.0.129 backup wjt ceshiji22 80wgettar z...