Configuration file:
/etc/mysqlrouter/mysqlrouter.ini
[Default]logging_folder= /var/log/mysql-Routerplugin_folder=/usr/local/mysql-router/lib/Mysqlrouterruntime_folder=/usr/local/mysql-router[logger]# defining log levels Level=info[routing:balancing]bind_address=0.0.0.0Bind_port=7002max_connections=1024x768Mode= read-onlydestinations=10.24.220.70:3306,10.169.214.33:3306
Starting:
./mysqlrouter-c/etc/mysqlrouter/mysqlrouter.ini &
Testing: Automatic load Balancing
MySQL router installed on monitor,
10.169.216.172 is one of the network cards
[Email protected] bin]# mysql-u root-p-H10.169.216.172-P7002-E"Show variables like ' server_id '"; Enter Password:+---------------+-------+| variable_name | Value |+---------------+-------+| server_id |101|+---------------+-------+[[email protected] bin]# MySQL-U root-p-H10.169.216.172-P7002-E"Show variables like ' server_id '"; Enter Password:+---------------+-------+| variable_name | Value |+---------------+-------+| server_id |102|+---------------+-------+[[email protected] bin]# MySQL-U root-p-H10.169.216.172-P7002-E"Show variables like ' server_id '"; Enter Password:+---------------+-------+| variable_name | Value |+---------------+-------+| server_id |101|+---------------+-------+[[email protected] bin]# MySQL-U root-p-H10.169.216.172-P7002-E"Show variables like ' server_id '"; Enter Password:+---------------+-------+| variable_name | Value |+---------------+-------+| server_id |102|+---------------+-------+
MYSQL Router Automatic load Balancing