• MYSQL router 自动均衡负载


    配制文件:
    /etc/mysqlrouter/mysqlrouter.ini


    [DEFAULT] logging_folder
    = /var/log/mysql-router plugin_folder = /usr/local/mysql-router/lib/mysqlrouter runtime_folder = /usr/local/mysql-router [logger] # 定义日志等级 level = INFO [routing:balancing] bind_address = 0.0.0.0 bind_port = 7002 max_connections = 1024 mode = read-only destinations = 10.24.220.70:3306, 10.169.214.33:3306

     起动:

    ./mysqlrouter -c /etc/mysqlrouter/mysqlrouter.ini &

    测试:自动均衡负载

    mysql router 安装在monitor 上,
    10.169.216.172是其中一个网卡


    [root@monitor bin]# mysql -u root -p -h 10.169.216.172 -P 7002 -e "show variables like 'server_id'"; Enter password: +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 101 | +---------------+-------+ [root@monitor bin]# mysql -u root -p -h 10.169.216.172 -P 7002 -e "show variables like 'server_id'"; Enter password: +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 102 | +---------------+-------+ [root@monitor bin]# mysql -u root -p -h 10.169.216.172 -P 7002 -e "show variables like 'server_id'"; Enter password: +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 101 | +---------------+-------+ [root@monitor bin]# mysql -u root -p -h 10.169.216.172 -P 7002 -e "show variables like 'server_id'"; Enter password: +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 102 | +---------------+-------+
  • 相关阅读:
    Oracle exp/imp导出导入工具的使用
    导入导出数据语句小结
    改变一生的五句话
    给年轻工程师的十大忠告
    项目经理三步曲(项目经理成长版)
    写作、写程序的快乐和痛苦
    《Excel与VBA程序设计(mini版)》
    《3S新闻周刊》第三期发布: 解密Google Earth
    《Excel与VBA程序设计》进度(2006.3.8)
    Arc2Earth正式发布
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5499953.html
Copyright © 2020-2023  润新知