我2个服务器(srv50/51),它们中的一个 是主站和第二个是从配置,Maxscale正在写与router_options =主站(主/从复制)从和听众停止
这里我的配置文件/etc/maxscale.cnf的配置:
[Read-Only Service]
type=service
router=readconnroute
servers=server50, server51
user=YYYYYYYYYYYYY
passwd=XXXXXXXXXXXXXX
router_options=slave
[Write-Only Service]
type=service
router=readconnroute
servers=server50, server51
user=YYYYYYYYYYYYY
passwd=XXXXXXXXXXXXXX
router_options=master
[Read-Only Listener]
type=listener
service=Read-Only Service
protocol=MySQLClient
port=4008
[Write-Only Listener]
type=listener
service=Write-Only Service
protocol=MySQLClient
port=4009
正如我understool的router_options看看谁是主人和发送文字查询到主
Maxscale(通过maxadmin)似乎发现2服和下站在女巫一个是站长:
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server | Address | Port | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
server51 | 192.168.0.51 | 3306 | 0 | Slave, Running
server50 | 192.168.0.50 | 3306 | 0 | Master, Running
-------------------+-----------------+-------+-------------+--------------------
但是即使我在MySQL的本地连接我Maxscale只写监听端口(4009),侦听器都处于停止模式下,是正常的吗?
MaxScale> list listeners
Listeners.
---------------------+--------------------+-----------------+-------+--------
Service Name | Protocol Module | Address | Port | State
---------------------+--------------------+-----------------+-------+--------
Read-Only Service | MySQLClient | * | 4008 | Stopped
Write-Only Service | MySQLClient | * | 4009 | Stopped
MaxAdmin Service | maxscaled | * | 6603 | Running
---------------------+--------------------+-----------------+-------+--------
我已经尝试创建srv51(从)一个数据库,它只是在srv51创建,而不是在srv50。
我的配置有问题吗?这很奇怪,因为它不是我的第一个集群,而在其他集群上,所有写入的都是主集群(但侦听器正在运行)。我不明白“router_options = master”的含义吗?如何开始听众?我prefere保持51写列表检测拓扑变化
===== UPDATE =====
看后日志文件/var/log/maxscale/maxscale1.log 我发现我的显示器用户没有正确的密码:
[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server50, server51
user=MONITOR
passwd=MONITOR_PASS
monitor_interval=10000
我校正了用户密码并重新启动maxscale,现在一切正在运行:
MaxScale> list listeners
Listeners.
---------------------+--------------------+-----------------+-------+--------
Service Name | Protocol Module | Address | Port | State
---------------------+--------------------+-----------------+-------+--------
Read-Only Service | MySQLClient | * | 4008 | Running
Write-Only Service | MySQLClient | * | 4009 | Running
MaxAdmin Service | maxscaled | * | 6603 | Running
---------------------+--------------------+-----------------+-------+--------
但写查询奴隶仍在进行,而不是在主