[MXS-563] Maxscale fails to start Created: 2016-01-31  Updated: 2016-02-29  Resolved: 2016-02-29

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: None
Fix Version/s: 1.4.0

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

CentOS 7


Attachments: File maxscale.cnf    
Issue Links:
Duplicate
is duplicated by MXS-589 Password encryption looks for the fil... Closed

 Description   

Installed MaxScale 1.3 but when attemping to start it fails. In the log file I see:

MariaDB Corporation MaxScale /var/log/maxscale/maxscale1.log Sun Jan 31 21:20:18 2016
-----------------------------------------------------------------------
2016-01-31 21:20:18 notice : Configuration file: /etc/maxscale.cnf
2016-01-31 21:20:18 notice : Log directory: /var/log/maxscale
2016-01-31 21:20:18 notice : Data directory: /var/lib/maxscale/data
2016-01-31 21:20:18 notice : Module directory: /usr/lib64/maxscale
2016-01-31 21:20:18 notice : Service cache: /var/cache/maxscale
2016-01-31 21:20:18 notice : Initialise CLI router module V1.0.0.
2016-01-31 21:20:18 notice : Loaded module cli: V1.0.0 from /usr/lib64/maxscale/libcli.so
2016-01-31 21:20:18 notice : Initialise debug CLI router module V1.1.1.
2016-01-31 21:20:18 notice : Loaded module debugcli: V1.1.1 from /usr/lib64/maxscale/libdebugcli.so
2016-01-31 21:20:18 notice : Initializing statemend-based read/write split router module.
2016-01-31 21:20:18 notice : Loaded module readwritesplit: V1.0.2 from /usr/lib64/maxscale/libreadwritesplit.so
2016-01-31 21:20:18 notice : Loaded module qlafilter: V1.1.1 from /usr/lib64/maxscale/libqlafilter.so
2016-01-31 21:20:18 notice : Loaded module regexfilter: V1.1.0 from /usr/lib64/maxscale/libregexfilter.so
2016-01-31 21:20:18 notice : Initialise the MySQL Galera Monitor module V2.0.0.
2016-01-31 21:20:18 notice : Loaded module galeramon: V2.0.0 from /usr/lib64/maxscale/libgaleramon.so
2016-01-31 21:20:18 error : Galera Monitor: Failed to connect to server dbc01-bhs(10.3.10.80:3306) when checking monitor user credentials and permissions.
2016-01-31 21:20:18 notice : MariaDB Corporation MaxScale beta-1.3.0 (C) MariaDB Corporation Ab 2013-2015
2016-01-31 21:20:18 notice : MaxScale is running in process 925
2016-01-31 21:20:18 error : RWSplit Service: Failed to connect to server dbc03-bhs(10.3.10.82:3306) when checking authentication user credentials and permissions: 1045 Access denied for user 'dlb03_bhs'@'10.3.10.86' (using password: YES)
2016-01-31 21:20:18 error : RWSplit Service: Inadequate user permissions for service. Service not started.
2016-01-31 21:20:18 error : Failed to start service 'RWSplit Service'.
2016-01-31 21:20:18 notice : Loaded module telnetd: V1.0.1 from /usr/lib64/maxscale/libtelnetd.so
2016-01-31 21:20:18 notice : Listening telnet connections at 127.0.0.1:4442
2016-01-31 21:20:18 notice : Loaded module maxscaled: V1.0.0 from /usr/lib64/maxscale/libmaxscaled.so
2016-01-31 21:20:18 notice : Listening maxscale connections at 127.0.0.1:6603
2016-01-31 21:20:18 notice : Started MaxScale log flusher.
2016-01-31 21:20:18 notice : MaxScale started with 4 server threads.
2016-01-31 21:20:18 error : There are no cluster members

Though if I attempt to connect from the command line it works fine:

[root@dlb01 /]# mysql -h 10.3.10.82 -u dlb03_bhs -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 400
Server version: 10.1.11-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

