• Mysql router 中间件配置 Alvin


    mysql router 解决高可用,读写分离,负载均衡

    1. 下载mysql-router

    [root@VM-0-16-centos /]# cd /usr/local/

    [root@VM-0-16-centos local]# wget https://dev.mysql.com/get/Downloads/MySQL-Router/mysql-router-8.0.18-linux-glibc2.12-x86_64.tar.xz

    [root@VM-0-16-centos local]# tar -xvf mysql-router-8.0.18-linux-glibc2.12-x86_64.tar.xz

    [root@VM-0-16-centos local]# mv mysql-router-8.0.18-linux-glibc2.12-x86_64 mysql-router

    [root@VM-0-16-centos local]# cd mysql-router/

    [root@VM-0-16-centos mysql-router]# vim mysqlrouter.conf

     2.添加配置文件 mysqlrouter.conf

     3.修改配置文件 

    [root@VM-0-16-centos mysql-router]# vim mysqlrouter.conf
    [logger]
    level = INFO
    
    [routing:basic_failover]
    bind_address = 0.0.0.0
    bind_port = 7001
    mode = read-write
    destinations = mysql-1:3306,mysql-2:3306,mysql-3:3306
    routing_strategy = round-robin
    
    [routing:balancing]
    bind_address = 0.0.0.0
    bind_port = 7002
    mode = read-write
    destinations = mysql-1:3306,mysql-2:3306,mysql-3:3306
    routing_strategy = first-available

    4.启动mysql-router

    /usr/local/mysql-router/bin/mysqlrouter -c /usr/local/mysql-router/mysqlrouter.conf &

    5.查看是否启动成功

    [root@VM-0-16-centos sh]# netstat -tnlp

    看到刚才配置的端口已经启动, 恭喜你配置成功

    现在可以把3306端口改成7001或者7002访问了

  • 相关阅读:
    黑胶100
    界面滑动+ztree
    Linux下Java获取本机IP地址
    垂直对齐vertical-align:top
    针对jquery获取表单数据并且迭代方式
    js传递参数中文乱码
    前端开发资源库
    webpack加载器(Loaders)
    webpack基础知识点
    webpack操作基础
  • 原文地址:https://www.cnblogs.com/fxd980519/p/16195134.html
Copyright © 2020-2023  润新知