Failed to create new routing session. Couldn't find eligible candidate server.

1,832 views
Skip to first unread message

Rizal E S

unread,
Feb 3, 2015, 12:00:45 AM2/3/15
to maxs...@googlegroups.com
Hi all, 

I got error log, 

2015 02/03 11:54:12  Error : Failed to create new routing session. Couldn't find eligible candidate server. Freeing allocated resources.
2015 02/03 11:54:12  Error : Failed to create router client session. Freeing allocated resources.

and this is my MaxScale.cnf file

[maxscale]
threads=4

[Galera Service]
type=service
router=readconnroute
router_options=synced
servers=dbserver1
user=maxuser
passwd=maxpwd

[Debug Interface]
type=service
router=debugcli

[Galera Listener]
type=listener
service=Galera Service
protocol=MySQLClient
port=4306

[Debug Listener]
type=listener
service=Debug Interface
protocol=telnetd
port=4442

[dbserver1]
type=server
address=192.168.56.221
port=3306
protocol=MySQLBackend

[dbserver2]
type=server
address=192.168.56.223
port=3306
protocol=MySQLBackend

[dbserver3]
type=server
address=192.168.56.223
port=3306
protocol=MySQLBackend

I acces from 192.168.56.14,   mysql -umaxuser -p -h 192.168.56.14 -P 4306
ERROR 1045 (2800): failed to create new session

I was enabled user to access in mariadb galera gluster

+---------+-----------------+
| user    | host            |
+---------+-----------------+
| rizal   | %               |
| root    | 127.0.0.1       |
| maxuser | 192.168.56.14   |

Anyone know how to fix this problem, thank you very much. 



Markus Mäkelä

unread,
Feb 3, 2015, 12:10:13 AM2/3/15
to Rizal E S, maxs...@googlegroups.com
Hi,

You seem to be missing the monitor module for galera clusters which
means that MaxScale has no way of knowing the state of the servers. I'm
assuming you have a galera cluster running on the three servers.

You can fix this by adding the following to your configuration file:

[Galera Monitor]
type=monitor
module=galeramon
servers=dbserver1dbserver2,dbserver3
user=maxuser
passwd=maxpwd
monitor_interval=1000

If you are not using galera, the mysqlmon module should be used instead
of the galeramon module.

An example configuration and explanations about the modules can be found
from the MaxScale_template.cnf file in the etc/ folder of the
installation directory (here's a link to it on GitHub:
https://github.com/mariadb-corporation/MaxScale/blob/develop/server/MaxScale_template.cnf).

Markus
> --
> You received this message because you are subscribed to the Google
> Groups "MaxScale" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to maxscale+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
Markus Mäkelä, Software Engineer
MariaDB Corporation
t: +358 40 7740484 | Skype: markus.j.makela

Rizal E S

unread,
Feb 3, 2015, 1:02:02 AM2/3/15
to maxs...@googlegroups.com, muhammad...@gmail.com
Thanks Markus, It works, I can insert and update mariadb galera cluster now. But I checking error log I found this :

2015 02/03 12:43:06  Error : Unexpected parameter 'monitor_interval' for object 'Galera Monitor' of type 'monitor'.
2015 02/03 12:43:06  Error : The service 'Debug Interface' is missing a definition of the servers that provide the service.

I have 3 node of mariadb galera cluster. is possible configure maxscale to make node1 for only Write, and node 2, 3 only for read.? I think node1 only for write, if node1 is down, then node2 can write.  Example create database only to node1 and galera replicate the database to node2 and node3. I stil use haproxy to balancing mariadb galera cluster, but if node1 2 3 can write/insert sometimes the database can deadlock. Any solutions to avoid deadlock with MaxScale? 
Thank you very much. 

Markus Mäkelä

unread,
Feb 3, 2015, 1:16:40 AM2/3/15
to Rizal E S, maxs...@googlegroups.com
Hi,

The errors are not critical but the one about the unexpected parameter
should not have appeared as far as I know. The Debug Interface error is
generated because it has no servers, this is a known bug about this
module.

You can use the readwritesplit router to split read/write queries to
different servers. The way it works with a galera cluster is that it
sets one node as the "master" node where all writes go and it balances
the read queries between the other nodes. You can do this by replacing
the Galera Service with the following one:

[Galera Service]
type=service
router=readwritesplit
servers=dbserver1,dbserver2,dbserver3
user=maxuser
passwd=maxpwd
max_slave_connections=100%

The max_slave_connections determines the number of "slave" nodes each
session uses for routing read queries. Setting it to 100% spreads the
read load over all the nodes. You can look up the other parameters for
the readwritesplit router from the template configuration file I linked
before.

Markus

Rizal E S

unread,
Feb 3, 2015, 2:31:19 AM2/3/15
to maxs...@googlegroups.com, muhammad...@gmail.com
Thanks you for your attention,

I was change MaxScale.cnf

[Galera Service]
type=service
router=readwritesplit
servers=dbserver1,
dbserver2,
dbserver3
user=maxuser
passwd=maxpwd

the other config still same with MaxScale.cnf in above

I found error log on maxscale host

2015 02/03 14:25:08 Error : Couldn't find suitable Slave from 1 candidates.
2015 02/03 14:25:08 Error : Couldn't find suitable Master from 1 candidates.
2015 02/03 14:25:08 Error : Failed to create router client session. Freeing allocated resources.

and in client host error like this

mysql -umaxuser -p -h 192.168.56.14 -P4306
Enter password:
ERROR 1045 (2800): failed to create new session

I was make node1 to master, and node 2 & 3 to slave.

Thanks for help.
Reply all
Reply to author
Forward
0 new messages