replication-manager 搭建

Posted 2woods

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了replication-manager 搭建相关的知识,希望对你有一定的参考价值。

replication-manager 搭建

介绍

replication-manager 主要用于mysql主从结构的监控和主从切换.

安装

vi /etc/yum.repos.d/signal18.repo
\\加入一下内容
[signal18]
name=Signal18 repositories
baseurl=http://repo.signal18.io/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
  • yum安装
[[email protected]_17:58:57 /] 
#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.99.210:3508,192.168.99.211:3508,192.168.99.212:3508"
db-servers-prefered-master = "192.168.99.210:3508"
db-servers-credential = "wyz:****"
replication-credential = "repl:re****"
failover-mode = "manual"
proxysql=true
proxysql-server="192.168.99.210"
proxysql-port=6033
proxysql-admin-port=6032
proxysql-writer-hostgroup=10
proxysql-reader-hostgroup=11
proxysql-user="adfz"
proxysql-password="****"
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"
[[email protected]_18:34:16 /etc/replication-manager] 

启动

#/etc/init.d/replication-manager start
#netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 192.168.99.210:8301     0.0.0.0:*               LISTEN      11216/consul       
tcp        0      0 0.0.0.0:6032            0.0.0.0:*               LISTEN      51847/proxysql     
tcp        0      0 0.0.0.0:6033            0.0.0.0:*               LISTEN      51847/proxysql     
tcp        0      0 0.0.0.0:23507           0.0.0.0:*               LISTEN      11527/mysqld       
tcp        0      0 0.0.0.0:3507            0.0.0.0:*               LISTEN      11527/mysqld       
tcp        0      0 127.0.0.1:8500          0.0.0.0:*               LISTEN      11216/consul       
tcp        0      0 0.0.0.0:3508            0.0.0.0:*               LISTEN      93705/mysqld       
tcp        0      0 127.0.0.1:8600          0.0.0.0:*               LISTEN      11216/consul       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2991/master        
tcp        0      0 0.0.0.0:3322            0.0.0.0:*               LISTEN      2381/sshd          
tcp6       0      0 :::10001                :::*                    LISTEN      103773/replication-
tcp6       0      0 :::3322                 :::*                    LISTEN      2381/sshd          
[[email protected]_18:35:19 /etc/replication-manager] 

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

技术分享图片

主从切换

  • 切换前(点击界面中:switchover)
    技术分享图片
    技术分享图片

  • 切换后
    技术分享图片
    技术分享图片





以上是关于replication-manager 搭建的主要内容,如果未能解决你的问题,请参考以下文章

(转)mac 搭建基于RTMP的本地Nginx服务器报错homebrew/nginx was deprecated. This tap is now empty as all its form(代码片

cdh大数据平台环境搭建片

磁力片只会搭建?这些脑洞STEAM玩法比新玩具还香!

MHA集群(gtid复制)和vip漂移

Spark集群搭建

一个简单的时间片轮转多道程序内核操作系统工作流程