91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MySQL雙主高可用配置方法解析

發布時間:2020-04-24 15:31:05 來源:億速云 閱讀:238 作者:三月 欄目:MySQL數據庫

下文內容主要給大家帶來MySQL雙主高可用配置方法解析,這里所講到的知識,與書籍略有不同,都是億速云專業技術人員在與用戶接觸過程中,總結出來的,具有一定的經驗分享價值,希望給廣大讀者帶來幫助。 

一、在兩臺云服務器上分別安裝MySQL實例

Mysql01:192.168.0.207

Mysql02:192.168.0.208

vip1:192.168.0.211

vip2:192.168.0.212

(略)

二、在兩臺服務器上配置主主復制

GRANT REPLICATION SLAVE ON *.* TO 'dba_repl'@'192.168.0.%' IDENTIFIED BY '123456';

MySQL雙主高可用配置方法解析

change master to MASTER_HOST='192.168.0.207',

MASTER_USER='dba_repl',

MASTER_PASSWORD ='123456',

MASTER_LOG_FILE = 'mysql-bin.000003',

MASTER_LOG_POS = 120

;

三、配置keepalived,這個方案的關鍵點在于keepalived的配制,兩個vrrp_instance在兩個主上的優先級相反。

MySQL01:

global_defs {

# Keepalived process identifier

lvs_id MySQL_HA

}

# Script used to check if Proxy is running

vrrp_script check_proxy {

script "killall -0 mysql"

interval 2

weight 3

}

# Virtual interface 1

# The priority specifies the order in which the assigned interface to take over in a failover

vrrp_instance VI_01 {

state MASTER

interface eth0

virtual_router_id 51

priority 100

# The virtual ip address shared between the two loadbalancers

virtual_ipaddress {

192.168.0.211 dev eth0

}

track_script {

check_proxy

}

}

# Virtual interface 2

# The priority specifies the order in which the assigned interface to take over in a failover

vrrp_instance VI_02 {

state MASTER

interface eth0

virtual_router_id 52

priority 102

# The virtual ip address shared between the two loadbalancers

virtual_ipaddress {

192.168.0.212 dev eth0

}

track_script {

check_proxy

}

}

主二:

global_defs {

# Keepalived process identifier

lvs_id MySQL_HA

}

# Script used to check if Proxy is running

vrrp_script check_proxy {

script "killall -0 mysql"

interval 2

weight 3

}

# Virtual interface 1

# The priority specifies the order in which the assigned interface to take over in a failover

vrrp_instance VI_01 {

state MASTER

interface eth0

virtual_router_id 51

priority 102

# The virtual ip address shared between the two loadbalancers

virtual_ipaddress {

10.103.9.211 dev eth0

}

track_script {

check_proxy

}

}

# Virtual interface 2

# The priority specifies the order in which the assigned interface to take over in a failover

vrrp_instance VI_02 {

state MASTER

interface eth0

virtual_router_id 52

priority 100

# The virtual ip address shared between the two loadbalancers

virtual_ipaddress {

192.168.0.212 dev eth0

}

track_script {

check_proxy

}

}

對于以上關于MySQL雙主高可用配置方法解析,如果大家還有更多需要了解的可以持續關注我們億速云的行業推新,如需獲取專業解答,可在官網聯系售前售后的,希望該文章可給大家帶來一定的知識更新。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

龙里县| 含山县| 福安市| 临高县| 广宁县| 竹溪县| 德昌县| 蛟河市| 翁牛特旗| 蒙城县| 古丈县| 沿河| 安化县| 通道| 海城市| 古蔺县| 禄劝| 鄂尔多斯市| 阿克陶县| 繁峙县| 偏关县| 启东市| 涡阳县| 武夷山市| 获嘉县| 福鼎市| 呼和浩特市| 兖州市| 伽师县| 调兵山市| 阜城县| 鸡西市| 连州市| 沂水县| 如东县| 专栏| 乌兰浩特市| 郓城县| 綦江县| 尼玛县| 大渡口区|