[MXS-1028] SchemaRouter cannot route to services running in the same instance of MaxScale Created: 2016-11-28  Updated: 2017-03-06  Resolved: 2017-02-07

Status: Closed
Project: MariaDB MaxScale
Component/s: schemarouter
Affects Version/s: 2.0.2
Fix Version/s: 2.1.0

Type: Bug Priority: Major
Reporter: Wade Rossmann Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

Centos7


Attachments: File maxscale.cnf     Text File maxscale.log    
Issue Links:
Relates
relates to MXS-1167 MaxScale tries to connect to internal... Closed

 Description   

My situation is that I've got a number of Master-Slave pairs that I would like to balance with `readconnroute` and then aggregate all of those within a `schemarouter` so as to present a single service entry point to my environment.

However, while `readconnroute` and `schemarouter` work individually I get the following error when using them in tandem:

error : [main-schemarouter] Failed to connect to server 'rtr-foo' (127.0.0.1:33001) when checking authentication user credentials and permissions: 2013 Lost connection to MySQL server at 'handshake: waiting for inital communication packet', system error: 110

I've done some basic verification that the service is running on :33001 and accepts connections via the mysql CLI.

I was advised by markusjm on IRC [#maria@freenode] to file this as a bug.

I've attached the relevant config and the full log of the invocation.



 Comments   
Comment by Wade Rossmann [ 2016-11-29 ]

Per Markus' suggestion I've set up a second Maxadmin process that runs only the `schemarouter` service and connects to the `readconnroute` listeners from the first, and this works as expected. Though I'd prefer to have just the one service this will suffice for now.

Comment by markus makela [ 2016-11-29 ]

I think one reason why this fails is that the database user authentication fails.

2016-11-29 20:54:14   error  : [SchemaRouter Router] Failed to connect to server 'rw1' (127.0.0.1:4006) when checking authentication user credentials and permissions: 2013 Lost connection to MySQL server at 'handshake: waiting for inital communication packet', system error: 110
2016-11-29 20:54:17   error  : Failure loading users data from backend [127.0.0.1:4006] for service [SchemaRouter Router]. MySQL error 2013, Lost connection to MySQL server at 'handshake: waiting for inital communication packet', system error: 110

Connecting to the same process with the connector seems to cause this failure even if multiple threads are available.

However, I'm able to load the users if I add one actual server to the list of servers used by the schemarouter service. With the following configuration, I was able to successfully start MaxScale and connect to it.

[maxscale]
threads=4
 
[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server1,server2
user=maxuser
passwd=maxpwd
monitor_interval=1000
 
[RW Split Router]
type=service
router=readconnroute
servers=server1,server2
user=maxuser
password=maxpwd
 
[SchemaRouter Router]
type=service
router=schemarouter
servers=rw1,server1
user=maxuser
passwd=maxpwd
ignore_databases_regex=.*
 
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
 
[SchemaRouter Listener]
type=listener
service=SchemaRouter Router
protocol=MySQLClient
port=4010
 
# These are the real servers
[server1]
type=server
address=127.0.0.1
port=3000
protocol=MySQLBackend
 
[server2]
type=server
address=127.0.0.1
port=3001
protocol=MySQLBackend
 
# This is the RW Split Router service
[rw1]
type=server
address=127.0.0.1
port=4006
protocol=MySQLBackend
 
[CLI]
type=service
router=cli
 
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
socket=default

Comment by markus makela [ 2016-11-30 ]

On further inspection, the only problem is the fact that the schemarouter tries to verify that the service user credentials are valid at startup which is done in a single thread. This prevents all responses from internal services as the system hasn't start up.

In the upcoming 2.1 version of MaxScale, this should be avoidable with the new skip_permission_checks global option.

Comment by Johan Wikman [ 2017-02-07 ]

Closing now as this should be doable using the skip_permission_checks option in 2.1.0.

If that proves not to be the case, please reopen this or create a new bug-report.

Generated at Thu Feb 08 04:03:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.