mysql-router

场景: mysql-router:mysql-router-8.0.11-linux-glibc2.12-x86-64bit.tar.gz
           MySQL-DB: 1主1从
IP:
192.168.221.120  master
192.168.221.121  salve
192.168.221.122  mysql-router
目的:测试MySQL Router的读写分离效果
==================================================
MySQL Router的配置文件:
[root@proxy mysql]# vi /etc/mysql-route/mysqlrouter.conf
[DEFAULT]
logging_folder = /var/log/mysql-route
plugin_folder = /usr/local/mysqlrouter/lib/mysqlrouter
config_folder = /etc/mysql-route
runtime_folder = /var/run/

[logger]
level = INFO

[routing:read_write]
bind_address=192.168.221.122
bind_port = 7001
connect_timeout = 3
max_connections = 1024
mode = read-write
destinations = 192.168.221.120:3306


[routing:read_only]
bind_address=192.168.221.122
bind_port = 7002
connect_timeout = 3
max_connections = 1024
destinations = 192.168.221.121:3306
mode = read-only

[keepalive]
interval = 60

=================================================
测试结果:
利用端口7001  往测试表T2中写入数据
利用端口7002  同样可以往测试表T2中写入数据。
=================================================
问题:
不明白,既然做了路由规则,利用7002端口 写入数据的时候,应该报错误。为啥可以写入。
是因为配置文件有设置错误?还是有啥原因?
求解答!谢谢!
error-mysql-router-02.jpg error-mysql-router-01.jpg
已邀请:

要回复问题请先登录注册