centos7上keepalived的安裝和配置
1、環境規劃
1)master:node1,centos7.5,eth0:192.168.1.11,eht1:10.10.1.11,keepalive
2)backup:node1,centos7.5,eth0:192.168.1.12,eth1:10.10.1.12,keepalive
2、搭建步驟
1)node1,node2上都以mini方式安裝CentOS 7.5 64-bit,並按照規劃配置IP地址;
2)node1,node2的/etc/hosts中新增如下內容。
192.168.1.11 node1.xx.xxx.com node1
10.10.1.11 node1.xx.xxx.com node1
192.168.1.12 node2.xx.xxx.com node2
10.10.1.12 node2.xx.xxx.com node2
3)node1,node2安裝keepalive1.3.5
#yum install keeplived
4)配置node1上的keepalive
vi /etc/keepalived/keepalived.conf #進行如下修改
vrrp_instance VI_1 {
state MASTER #設定節點node1為MASTER角色
interface enp11s0f0 #配置eth0網路卡enp11s0f0為節點node1的系統IP
virtual_router_id 51 #master和backup一致
priority 100 #數字越大,等級越高,保證master比任何backup高
advert_int 1
authentication {
auth_type PASS #vrrp協議,保證master及其他backup一致
auth_pass 1111 #保證master及其他backup一致
}
virtual_ipaddress {
192.168.1.210/24 #VIP
}
5)配置節點node2上的keeplive
vi /etc/keepalived/keepalived.conf #進行如下修改
vrrp_instance VI_1 {
state BACKUP #設定節點node2為BACKUP角色
interface enp11s0f0 #配置eth0網路卡enp11s0f0為節點node2的系統IP
virtual_router_id 51 #master和backup一致
priority 99 #數字越大,等級越高,保證比master低
advert_int 1
authentication {
auth_type PASS #vrrp協議,保證master及其他backup一致
auth_pass 1111 #保證master及其他backup一致
}
virtual_ipaddress {
192.168.1.210/24 #VIP
}
6)啟動和配置keepalive
systemctl start keepalived.service
systemct enable keepalived.service
3、驗證
1)檢視master上keepalive及ip
ps -ef|grep keepalive
ip addr
2)keepalived高可用測試
#關閉node1上的keepalived
systemctl stop keepalived.service
#檢視node1上的keepalived和ip
ps -ef|grep keepalived
ip addr
#檢視node2上的keepalived和ip
ps -ef|grep keepalived
ip addr
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8484829/viewspace-2674280/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql + keepalived 安裝配置MySql
- saltstack之keepalived的安裝配置
- CentOS7 下 Nginx 的安裝和配置CentOSNginx
- CentOS7上安裝和使用DockerCentOSDocker
- CentOS7上安裝並配置Nginx、PHP、MySqlCentOSNginxPHPMySql
- MYSQL + MHA +keepalive + VIP安裝配置(三)--keepalived安裝配置MySql
- [轉載] centos7 安裝和配置vncserverCentOSVNCServer
- CentOS7 在 VirtualBox 上的安裝配置(3) — 圖形介面安裝篇CentOS
- mha+keepalived安裝配置過程
- Centos7 安裝配置MysqlCentOSMySql
- Centos7 安裝配置NFSCentOSNFS
- Centos7上安裝dockerCentOSDocker
- centos7上 IC工具的安裝CentOS
- Linux上的redis的安裝和配置LinuxRedis
- keepalived安裝
- CentOS7 sudo 安裝與配置CentOS
- centos7下cobbler安裝配置CentOS
- CentOS7 安裝配置 GitLabCentOSGitlab
- CentOS7 安裝 配置網路CentOS
- Centos7安裝配置Hive教程。CentOSHive
- Centos7下安裝配置RedsocksCentOS
- CentOS7安裝完之後的配置CentOS
- 在Centos7上安裝DockerCentOSDocker
- git安裝及配置教程 windows windows上git的安裝和使用GitWindows
- 在CentOS 7.5上安裝和配置ProFTPDCentOSFTP
- Infer 在 Mac 上的安裝和環境配置Mac
- Centos7下安裝配置elasticsearch 6.3.1CentOSElasticsearch
- centos7安裝配置禪道7.3CentOS
- keepalived 安裝部署
- Nginx+Keepalived 主備高可用 安裝與配置Nginx
- CentOS7安裝Docker並配置映象加速CentOSDocker
- CentOS7下RabbitMQ服務安裝配置CentOSMQ
- CentOS7安裝配置vsftp搭建FTPCentOSFTP
- Centos7下安裝配置MySQL5.7CentOSMySql
- centos7 (阿里雲、linux) 單機spark的安裝與配置詳解(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)CentOS阿里LinuxSparkJDKHadoop
- windows和CentOS7安裝wkhtmltopdfWindowsCentOSHTML
- 在Centos7上安裝Redis6CentOSRedis
- Centos7上安裝、破解bamboo6.0.3CentOS