18.3/18.4/18.5 用keepalived配置高可用集羣

用keepalived配置高可用集羣

  • 準備兩臺機器130和132,130做爲master,132做爲backup
  • 兩臺機器都執行yum install -y keepalived
  • 兩臺機器都安裝nginx,其中130上已經編譯安裝過nginx,132上須要yum安裝nginx: yum install -y nginx
  • 設定vip爲100
  • 編輯130上keepalived配置文件,內容獲取地址
  • 130編輯監控腳本,內容獲取地址
  • 給腳本755權限
  • systemctl start keepalived 130啓動服務
  • 132上編輯配置文件,內容獲取地址
  • 132上編輯監控腳本,內容獲取地址
  • 給腳本755權限
  • 132上也啓動服務 systemctl start keepalived

keepalived配置高可用集羣


  1. 首先準備兩臺機器,都安裝keepalived
  • keepalived,實際是包含一個服務的,也就是說這個服務用來實現高可用
A機器,安裝keepalived
[root@hanfeng ~]# yum install -y keepalived

B機器,安裝keepalived
[root@hf-01 ~]# yum install -y keepalived
  1. 這裏使用 nginx ,把它做爲一個高可用的對象——>使用nginx做爲演示對象的緣由,由於nginx在工做中,在生產環境中,不少企業把nginx作一個負載均衡器
  • 假設nginx一旦掛掉,那麼後端全部的web,即便說是正常的,那也沒法訪問到
  1. 如果A、B機器沒有裝nginx服務,能夠直接 yum安裝
A機器源碼安裝nginx
(PS:有時初始化的時候,會看到沒法初始化,是由於缺乏一些包yum install  -y gcc)

B機器yum安裝nginx
[root@hf-01 ~]# yum install -y epel-release
[root@hf-01 ~]# yum install -y nginx
[root@hf-01 ~]# systemctl start nginx
[root@hf-01 ~]# ps aux |grep nginx
root      2825  0.0  0.2 123300  2100 ?        Ss   11:40   0:00 nginx: master process /usr/sbin/nginx
nginx     2826  0.0  0.3 123764  3120 ?        S    11:40   0:00 nginx: worker process
root      2828  0.0  0.0 112656   992 pts/0    R+   11:40   0:00 grep --color=auto nginx
[root@hf-01 ~]#
  1. 更改keepalived配置文件了,內容地址
  • 默認的配置文件路徑在/etc/keepalived/keepalived.conf
  • 清空文件的快捷鍵方法 > !$
A機器更改配置文件
[root@hanfeng ~]# ls /etc/keepalived/keepalived.conf 
/etc/keepalived/keepalived.conf
[root@hanfeng ~]# > !$        //直接清空文件內容了
> /etc/keepalived/keepalived.conf
[root@hanfeng ~]# cat /etc/keepalived/keepalived.conf
[root@hanfeng ~]# vim /etc/keepalived/keepalived.conf   //去文件地址去下載內容
將拷貝的內容複製進去
只須要改網卡名字和飄逸IP爲192.168.133.100
####################### #  全局配置 #######################
global_defs {                            //global_defs 全局配置標識
   notification_email {               //notification_email用於設置報警郵件地址
han1118feng@163.com           //能夠設置多個,每行一個
   }
   notification_email_from root@aminglinux.com    //設置郵件發送地址  
   smtp_server 127.0.0.1                //設置郵件的smtp server地址
   smtp_connect_timeout 30            //設置鏈接smtp sever超時時間
   router_id LVS_DEVEL
}

###################### #  VRRP配置 ######################
vrrp_script chk_nginx {               
    script "/usr/local/sbin/check_ng.sh"   //檢查服務是否正常,經過寫腳本實現,腳本檢查服務健康狀態
    interval 3                      //檢查的時間間斷是3秒
}
vrrp_instance VI_1 {                        //VRRP配置標識 VI_1是實例名稱 
    state MASTER                           //定義master相關
    interface eno16777736                        //經過vrrp協議去通訊、去發廣播。配置時,需注意本身的網卡名稱
    virtual_router_id 51                   //定義路由器ID ,配置的時候和從機器一致
    priority 100                              //權重,主角色和從角色的權重是不一樣的
    advert_int 1                            //設定MASTER與BACKUP主機質檢同步檢查的時間間隔,單位爲秒
    authentication {                       //認證相關信息
        auth_type PASS                   //這裏認證的類型是PASS
        auth_pass aminglinux>com   //密碼的形式是一個字符串
    }
    virtual_ipaddress {                  //設置虛擬IP地址 (VIP),又叫作漂移IP地址
        192.168.74.100   //更改成192.168.74.100
    }
    track_script {               //加載腳本 
        chk_nginx            
    }
}

