keepalive簡介和安裝

2021-09-29 09:31:11 字數 1968 閱讀 8306

1)vrrp協議的軟體實現,原生設計目的為了高可用ipvs服務。

2)keepalived功能

3)keepalived元件

控制項:配置檔案解析器

io復用器

記憶體管理元件

圖示:

4)keepalived相關術語

5)keepalived的工作模式:

6)keepalived的工作方式

7)keepalived的安全工作

8)keepalived的通告:

• 各節點時間必須同步

• 關閉selinux和防火牆

1)keepalived安裝

2)編譯安裝

①獲取原始碼包並解壓縮

~]# cd /usr/local/src/ (/usr/local/src/原始碼包存放路徑)

src]# wget

src]# tar xf keepalived-2.0.18/

src]# cd keepalived-2.0.18/

②提供編譯環境

keepalived-2.0.18]# yum install -y gcc libnfnetlink-devel libnfnetlink ipvsadm libnl libnl-devel libnl3 libnl3-devel lm_sensors-libs net-snmp-agent-libs net-snmp-libs openssh-server openssh-clients openssl openssl-devel automake iproute

③configure

keepalived-2.0.18]# ./configure --prefix=/usr/local/keepalived --disable-fwmark

==># echo $? ==>確認沒報錯

④make && make install

keepalived-2.0.18]# make && make install

⑤複製相關配置檔案及啟動指令碼

keepalived-2.0.18]# cp /usr/local/src/keepalived-2.0.18/keepalived/etc/init.d/keepalived.rh.init /etc/sysconfig/keepalived.sysconfig

keepalived-2.0.18]# cp /usr/local/src/keepalived-2.0.18/keepalived/keepalived.service /usr/lib/systemd/system/

keepalived-2.0.18]# cp /usr/local/src/keepalived-2.0.18/bin/keepalived /usr/local/bin/

⑥準備簡單的配置測試keepalived能否使用

keepalived-2.0.18]# vim /etc/keepalived/keepalived.conf

global_defs

notification_email_from root@localhost

smtp_server 192.168.200.1

smtp_connect_timeout 30

router_id centos7-27

} vrrp_instance vi_1

virtual_ipaddress

}keepalived-2.0.18]# systemctl start keepalived

主配置檔案:/etc/keepalived/keepalived.conf

主程式檔案:/usr/sbin/keepalived

service file:

keepalive 安裝和雙機熱備

2 安裝 unzip keepalived master.zip cd keepalived master 或 tar zxvf keepalived 1.2.7.tar.gz cd keepalived 1.2.7 configure prefix usr local keepalived 或 c...

KeepAlive安裝以及簡單配置

作業系統 centos7.7 yum install y gcc openssl devel popt develyum y install libnl libnl develyum install y libnfnetlink develyum y install libevent develyu...

KeepAlive安裝以及簡單配置

作業系統 centos7.3 yum install y gcc openssl devel popt devel yum y install libnl libnl devel yum install y libnfnetlink develcd usr local src wget然後解壓,配置...