What could be wrong ?



 Comments   
Comment by INNOVOT [ 2016-01-31 ]

Used the following to create the grants:

create user 'dlb01_bhs'@'10.3.10.86' identified by '<SECRET>';
grant SELECT on mysql.user to 'dlb01_bhs'@'10.3.10.86';
GRANT SELECT ON mysql.db TO 'dlb01_bhs'@'10.3.10.86';
create user 'dlb02_bhs'@'10.3.10.86' identified by '<SECRET>';
grant SELECT on mysql.user to 'dlb02_bhs'@'10.3.10.86';
GRANT SELECT ON mysql.db TO 'dlb02_bhs'@'10.3.10.86';
create user 'dlb03_bhs'@'10.3.10.86' identified by '<SECRET>';
grant SELECT on mysql.user to 'dlb03_bhs'@'10.3.10.86';
GRANT SELECT ON mysql.db TO 'dlb03_bhs'@'10.3.10.86';

Comment by markus makela [ 2016-02-01 ]

Looking at the grants alone, it seems the SHOW DATABASES permission is missing. For more details, read the section about creating database users in the MaxScale Tutorial.

The error log does state that the connection was actively refused which suggests that there's something wrong with the grants. I would make sure that MaxScale's host is 10.3.10.86 and that the grants are given to the right host.

Comment by INNOVOT [ 2016-02-01 ]

Hello Markus,

I created a brand new user according to that tutorial:

create user 'maxscale_bhs'@'10.3.10.86' identified by '<secret>';
grant select on mysql.user to 'maxscale_bhs'@'10.3.10.86';
grant select on mysql.db TO 'maxscale_bhs'@'10.3.10.86';
grant show databases on . TO 'maxscale_bhs'@'10.3.10.86';
grant replication slave on . to 'maxscale_bhs'@'10.3.10.86';
grant replication client on . to 'maxscale_bhs'@'10.3.10.86';

and the problem persists. Thank you.

Comment by markus makela [ 2016-02-01 ]

Can you attach the maxscale.cnf file you used?

The services and monitors needs to be configured with user=maxscale_bhs with the appropriate password. In addition to this, when connecting from the machine MaxScale is on to all databases, the SELECT USER() output must match maxscale_bhs@10.3.10.86.

Comment by INNOVOT [ 2016-02-01 ]

maxscale.cnf

As requested.

Comment by markus makela [ 2016-02-01 ]

The configuration looks correct and if the maxscale_bhs user has the appropriate grants, it should work. Just to be sure, can you confirm that from the mysql command line doing a SELECT USER() shows the right user and hostname?

Comment by INNOVOT [ 2016-02-01 ]

[root@dlb01 /]# mysql -u maxscale_bhs -h 10.3.10.80 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5848
Server version: 10.1.11-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select user();
-------------------------

user()

-------------------------

maxscale_bhs@10.3.10.86

-------------------------
1 row in set (0.00 sec)

Comment by markus makela [ 2016-02-04 ]

Are you using password encryption? I'm thinking that there's a possibility that the password is being decrypted into the wrong password.

Comment by INNOVOT [ 2016-02-04 ]

No, the passwords are clear text in maxscale.cnf. Should add that this configuration is being used on our other site without any issue though using different username/password combination. The six nodes are all within the same Galera cluster. Three at primary site and three at secondary. Its only this one, the secondary, that is failing.

Comment by Yuyu Liu [ 2016-02-18 ]

I think this because in Encrypting Passwords, the document said the password key stores in /var/lib/maxscale, and the sample command shows the same path. But the real path of maxscale used is /var/lib/maxscale/data. If the .secrets file moved to /var/lib/maxscale/data, it would be ok.

Comment by markus makela [ 2016-02-29 ]

This was caused by a hard-coded path in maxkeys which used /var/lib/maxscale/ as the destination instead of using the newer, dynamic path resolution functionality.

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