$ cd /usr/local/router/bin/ $ ./mysqlrouter --config=/etc/mysqlrouter.conf 2017-12-21 16:44:43 INFO [7fef60055700] keepalive started with interval 60 2017-12-21 16:44:43 INFO [7fef60055700] keepalive 2017-12-21 16:44:43 INFO [7fef57fff700] [routing:read_write] started: listening on 192.168.0.170:7001; read-write 2017-12-21 16:44:43 INFO [7fef5f854700] [routing:read_only] started: listening on 192.168.0.170:7002; read-only 2017-12-21 16:45:43 INFO [7fef60055700] keepalive 2017-12-21 16:46:43 INFO [7fef60055700] keepalive
$ mysql -h 10.0.88.171 -P7002 -uroot -p -e "show variables like 'hostname';" Enter password: +---------------+---------+ | Variable_name | Value | +---------------+---------+ | hostname | mysql02 | +---------------+---------+ $ mysql -h 10.0.88.171 -P7001 -uroot -p -e "show variables like 'hostname';" Enter password: +---------------+---------+ | Variable_name | Value | +---------------+---------+ | hostname | mysql01 | +---------------+---------+