about MariaDB Maxscale Read/Write Split a problem!!!

234 views
Skip to first unread message

chunyang_he

unread,
Oct 15, 2015, 2:57:18 AM10/15/15
to maxscale
HI,:
---------------------------------------------
# more /etc/maxscale.cnf
[maxscale]
threads=1

[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server1,server2,server3
user=admin
passwd=C85C292BE80DF673E053F926433F19A8
monitor_interval=10000

[RW Split Router]
type=service
router=readwritesplit
servers=serve1,server2,server3
user=hechunyang
passwd=C85C292BE80DF673E053F926433F19A8
max_slave_connections=2
max_slave_replication_lag=5
router_options=slave_selection_criteria=LEAST_BEHIND_MASTER

[CLI]
type=service
router=cli

[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006

[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
port=6603

[server1]
type=server
address=192.168.17.128
port=3306
protocol=MySQLBackend

[server2]
type=server
address=192.168.17.129
port=3306
protocol=MySQLBackend

[server3]
type=server
address=192.168.17.130
port=3306
protocol=MySQLBackend
---------------------------------------------
The master is server1, slave is server2 / server3 ,But I perform a select * from t1 where id = 1, found that can only be routed to server3, server2 no request.
  

You can help me? Thanks!


Markus

unread,
Oct 15, 2015, 2:43:21 PM10/15/15
to maxs...@googlegroups.com
Hi,

With the LEAST_BEHIND_MASTER option, you will need to add the 'detect_replication_lag=true' parameter to the MySQL Monitor section. That way the monitor will detect and update the replication lag between the servers. It is mentioned in the readwritesplit documentation.

Here is the documentation for the MySQL monitor: https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Monitors/MySQL-Monitor.md#mysql-monitor-optional-parameters

and here is the readwritesplit documentation: https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Routers/ReadWriteSplit.md

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 

Martin Brampton

unread,
Oct 16, 2015, 3:50:32 AM10/16/15
to Markus, maxs...@googlegroups.com
Hi

Thanks, but shouldn't this be automatic? If the LEAST_BEHIND_MASTER
option is specified anywhere, then the MySQL Monitor should be assumed
to have detect_replication_lag set true, whether or not it is specified.
Probably with a message if it is forced rather than specified.

And, ideally, a check that the necessary database setup (for detecting
replication lag) has been done - otherwise the LEAST_BEHIND_MASTER is
suppressed with an error message?

Martin
>> You can help me? Thanks!
>>
>>
>> --
>> 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
>> <mailto: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
>
> --
> 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
> <mailto:maxscale+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Martin Brampton, Principal Software Engineer
MariaDB Corporation | t: +44 1751-432935 | Skype: blacksheepresearch
Reply all
Reply to author
Forward
0 new messages