保存退出
  • virtual_ipaddress:簡稱VIP,這個vip,兩臺機器,一個主,一個從,正常的狀況是主在服務,主宕掉了,從起來了,從啓動服務,從啓動nginx之後,,啓動之後,訪問那個IP呢?把域名解析到那個IP上呢?假如解析到主上,主宕掉了,因此這個,須要定義一個公有IP(主上用的IP,從上也用的IP);這個IP是隨時能夠夏掉,去配置的
  1. 定義監控腳本,腳本內容獲取地址
  • 腳本路徑在keepalived配置文件中有定義,路徑爲/usr/local/sbin/check_ng.sh
A機器定義監控腳本
[root@hanfeng ~]# vim /usr/local/sbin/check_ng.sh

#!/bin/bash
#時間變量,用於記錄日誌
d=`date --date today +%Y%m%d_%H:%M:%S`
#計算nginx進程數量
n=`ps -C nginx --no-heading|wc -l`
#若是進程爲0,則啓動nginx,而且再次檢測nginx進程數量,
#若是還爲0,說明nginx沒法啓動,此時須要關閉keepalived
if [ $n -eq "0" ]; then
        /etc/init.d/nginx start
        n2=`ps -C nginx --no-heading|wc -l`
        if [ $n2 -eq "0"  ]; then
                echo "$d nginx down,keepalived will stop" >> /var/log/check_ng.log
                systemctl stop keepalived
        fi
fi

保存退出
  • 「腦裂」,在高可用(HA)系統中,當聯繫2個節點的「心跳線」斷開時,原本爲一總體、動做協調的HA系統,就分裂成爲2個獨立的個體。因爲相互失去了聯繫,都覺得是對方出了故障。兩個節點上的HA軟件像「裂腦人」同樣,爭搶「共享資源」、爭起「應用服務」,就會發生嚴重後果——或者共享資源被瓜分、2邊「服務」都起不來了;或者2邊「服務」都起來了,但同時讀寫「共享存儲」,致使數據損壞
  • 如何判斷腦裂?
    • 分別在兩臺機查看當前服務器是否擁有虛擬IP,若是兩臺服務器都擁有,則說明發生了腦裂,證實目前雙機通訊出現問題,產生此問題的原有在於 兩臺服務器都探測不到組內其餘服務器的狀態(心跳請求沒法正常響應),私自斷定另外一臺服務器掛起,則搶佔虛擬IP,腦裂的出現是不被容許的,解決此問題的方法爲檢查防火牆設置(關閉防火牆)或者使用串口通訊。
  1. 腳本建立完以後,還須要改變腳本的權限(不更改權限,就沒法自動加載腳本,那就沒法啓動keepalived服務)
[root@hanfeng ~]# chmod 755 /usr/local/sbin/check_ng.sh
[root@hanfeng ~]#
  1. 啓動keepalived服務,並查看是否啓動成功(PS:啓動不成功,有多是防火牆未關閉或者規則限制致使的)
  • systemctl stop firewalld 關閉firewalld
  • iptables -nvL
  • setenforce 0 臨時關閉selinux
  • getenforce命令查看是否爲Permissive
  • 這時再來啓動keepalived,就會看到keepalived進程服務了
[root@hanfeng ~]# systemctl start keepalived
[root@hanfeng ~]# ps aux |grep keepalived
root      2970  0.0  0.1 121324  1404 ?        Ss   07:14   0:00 /usr/sbin/keepalived -D
root      2971  0.0  0.2 123396  2356 ?        S    07:14   0:00 /usr/sbin/keepalived -D
root      2972  0.0  0.2 123396  2384 ?        S    07:14   0:00 /usr/sbin/keepalived -D
root      2974  0.0  0.0 112672   988 pts/1    R+   07:14   0:00 grep --color=auto keepalived
[root@hanfeng ~]#
  1. 查看nginx服務進程
[root@hanfeng ~]# ps aux |grep nginx
root      3004  0.0  0.2 123372  2108 ?        Ss   07:18   0:00 nginx: master process /usr/sbin/nginx
nginx     3005  0.0  0.3 123836  3148 ?        S    07:18   0:00 nginx: worker process
root      3007  0.0  0.0 112672   984 pts/1    R+   07:19   0:00 grep --color=auto nginx
[root@hanfeng ~]#
  1. 這時中止nginx服務
  • /etc/init.d/nginx stop
[root@hanfeng ~]# /etc/init.d/nginx stop
Stopping nginx (via systemctl):                            [  肯定  ]
[root@hanfeng ~]#
  1. 再來查看nginx服務進程,會看到自動加載了
