mysql router 自動failover測試

來源:互聯網
上載者:User

標籤:

[[email protected] bin]# cat /etc/mysqlrouter/mysqlrouter.ini[DEFAULT]
#mkdir -p /var/log/mysql-routerlogging_folder = /var/log/mysql-router plugin_folder = /usr/local/mysql-router/lib/mysqlrouterruntime_folder = /usr/local/mysql-router[logger]# 定義日誌等級level = INFO# 一個高可用的標籤[routing:failover]bind_address = 0.0.0.0bind_port = 7001max_connections = 1024# 目前就支援兩種 : read-write 和 read-only# read-write:用於高可用,用於可讀可寫# read-only:用於負載平衡,唯讀mode = read-write# 實際轉寄的地址# 第一個socket如果可用,就一直會使用第一個# 如果第一個socket無法串連了,才會串連到第二個socketdestinations = 10.24.220.70:3306, 10.169.214.33:3306
起動:


[[email protected] bin]# ./mysqlrouter -c /etc/mysqlrouter/mysqlrouter.ini &[1] 1203[[email protected] bin]# Logging to /var/log/mysql-router/mysqlrouter.log^C[[email protected] bin]# cat Logging to /var/log/mysql-router/mysqlrouter.logcat: Logging: No such file or directorycat: to: No such file or directory2016-05-16 22:13:02 INFO [7f2cb44a4700] [routing:failover] listening on 0.0.0.0:7001; read-write2016-05-16 22:13:23 INFO [7f13125a2700] [routing:failover] listening on 0.0.0.0:7001; read-write2016-05-16 22:16:23 INFO [7f2816b4a700] [routing:failover] listening on 0.0.0.0:7001; read-write2016-05-16 22:23:51 INFO [7fec2b5f4700] [routing:failover] listening on 0.0.0.0:7001; read-write2016-05-16 22:24:04 INFO [7ff971019700] [routing:failover] listening on 0.0.0.0:7001; read-write[[email protected] bin]# mysql -u root -p123 -h 172.18.14.68^CP 7002 -e "show variables like ‘server_id‘";

 

 

 

[[email protected] bin]# mysql -u root -p -h 10.169.216.172 -P 7001 -e "show variables like ‘server_id‘";          Enter password: +---------------+-------+| Variable_name | Value |+---------------+-------+| server_id     | 101   |+---------------+-------+[[email protected] bin]# mysql -u root -p -h 10.169.216.172 -P 7001 -e "show variables like ‘server_id‘";Enter password: +---------------+-------+| Variable_name | Value |+---------------+-------+| server_id     | 101   |+---------------+-------+


server1:
service mysq.server stop


[[email protected] bin]# mysql -u root -p -h 10.169.216.172 -P 7001 -e "show variables like ‘server_id‘";Enter password: +---------------+-------+| Variable_name | Value |+---------------+-------+| server_id | 102 |+---------------+-------+[[email protected] bin]# mysql -u root -p -h 10.169.216.172 -P 7001 -e "show variables like ‘server_id‘";Enter password: +---------------+-------+| Variable_name | Value |+---------------+-------+| server_id | 102 |+---------------+-------+

 

mysql router 自動failover測試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.