mysql拓扑绘制工具,MySQL高可用工具—Orchestrator初识

Orchestrator是一款开源的MySQL复制拓扑管理工具,采用go语言编写,支持MySQL主从复制拓扑关系的调整、支持MySQL主库故障自动切换、手动主从切换等功能。

Orchestrator后台依赖于MySQL或者SQLite存储元数据,能够提供Web界面展示MySQL集群的拓扑关系及实例状态,通过Web界面可更改MySQL实例的部分配置信息,同时也提供命令行和api接口,以便更加灵活的自动化运维管理。

相比于MHA,Orchestrator更加偏重于复制拓扑关系的管理,能够实现MySQL任一复制拓扑关系的调整,并在此基础上,实现MySQL高可用,另外Orchestrator自身可以部署多个节点,通过raft分布式一致性协议,保证自身的高可用。

环境说明

9ca67bcb733c3c8e7313d141d43c18ca.png

后台管理节点

CentOS Linux release 7.2以上,不然可能会出现缺少依赖包。

安装MySQL数据库,在启动Orchestrator程序的时候,会自动在数据库里创建orchestrator数据库,保存orchestrator的一些数据信息。

下载安装包

服务包wget

https://github.com/github/orchestrator/releaseswget https://github.com/github/orchestrator/releases/download/v3.1.2/orchestrator-3.1.2-1.x86_64.rpm

二进制命令wget

https://github.com/github/orchestrator/releases/download/v3.1.2/orchestrator-cli-3.1.2-1.x86_64.rpm

命令行工具

https://github.com/github/orchestrator/releases/download/v3.1.2/orchestrator-client-3.1.2-1.x86_64.rpm

安装

[root@localhost ~]# rpm -ivh orchestrator-*

Preparing... ################################# [100%]

Updating / installing... 1:orchestrator-cli-1:3.1.2-1 ################################# [100%]

Preparing... ################################# [100%]

Updating / installing... 1:orchestrator-1:3.1.2-1 ################################# [100%]

安装后会在/usr/local下生成orchestrator目录,包含以下文件和目录:

b8b4559f54e776dec185e47616b735c3.png

创建后台管理节点的库和用户

CREATE DATABASE IF NOT EXISTS orchestrator;

GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orc_server_user'@'%' IDENTIFIED BY 'server_passwd';

被监测的MYSQL授权

GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orc_client_user'@'%' IDENTIFIED BY 'client_passwd';

修改配置文件

cp orchestrator-sample.conf.json orchestrator.conf.json

"Debug": false, #设置Debug方式

"EnableSyslog": false, #是否把日志输出到系统日志里

"ListenAddress": ":3000", #web端口

"MySQLTopologyUser": "orc_client_user", #被监测的MYSQL实例用户

"MySQLTopologyPassword": "client_passwd", #被监测的MYSQL实例密码

"MySQLOrchestratorHost": "11.11.10.10", #后台管理主机

"MySQLOrchestratorPort": 3306, #后台管理库端口

"MySQLOrchestratorDatabase": "orchestrator", #后台管理库名

"MySQLOrchestratorUser": "orc_server_user", #后台管理库用户

"MySQLOrchestratorPassword": "server_passwd", #后台管理库密码

"MySQLHostnameResolveMethod": "@@report_host",#解析主机名方式

"DetectClusterAliasQuery": "SELECT concat(@@report_host,':',@@port)", #集群别名

配置参数解释:Orchestrator配置说明

启动

/usr/local/orchestrator/orchestrator -config=/usr/local/orchestrator/orchestrator.conf.json http &

查看端口

netstat -nltp|grep 3000tcp6 0 0 :::3000 :::* LISTEN 574969/orchestrator

命令行注册集群

orchestrator -config=/usr/local/orchestrator/orchestrator.conf.json -c discover -i 192.168.1.2:3306

命令行查看集群

orchestrator -c clusters

通过web访问

页面中discover

4f22e12a750d42c517398c50ad890863.png

9e12881acf7686084da51857dc928f45.png

查看集群架构

6ddde63e662ddd2cf69347770779af19.png

拖动更改架构

8d525686a58efe5074ab32276b2d5458.png

45e04bc6e1b8e413f0cb67fac355a797.png

476367211fc9b7afe40f6d5a70bff9a7.png

49bb83289b064f79e563a4cc3fccb952.png

65e1aa3ad13bc2deed99e5a85445c07d.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值