[root@hanfeng ~]# ps aux |grep nginx
root      6238  0.0  0.0  20996   628 ?        Ss   08:07   0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody    6242  0.0  0.3  23440  3212 ?        S    08:07   0:00 nginx: worker process
nobody    6243  0.0  0.3  23440  3212 ?        S    08:07   0:00 nginx: worker process
root      6263  0.0  0.0 112676   980 pts/0    R+   08:07   0:00 grep --color=auto nginx
[root@hanfeng ~]#
  1. keepalived日誌文件路徑
  • /var/log/messages
  1. 查看ip地址,使用 ip add 命令,而不能使用ifconfig命令,由於 ifconfig命令 是沒法查看到vip192.168.133.100這個IP的
[root@hanfeng ~]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:c7:05:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.74.130/24 brd 192.168.74.255 scope global dynamic eno16777736
       valid_lft 1158sec preferred_lft 1158sec
    inet 192.168.133.100/32 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fec7:528/64 scope link 
       valid_lft forever preferred_lft forever
[root@hanfeng ~]#
  1. 檢查A、B 機器下防火牆和selinux是否關閉了,若沒有關閉,可能會致使實驗失敗
  • systemctl stop firewalld 關閉firewalld
  • iptables -nvL
  • setenforce 0 臨時關閉selinux
  • getenforce命令查看是否爲Permissive

以上就是主機器A的配置

backup 機器配置

  1. 在B機器yum安裝nginx和keepalived
[root@hf-01 ~]# yum install -y epel-release
[root@hf-01 ~]# yum install -y nginx
  1. 關閉B機器的防火牆和selinux
  • iptables -F 清空規則
  • setenforce 0 臨時關閉selinux
  1. 自定義B機器keepalived配置文件,內容獲取地址,更改虛擬IP和主同樣的
首先清空B機器keepalived裏面自帶的配置文件
[root@hf-01 ~]# > /etc/keepalived/keepalived.conf 
[root@hf-01 ~]# cat !$
cat /etc/keepalived/keepalived.conf
[root@hf-01 ~]# 

而後複製配置文件並粘貼進去,更改虛擬IP和主同樣的
[root@hf-01 ~]# vim /etc/keepalived/keepalived.conf


global_defs {
   notification_email {
     aming@aminglinux.com
   }
   notification_email_from root@aminglinux.com
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}
vrrp_script chk_nginx {
    script "/usr/local/sbin/check_ng.sh"
    interval 3
}
vrrp_instance VI_1 {
    state BACKUP        //這裏 和master不同的名字
    interface eno16777736        //網卡和當前機器一致,不然沒法啓動keepalived服務
    virtual_router_id 51        //和主機器 保持一致
    priority 90            //權重,要比主機器小的數值
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass aminglinux>com
    }
    virtual_ipaddress {
        192.168.74.100        //這裏更改成192.168.74.100
    }
    track_script {
        chk_nginx
    }
}

保存退出
  1. 定義監控腳本,路徑再keepalived裏面已定義過,腳本內容地址
  • 這個腳本和主上的腳本有一點區別,啓動nginx的命令不一樣,由於一個是yum安裝,一個是源碼包安裝
[root@hf-01 ~]# vim /usr/local/sbin/check_ng.sh

#時間變量,用於記錄日誌
d=`date --date today +%Y%m%d_%H:%M:%S`
#計算nginx進程數量
n=`ps -C nginx --no-heading|wc -l`
#若是進程爲0,則啓動nginx,而且再次檢測nginx進程數量,
#若是還爲0,說明nginx沒法啓動,此時須要關閉keepalived
if [ $n -eq "0" ]; then
        systemctl start nginx
        n2=`ps -C nginx --no-heading|wc -l`
        if [ $n2 -eq "0"  ]; then
                echo "$d nginx down,keepalived will stop" >> /var/log/check_ng.log                systemctl stop keepalived
        fi
fi
保存退出
  1. 改動腳本的權限,設置爲755權限
[root@hf-01 ~]# chmod 755 /usr/local/sbin/check_ng.sh
[root@hf-01 ~]#
  1. B機器啓動keepalived服務
  • systemctl start keepalived
[root@hf-01 ~]# systemctl start keepalived
[root@hf-01 ~]# ps aux |grep keep
root      2814  0.0  0.1 121324  1396 ?        Ss   07:10   0:00 /usr/sbin/keepalived -D
root      2815  0.0  0.2 121324  2740 ?        S    07:10   0:00 /usr/sbin/keepalived -D
root      2816  0.0  0.2 121324  2324 ?        S    07:10   0:00 /usr/sbin/keepalived -D
root      2827  0.0  0.0 112672   980 pts/0    R+   07:10   0:00 grep --color=auto keep
[root@hf-01 ~]#

如何區分主和從上的nginx?

  • A機器,是源碼包安裝的nginx(PS:這是lnmp配置好的環境虛擬主機內容)
