温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MySQL高可用工具Orchestrator怎么进行raft多节点模式安装

发布时间:2021-11-03 15:03:54 阅读:290 作者:柒染 栏目:MySQL数据库
亿速云mysql数据库,读写分离,安全稳定,弹性扩容,低至0.3元/天!! 点击查看>>

这篇文章将为大家详细讲解有关MySQL高可用工具Orchestrator怎么进行raft多节点模式安装,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

环  境

orchestrator机器:10.10.30.150、10.10.30.128、10.10.30.145

orchestrator后端元数据库MySQL:10.10.30.150、10.10.30.128、10.10.30.145

目标监控数据库:10.10.30.130:3306

     安装orchestrator元数据库MySQL

在每一台orchestrator机器上安装MySQL,安装的步骤省略,和常规安装MySQL一样。

安装完成后创建orchestrator需要用到的库和用户。

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

这里元数据库MySQL和orchestrator在同一台机器上,所以创建账号的时候用的'127.0.0.1',如果不在同一台机器上,将IP换成orchestrator所在机器ip。
 密码按需修改

     安装orchestrator

下载orchestrator安装包,这里用的是orchestrator-3.1.2-linux-amd64.tar.gz

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

在每一台orchestrator机器上,解压orchestrator安装包。

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

将/usr/local/orchestrator/orchestrator-sample.conf.json移动到/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

     目标监控数据库授权

在需要监控的目标数据库上进行授权。这里目标数据库是: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' 改成对应orch所在服务器的ip,'orch_topology_password'改成合适的密码。这里orch_host是10.10.30.%,将密码改为orchestrator。

修改orchestrator配置文件

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

/// 配置orchestrator后端元数据库信息
...
"MySQLOrchestratorHost""127.0.0.1",
"MySQLOrchestratorPort"3306,
"MySQLOrchestratorDatabase""orchestrator",
"MySQLOrchestratorUser""orchestrator",
"MySQLOrchestratorPassword""orchestrator",
...
/// 配置orchestrator监控的目标数据库信息
"MySQLTopologyUser""orchestrator",
"MySQLTopologyPassword""orchestrator",
...
/// 配置raft的相关参数
"RaftEnabled"true,
"RaftDataDir""/var/lib/orchestrator",
"RaftBind""10.10.30.150"#本机ip或者hostname
"DefaultRaftPort"10008#raft端口
"RaftNodes": [
"10.10.30.150",
"10.10.30.128",
"10.10.30.145"
  ]

启动orchestrator

在每台orchestrator机器上启动orchestrator服务。

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怎么进行raft多节点模式安装

     问  题

这里假定环境:
 10.10.30.170是从库
 10.10.30.130是主库
 如上图所示

3.1.2版本的orchestrator在通过从库10.10.30.170发现主库的时候,通过show slave status得到的master_host虽然是10.10.30.130,但是页面上显示的却是10.10.30.130这个ip对应的hostname:10-10-30-130,如下图所示:

MySQL高可用工具Orchestrator怎么进行raft多节点模式安装

因此,orchestrator会报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机器上的/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

关于MySQL高可用工具Orchestrator怎么进行raft多节点模式安装就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

亿速云「云数据库 MySQL」免部署即开即用,比自行安装部署数据库高出1倍以上的性能,双节点冗余防止单节点故障,数据自动定期备份随时恢复。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

原文链接:http://blog.itpub.net/28218939/viewspace-2670835/

AI

开发者交流群×