溫馨提示×

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

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

MySQL高可用工具Orchestrator怎么進(jìn)行raft多節(jié)點(diǎn)模式安裝

發(fā)布時(shí)間:2021-11-03 15:03:54 來源:億速云 閱讀:269 作者:柒染 欄目:MySQL數(shù)據(jù)庫

這篇文章將為大家詳細(xì)講解有關(guān)MySQL高可用工具Orchestrator怎么進(jìn)行raft多節(jié)點(diǎn)模式安裝,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

環(huán)  境

orchestrator機(jī)器:10.10.30.150、10.10.30.128、10.10.30.145

orchestrator后端元數(shù)據(jù)庫MySQL:10.10.30.150、10.10.30.128、10.10.30.145

目標(biāo)監(jiān)控?cái)?shù)據(jù)庫:10.10.30.130:3306

     安裝orchestrator元數(shù)據(jù)庫MySQL

在每一臺(tái)orchestrator機(jī)器上安裝MySQL,安裝的步驟省略,和常規(guī)安裝MySQL一樣。

安裝完成后創(chuàng)建orchestrator需要用到的庫和用戶。

CREATE USER 'orchestrator'@'127.0.0.1' IDENTIFIED BY 'orchestrator';
GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orchestrator'@'127.0.0.1';

這里元數(shù)據(jù)庫MySQL和orchestrator在同一臺(tái)機(jī)器上,所以創(chuàng)建賬號(hào)的時(shí)候用的'127.0.0.1',如果不在同一臺(tái)機(jī)器上,將IP換成orchestrator所在機(jī)器ip。
 密碼按需修改

     安裝orchestrator

下載orchestrator安裝包,這里用的是orchestrator-3.1.2-linux-amd64.tar.gz

https://github.com/github/orchestrator/releases

在每一臺(tái)orchestrator機(jī)器上,解壓orchestrator安裝包。

tar -xvzf orchestrator-3.1.2-linux-amd64.tar.gz -C /

將/usr/local/orchestrator/orchestrator-sample.conf.json移動(dòng)到/etc下,并命名為orchestrator.conf.json

[root@10-10-30-150 orchestrator]# ls
orchestrator orchestrator-sample-sqlite.conf.json orchestrator-sample.conf.json resources
[root@10-10-30-150 orchestrator]# cp orchestrator-sample.conf.json /etc/orchestrator.conf.json

     目標(biāo)監(jiān)控?cái)?shù)據(jù)庫授權(quán)

在需要監(jiān)控的目標(biāo)數(shù)據(jù)庫上進(jìn)行授權(quán)。這里目標(biāo)數(shù)據(jù)庫是:10.10.30.130:3306

CREATE USER 'orchestrator'@'orch_host' IDENTIFIED BY 'orch_topology_password';
GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orchestrator'@'orch_host';
GRANT SELECT ON mysql.slave_master_info TO 'orchestrator'@'orch_host';
GRANT SELECT ON ndbinfo.processes TO 'orchestrator'@'orch_host'; -- Only for NDB Cluster
其中,將'orch_host' 改成對(duì)應(yīng)orch所在服務(wù)器的ip,'orch_topology_password'改成合適的密碼。這里orch_host是10.10.30.%,將密碼改為orchestrator。

修改orchestrator配置文件

修改/etc/orchestrator.conf.json如下:

/// 配置orchestrator后端元數(shù)據(jù)庫信息
...
"MySQLOrchestratorHost": "127.0.0.1",
"MySQLOrchestratorPort": 3306,
"MySQLOrchestratorDatabase": "orchestrator",
"MySQLOrchestratorUser": "orchestrator",
"MySQLOrchestratorPassword": "orchestrator",
...
/// 配置orchestrator監(jiān)控的目標(biāo)數(shù)據(jù)庫信息
"MySQLTopologyUser": "orchestrator",
"MySQLTopologyPassword": "orchestrator",
...
/// 配置raft的相關(guān)參數(shù)
"RaftEnabled": true,
"RaftDataDir": "/var/lib/orchestrator",
"RaftBind": "10.10.30.150", #本機(jī)ip或者h(yuǎn)ostname
"DefaultRaftPort": 10008, #raft端口
"RaftNodes": [
"10.10.30.150",
"10.10.30.128",
"10.10.30.145"
  ]

啟動(dòng)orchestrator

在每臺(tái)orchestrator機(jī)器上啟動(dòng)orchestrator服務(wù)。

cd /usr/local/orchestrator && ./orchestrator --config=/etc/orchestrator.conf.json http > /usr/local/orchestrator/orchestrator.log 2>&1 &

web端訪問地址10.10.30.150:3000。頁面效果如下:

MySQL高可用工具Orchestrator怎么進(jìn)行raft多節(jié)點(diǎn)模式安裝

     問  題

這里假定環(huán)境:
 10.10.30.170是從庫
 10.10.30.130是主庫
 如上圖所示

3.1.2版本的orchestrator在通過從庫10.10.30.170發(fā)現(xiàn)主庫的時(shí)候,通過show slave status得到的master_host雖然是10.10.30.130,但是頁面上顯示的卻是10.10.30.130這個(gè)ip對(duì)應(yīng)的hostname:10-10-30-130,如下圖所示:

MySQL高可用工具Orchestrator怎么進(jìn)行raft多節(jié)點(diǎn)模式安裝

因此,orchestrator會(huì)報(bào)10-10-30-130找不到:

2019-11-27 13:48:29 ERROR dial tcp: lookup 10-10-30-130 on 223.5.5.5:53: no such host

     如何解決

  • 將orchestrator版本換成3.1.0

  • 在orchestrator機(jī)器上的/etc/hosts下配置域名解析信息,添加如下:

10.10.30.130 10-10-30-130
10.10.30.183 10-10-30-183
10.10.30.170 10-10-30-170

關(guān)于MySQL高可用工具Orchestrator怎么進(jìn)行raft多節(jié)點(diǎn)模式安裝就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI