How doese maxscale know which one is the master , which one is slave?

714 views
Skip to first unread message

hufen...@gmail.com

unread,
Mar 14, 2015, 2:07:28 AM3/14/15
to maxs...@googlegroups.com
How doese maxscale know which one is the master , which one is slave?

I had read the manual, but can not see any explain about how Maxscale detect Master server and the Slave servers.

And i can see configure have no options to configure the master server information.

maat...@gmail.com

unread,
Mar 14, 2015, 12:57:17 PM3/14/15
to maxs...@googlegroups.com, hufen...@gmail.com
Hi, if your client connects to the port, which is configured for read/write split router, the queries will be parsed by component called query classifier prior routing. Query classifier calls the (MariaDB) parser to create a parse tree and detects the query type from it. Trace log shows how queries are classified and what routing decisions were made.

Regards

Karsten

hufen...@gmail.com

unread,
Mar 14, 2015, 11:28:23 PM3/14/15
to maxs...@googlegroups.com, hufen...@gmail.com, maat...@gmail.com
maat...@gmail.com於 2015年3月15日星期日 UTC+8上午12時57分17秒寫道:
Thanks, but how maxscale know backend server (which is master, which is slave)

Dipti Joshi

unread,
Mar 15, 2015, 2:01:11 AM3/15/15
to hufen...@gmail.com, maxs...@googlegroups.com, maat...@gmail.com
MySQLMon plugin of MaxScale monitors the cluster and detects which node is master and which nodes are slaves. If the master fails and a slave becomes master the monitor detects it. The monitor plugin lets the router plugin know of the states of the database nodes.

A monitor is defined as following in the configuration file

[Replication Monitor]
type=monitor
module=mysqlmon
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484

For documentation on setup for either doing read connection routing or read-write split for MySQL Monitor, see the latest documentation here

MySQL Replication Connection Routing Tutorial
MySQL Replication Read-Write Splitting Tutorial

-Dipti





Senior Product Manager,
MariaDB Corporation






--
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.

Massimiliano Pinto

unread,
Mar 17, 2015, 7:10:04 AM3/17/15
to hufen...@gmail.com, MaxScale, maat...@gmail.com, Dipti Joshi
Hi,


the MaxScale MySQL Monitor is able to detect the replication tree of the listed servers db1,db2,db3.

In order to do that the monitor user should have the grants for REPLICATION SLAVE and REPLICATION CLIENT.


You can easily check that with a mysql client connection from maxscale box to dbservers issuing the SHOW SLAVE STATUS query and checking you don’t have any error.

The user should also have proper host permission (% or 127.0.0.1 or IP of maxscale box)

If the user setup is ok, MySQL monitor can fetch the @@server_id variable and other informations from SHOW SLAVE STATUS in order to compute the replication topology tree that may include intermediate master servers, called relay servers.


Using maxadmin or telnet interface you may easily check the current replication setup:

MaxScale> show servers


and you should see Master and Slave status with MasterId and SlaveIDs.



Please check also this document for further informations:






Massimiliano
Reply all
Reply to author
Forward
0 new messages