简体   繁体   English

Maxscale:结合readwritesplit和schemarouter

[英]Maxscale: combine readwritesplit and schemarouter

I'm trying to setup maxscale to use schemarouter and readwritesplit. 我正在尝试设置maxscale以使用schemarouter和readwritesplit。 I have many shards for my mysql database. 我的mysql数据库有很多碎片。 Each shard has a slave So the idea is to use one schemarouter on masters and one on slaves to proxy all shards. 每个分片都有一个从属,因此其想法是在主服务器上使用一个schemarouter,在从属服务器上使用一个schemarouter代理所有分片。 Then use These 2 services in readwritesplit. 然后在readwritesplit中使用这2个服务。

This cause the following issue:
2017-02-10 14:57:48   error  : Failure loading users data from backend [10.161.66.145:4009] for service [Splitter Service]. MySQL error 2013, Lost connection to MySQL server at 'handshake: waiting for inital communication packet', system error: 110
2017-02-10 14:57:52   error  : Failure loading users data from backend [10.161.66.145:4008] for service [Splitter Service]. MySQL error 2013, Lost connection to MySQL server at 'reading authorization packet', system error: 110
2017-02-10 14:57:52   error  : Unable to get user data from backend database for service [Splitter Service]. Failed to connect to any of the backend databases.

Any help would be nice. 你能帮忙的话,我会很高兴。

My schemarouter are both working fine. 我的schemarouter都工作正常。 Here is the readwritesplit config: 这是readwritesplit配置:

[max_ro]
type=server
address=10.10.10.10
port=4009
protocol=MySQLBackend

[max_rw]
type=server
address=10.10.10.10
port=4008
protocol=MySQLBackend

[Splitter Service]
type=service
router=readwritesplit
servers=max_ro,max_rw
user=maxscale
passwd=maxscale

[Splitter Listener]
type=listener
service=Splitter Service
protocol=MySQLClient
port=4010

Thanks 谢谢

The errors are most likely caused by the fact that the readwritesplit services have not yet started. 该错误很可能是由于readsplitsplit服务尚未启动而引起的。 There is a bug report about this behavior on the MariaDB Jira . MariaDB Jira上有关于此行为的错误报告。

If the sharding service works and no more errors are logged once MaxScale has started then everything is working as expected and the errors can be ignored as is described in this bug report . 如果MaxScale启动后,分片服务正常工作,并且不再记录任何错误,则说明一切正常,并且可以按照此错误报告中的说明忽略错误

Another way to solve this problem would be to separate the configuration into two parts and use separate MaxScale instances; 解决此问题的另一种方法是将配置分为两部分,并使用单独的MaxScale实例。 one for the sharding service and another one for the read-write splitting service. 一个用于分片服务,另一个用于读写拆分服务。 This does add an extra layer of complexity as two services need to be started instead of one. 这确实增加了一层额外的复杂性,因为需要启动两个服务而不是一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM