zoukankan      html  css  js  c++  java
  • orchestrator的安装和配置

    介绍

    在MySQL高可用架构中,目前使用比较多的是Percona的PXC,Galera以及MySQL 5.7之后的MGR等,其他的还有的MHA,今天介绍另一个比较好用的MySQL高可用复制管理工具:Orchestrator(orch)。

    Orchestrator(orch):go编写的MySQL高可用性和复制拓扑管理工具,支持复制拓扑结构的调整,自动故障转移和手动主从切换等。后端数据库用MySQL或SQLite存储元数据,并提供Web界面展示MySQL复制的拓扑关系及状态,通过Web可更改MySQL实例的复制关系和部分配置信息,同时也提供命令行和api接口,方便运维管理。相对比MHA来看最重要的是解决了管理节点的单点问题,其通过raft协议保证本身的高可用。GitHub的一部分管理也在用该工具进行管理。关于Orchestrator更详细的介绍可以看Github的介绍,大致的特点有:

    ① 自动发现MySQL的复制拓扑,并且在web上展示。

    ② 重构复制关系,可以在web进行拖图来进行复制关系变更。

    ③ 检测主异常,并可以自动或手动恢复,通过Hooks进行自定义脚本。

    ④ 支持命令行和web界面管理复制。

    部署如下

    试验环境

    mysql服务器
    orchestrator & master:10.72.16.112
    slave1:10.72.16.50
    slave2:10.72.16.59

    1、安装orchestrator

    orchestrator-cli-3.0.11-1.x86_64.rpm安装程序需要依赖包,安装依赖包jq-1.5、oniguruma-5.9.5

    并且最好在redhat 7的操作系统安装。

    yum install orchestrator-3.1.2-1.x86_64.rpm jq-1.5-1.el7.x86_64.rpm oniguruma-5.9.5-3.el7.x86_64.rpm
    安装完成后,目录在/usr/local/orchestrator

    2、配置主机解析

    [root@hchtest4 ~]# cat /etc/hosts
    10.72.16.112 hchtest4
    10.72.16.50 hchtest3
    10.72.16.59  hchtest-elk

    3、3台MySQL主从复制省略

    4、orchestrator的后台管理端数据库权限配置(112上执行)

    在orch后端数据库112上:
    
    CREATE DATABASE IF NOT EXISTS orchestrator;
    CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'hch123';
    GRANT ALL PRIVILEGES ON orchestrator.* TO 'root'@'%';

    5、3台orch管理的数据库集群上,权限及数据库执行(3台数据库执行)

    CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'hch123';
    GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orchestrator'@'%';
    GRANT SELECT ON mysql.slave_master_info TO 'orchestrator'@'%';
    CREATE DATABASE IF NOT EXISTS meta;
    GRANT SELECT ON meta.* TO 'orchestrator'@'%';

    6、修改配置文件

    cp /usr/local/orchestrator/conf/orchestrator-sample.conf.json /etc/orchestrator.conf.json
    
    vim /etc/orchestrator.conf.json
    #被管理MySQL数据库的用户权限数据库账号密码
      "MySQLTopologyUser": "root",
      "MySQLTopologyPassword": "hch123", 
    
    #orchestrator管理后台数据库账号密码
      "MySQLOrchestratorHost": "10.72.16.112",
      "MySQLOrchestratorPort": 3306,
      "MySQLOrchestratorDatabase": "orchestrator",
      "MySQLOrchestratorUser": "orchestrator",
      "MySQLOrchestratorPassword": "hch123",
      "DiscoverByShowSlaveHosts": false, 

    DiscoverByShowSlaveHosts": ture 这种情况下,必须配置report_host

    $ vim /etc/my_3306.cnf

    report_host=192.168.225.128 //ip为自身的ip

    说明:不加report_host ,show slave hosts 不会显示host,会导致程序报错的

    report_host为只读参数,必须重启才可生效

    说明:

    DiscoverByShowSlaveHosts": false 也可以,这样就不需要设置report_host了

    更多参数说明

    7、创建命令软链接

    ln -s /usr/local/orchestrator/orchestrator /usr/bin/

    8、启动orchestrator

    orchestrator --debug --config=/etc/orchestrator.conf.json http
     
    查看端口
    [root@orchestrator ~]# netstat -tnpl |grep :3000
    tcp6       0      0 :::3000                 :::*                    LISTEN      6084/orchestrator

    8、命令行发现:

    orchestrator -c discover -i 10.72.16.50
    orchestrator -c discover -i 10.72.16.59
    orchestrator -c clusters        ----查看集群

    9、访问网页

    http://10.72.16.51:3000

    10、Orchestrator的使用

    参考

    Orchestrator部署配置 - qq_26496673的博客 - CSDN博客 https://blog.csdn.net/qq_26496673/article/details/82810671

    MySQL高可用复制管理工具 —— Orchestrator介绍 - jyzhou - 博客园 https://www.cnblogs.com/zhoujinyi/p/10387581.html

    MySQL高可用复制管理工具 —— Orchestrator使用 - jyzhou - 博客园 https://www.cnblogs.com/zhoujinyi/p/10394389.html

    orchestrator 安装?参数?VIP脚本? - wangxin3618的博客 - CSDN博客 https://blog.csdn.net/wangxin3618/article/details/97013376

    orchestrator简介 - fearless11的博客 - CSDN博客 https://blog.csdn.net/fearless11/article/details/77170764 

    Orchestrator管理mysql复制 - 个人文章 - SegmentFault 思否 https://segmentfault.com/a/1190000017838535?utm_source=tag-newest

    MySQL复制拓扑管理工具Orchestrator - 简书 https://www.jianshu.com/p/62e95a131028

    MySQL高可用探索之orchestrator | Yangtze River's blog https://riverdba.github.io/2019/03/19/orchestrator/

  • 相关阅读:
    在Linux CentOS 6.6上安装Python 2.7.9
    CentOS yum 安装LAMP PHP5.4版本
    yum 安装php环境
    如何在Eclipse配置PyDev插件
    vagrant使用小结
    虚拟机下安装CentOS6.5系统教程
    python
    library cahce pin
    利用分析函数删除重复数据
    组合索引避免索引扫描后在过滤
  • 原文地址:https://www.cnblogs.com/paul8339/p/11424210.html
Copyright © 2011-2022 走看看