zoukankan      html  css  js  c++  java
  • Replication-Manager

    MYSQL5.7下搭建Replication-Manager

    环境说明

    在主机1,主机2,主机3上安装MySQL服务端和客户端。

    主机1

    主机2

    主机3

    操作系统

    CentOS7.4

    CentOS7.4

    CentOS7.4

    主机名

    mydb1

    mydb2

    mydb3

    IP

    192.168.1.101

    192.168.1.102

    192.168.1.103

    角色

    ProxySQL

    Replication-Manager

    数据库软件版本

    mysql5.7.22

    mysql5.7.22

    mysql5.7.22

    MySQL配置文件

    /app/mysqldata/3306/ my.cnf

    /app/mysqldata/3306/ my.cnf

    /app/mysqldata/3306/ my.cnf

    Replication-Manager配置文件

    /etc/replication-manager/config.toml

    安装包

    proxysql-1.4.13-1.1.el7.x86_64.rpm

    replication-manager-osc

    一. 主从复制配置

    MySQL5.7-GTID-mysqldump,xtrabackup搭建.txt

    大规模插入数据.txt

    安装ProxySQL

    做成快照Replication-Manager

    .开始配置Replication-Manager

    安装

    vi /etc/yum.repos.d/signal18.repo

    \加入一下内容

    [signal18]

    name=Signal18 repositories

    baseurl=http://repo.signal18.io/centos/$releasever/$basearch/

    gpgcheck=0

    enabled=1

     

    #yum install replication-manager-osc

    Loaded plugins: fastestmirror

    signal18                                                                        ....

    Installed:

      replication-manager-osc.x86_64 1532599358:2.0.1_6_g0ff0d-1

      Complete!

    配置

    vi /etc/replication-manager/config.toml

    [db3306]

    title = "db3306"

    db-servers-hosts = "192.168.1.101:3306,192.168.1.102:3306,192.168.1.103:3306"

    db-servers-prefered-master = "192.168.1.101:3306"

    db-servers-credential = "dba_user:msds007"

    replication-credential = "dba_user:msds007"

    failover-mode = "manual"

    proxysql=true

    proxysql-server="192.168.1.101"

    proxysql-port=6033

    proxysql-admin-port=6032

    proxysql-writer-hostgroup=1

    proxysql-reader-hostgroup=2

    proxysql-user="myuser"

    proxysql-password="myuser"

    proxysql-bootstrap=false

    [Default]

    monitoring-datadir = "/data/replication-manager"

    monitoring-sharedir = "/data/share_replication-manager"

    log-level=7

    log-file = "/var/log/replication-manager.log"

    replication-multi-master = false

    replication-multi-tier-slave = false

    failover-readonly-state = true

    http-server = true

    http-bind-address = "0.0.0.0"

    http-port = "10001"

     

    启动

    # /etc/init.d/replication-manager start

    # netstat -nltp

     

    在浏览器中打开:http://192.168.1.101:10001/

     

    点击Switchover可以进行切换

     

    能看到ProxySQL的统计

  • 相关阅读:
    bzoj 1853: [Scoi2010]幸运数字 容斥
    bzoj 3545&&3551: [ONTAK2010]Peaks &&加强版 平衡树&&并查集合并树&&主席树
    bzoj 2331: [SCOI2011]地板 插头DP
    bzoj 3669: [Noi2014]魔法森林 动态树
    bzoj 2734: [HNOI2012]集合选数 状压DP
    bzoj 3751: [NOIP2014]解方程 同余系枚举
    bzoj 2594: [Wc2006]水管局长数据加强版 动态树
    bzoj 2049: [Sdoi2008]Cave 洞穴勘测 动态树
    bzoj 2209: [Jsoi2011]括号序列 splay
    bzoj 1223: [HNOI2002]Kathy函数 数位DP 高精度
  • 原文地址:https://www.cnblogs.com/allenhu320/p/11339057.html
Copyright © 2011-2022 走看看