Keepalived實現雙機熱備

2022-07-03 09:15:10 字數 944 閱讀 2694

一、主機從機都安裝keepalived

1.安裝

yum install -y keepalived

2.備份

cd /etc/keepalived

cp keepalived.conf

keepalived.conf.back

二、主機配置並啟動

1.建立配置檔案

echo

"! configuration file for keepalived

#主機配置

global_defs

vrrp_instance vi_1

virtual_ipaddress

}">./keepalived.conf

2.啟動

keepalived

-d -f /etc/keepalived/keepalived.conf

二、從機配置

1.建立配置檔案

echo "! configuration file for keepalived

#主機配置

global_defs

vrrp_instance vi_1

virtual_ipaddress

}">./keepalived.conf

2.啟動從機

keepalived

-d -f /etc/keepalived/keepalived.conf

完成,訪問192.168.1.237,其中一台機器斷開在訪問依然不會崩掉!注意2臺機器的防火牆要關掉!

以上就是這次的全部內容!

Keepalived雙機熱備

準備兩台虛擬機器 192.168.80.100 主伺服器 192.168.80.102 備份伺服器 在80.100虛擬機器上 systemctl stop firewalld 關閉防火牆 setenforce 0 關閉selinux 1 keepalived軟體安裝 yum install keep...

配置keepalived 雙機熱備

配置keepalived 雙機熱備 mkdir usr local keepalived tar zxvf keepalived 2.0.6.tar.gz c usr local keepalived cd usr local keepalived keepalived 2.0.6 configur...

Keepalived做雙機熱備

解壓以及編譯 tar xzf keepalived 1.2.7.tar.gz configure prefix opt keepalived make make install 配置keepalived 建立keepalived配置檔案keepalived.conf 只有虛擬ip功能,其他功能,例如...