[root@hanfeng ~]# cat /usr/local/nginx/conf/vhost/aaa.com.conf
server
{
    listen 80 default_server; 
    server_name aaa.com;
    index index.html index.htm index.php;
    root /data/wwwroot/default;
 location ~ \.php$
    {
        include fastcgi_params;
        fastcgi_pass unix:/tmp/champ.sock;
       #fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /data/wwwroot/default$fastcgi_script_name;
    }

}

[root@hanfeng ~]# cat /data/wwwroot/default/index.html 
This is the default sete.
[root@cham002 ~]# vim /data/wwwroot/default/index.html 
master This is the default sete.
[root@cham002 ~]#

輸入圖片說明

  • B機器是yum安裝的nginx
    • 默認的索引頁在 /usr/share/nginx/html/index.html
[root@hf-02~]# cat /usr/share/nginx/html/index.html 
[root@hf-02 ~]# vim /usr/share/nginx/html/index.html 
backup backup.
![輸入圖片說明](https://static.oschina.net/uploads/img/201801/28233716_ovDw.png "backup機器訪問IP")
  • 訪問192.168.74.100這個VIP會看到和主機器(即A機器相同的內容),說明如今訪問到的是機器master,VIP在master上

輸入圖片說明

問題-B機器沒法調用nginx服務?

  • B機器關閉nginx服務,keepalived沒法拉動nginx服務起來
  • 解決方法:
    • 再次設置755權限,就能夠拉動nginx服務了

測試高可用

  1. 模擬線上生產環境,主機器宕機環境,最簡單直接的方法,就是直接關閉keepalived服務
  2. 關閉master機器(即A機器)上的keepalived服務關閉
[root@hanfeng ~]# systemctl stop keepalived
[root@hanfeng ~]#
  1. 查看A機器上的VIP被已經釋放掉了
[root@hanfeng ~]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:c7:05:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.74.130/24 brd 192.168.74.255 scope global dynamic eno16777736
       valid_lft 1219sec preferred_lft 1219sec
    inet6 fe80::20c:29ff:fec7:528/64 scope link 
       valid_lft forever preferred_lft forever
[root@hanfeng ~]#
  1. 查看backup機器(即B機器)在監聽VIP
[root@hf-01 ~]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:ff:fe:93 brd ff:ff:ff:ff:ff:ff
    inet 192.168.74.129/24 brd 192.168.74.255 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet 192.168.74.100/32 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet 192.168.74.150/24 brd 192.168.74.255 scope global secondary eno16777736:0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:feff:fe93/64 scope link 
       valid_lft forever preferred_lft forever
[root@hf-01 ~]#
  1. 查看B機器日誌
[root@hf-01 ~]# tail /var/log/messages
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng avahi-daemon[568]: Registering new address record for 192.168.74.100 on eno16777736.IPv4.
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
[root@hf-01 ~]#
  1. 瀏覽器訪問vip,會看到已經變成backup機器上的了php

    輸入圖片說明

  2. 在master機器(即A機器)啓動keepalived服務,會看到vip這個IP馬上回來了html

[root@hanfeng ~]# systemctl start keepalived
[root@hanfeng ~]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:c7:05:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.74.130/24 brd 192.168.74.255 scope global dynamic eno16777736
       valid_lft 1577sec preferred_lft 1577sec
    inet 192.168.74.100/32 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fec7:528/64 scope link 
       valid_lft forever preferred_lft forever
[root@hanfeng ~]#
  1. 查看B機器日誌變化
[root@hf-01 ~]# tail /var/log/messages
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:39 hanfeng avahi-daemon[568]: Registering new address record for 192.168.74.100 on eno16777736.IPv4.
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
[root@hf-01 ~]# tail /var/log/messages
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:20:44 hanfeng Keepalived_vrrp[7886]: Sending gratuitous ARP on eno16777736 for 192.168.74.100
Jan 29 08:30:01 hanfeng systemd: Started Session 49 of user root.
Jan 29 08:30:01 hanfeng systemd: Starting Session 49 of user root.
Jan 29 08:30:51 hanfeng Keepalived_vrrp[7886]: VRRP_Instance(VI_1) Received advert with higher priority 100, ours 90
Jan 29 08:30:51 hanfeng Keepalived_vrrp[7886]: VRRP_Instance(VI_1) Entering BACKUP STATE
Jan 29 08:30:51 hanfeng Keepalived_vrrp[7886]: VRRP_Instance(VI_1) removing protocol VIPs.
Jan 29 08:30:51 hanfeng avahi-daemon[568]: Withdrawing address record for 192.168.74.100 on eno16777736.
[root@hf-01 ~]#

##總結mysql

  • 在生產環境中,可能會用到2-3臺backup角色, vim /etc/keepalived/keepalived.conf 這裏面的權重調成不通級別,權重越高優先級越高!除了nginx服務的話,還能夠作MySQL的高可用集羣服務。(作mysql的高可用,必定要保證兩邊的數據一致)
相關文章
相關標籤/搜索