ITPub博客

首页 > 数据库 > MySQL > MySQL高可用工具Orchestrator系列一:单节点模式安装

MySQL高可用工具Orchestrator系列一:单节点模式安装

原创 MySQL 作者:沃趣科技 时间:2019-10-30 09:54:03 0 删除 编辑

      背  景

MySQL高可用方案有很多 种,常见的有:keepalived、MHA、Galera、MGR、Orchestrator、replication-manager等。本系列将介绍在GitHub被使用的Orchestrator方案。本篇文章先介绍最基础的单节点模式的安装。

      环  境

orchestrator机器:10.10.30.146

orchestrator后端元数据库MySQL:10.10.30.146

目标监控数据库:10.10.30.129:3306

       安装orchestrator元数据库MySQL

安装MySQL的步骤省略,和常规安装MySQL一样。

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

CREATE DATABASE IF NOT EXISTS 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.0-linux-amd64.tar.gz。

https://github.com/github/orchestrator/releases解压orchestrator安装包。

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

将/usr/local/orchestrator/orchestrator-sample.conf.json移动到/etc下,并命名为orchestrator.conf.json。

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

      目标监控数据库授权

在需要监控的目标数据库上进行授权。这里目标数据库是:10.10.30.129: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.146,将密码改为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",

      启动orchestrator 

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

web端访问地址10.10.30.146:3000。页面效果如下:


|  作者简介

韩杰  沃趣科技高级数据库工程师

专注MySQL数据库三年,精通MySQL体系结构,数据库优化,trouble shooting。服务过多家银行客户,熟悉银行业务及系统下数据库不同架构使用场景。熟悉MySQL主从复制原理,及应用的各种高可用场景。


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28218939/viewspace-2661897/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
杭州沃趣科技股份有限公司创建于2012年(股票代码:839849),是一家专注为企业用户提供基于高性能、高可用、可扩展的开放数据库云平台解决方案的国产厂商。公司创始团队为原阿里巴巴数据库技术团队核心骨干,凭借丰富的研发及运维经验,为行业客户提供数据库云产品及软硬件一体化解决方案。

注册时间:2016-07-18

  • 博文量
    290
  • 访问量
    994443