[MXS-1344] Make binlog server "identity" compatible with MaxScale MySQL Monitor Created: 2017-08-07  Updated: 2017-12-01  Resolved: 2017-08-23

Status: Closed
Project: MariaDB MaxScale
Component/s: binlogrouter
Affects Version/s: 2.0.0
Fix Version/s: 2.2.0

Type: New Feature Priority: Major
Reporter: Massimiliano Pinto (Inactive) Assignee: Massimiliano Pinto (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Environment:

Setup with Master/Slaves and Binlog Server with MaxScale MySQL monitor.


Sprint: 2017-39, 2017-40

 Description   

Due to some internal variable values, currently part of Binlog Router Identity, it's not possible to use a setup with Master/Slaves and Binlog Server with MaxScale MySQL monitor.

The goal is to detect binlog Server as Relay Master and don't allow any routing operations with read connection router or readwrite split router.



 Comments   
Comment by Massimiliano Pinto (Inactive) [ 2017-08-23 ]

MySQL monitor can now detect a replication setup with Binlog Server.

If 'master_id' is not set in Binlog Server configuration, then there is no need to add the server name to the monitor server list.

If is set this is the needed configuration:

Binlog server running on host 192.168.100.100

{{[BinlogServer]
type=service
router=binlogrouter
router_options=server-id=93,....,binlogdir=/x/y/z,master_id=2222}}
...
{{[BinlogServer_Listener]
type=listener
service=BinlogServer
protocol=MySQLClient
port=8808
address=192.168.100.100}}

and R/W split or readconnection router config with monitor is:

{{[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server5,server2,server1,binlog_server
monitor_interval=10000
detect_replication_lag=true

[binlog_server]
type=server
address=192.168.100.100
port=8808
protocol=MySQLBackend
}}
...

{{[Read-Write-Service]
type=service
router=readwritesplit
servers=server5,server2,server1}}

....

{{[Read-Only-Service]
type=service
router=readconnroute
router_options=slave
servers=server5,server2,server1}}

There is no need to add 'binlog_server' to server list in traffic routers: only in the monitor.

Comment by Massimiliano Pinto (Inactive) [ 2017-08-23 ]

MaxAdmin "show servers" output

Scenario (1): The 'master_id' is not set in binlog server.

  • Master sees as slaves 1, 104 , 93 (including binlog server if it's being monitored)
  • Binlog Server has only Running state and shows no slaves (no matter whether it's monitored or not)

=== MASTER ===
Server 0x65b680 (server5)
Server: 127.0.0.1
Status: Master, Running
Protocol: MySQLBackend
Port: 10124
Server Version: 10.1.24-MariaDB
Node Id: 10124
Master Id: -1
Slave Ids: 1, 104 , 93
Repl Depth: 0

=== BINLOG SERVER (if monitored some values are set) ===
Server 0x65c910 (binlog_server)
Server: 127.0.0.1
Status: Running
Protocol: MySQLBackend
Port: 8808
Server Version: 10.1.17-log
Node Id: 93
Master Id: 10124
Slave Ids:
Repl Depth: 1

=== SLAVE 1 ===
Server 0x660210 (server1)
Server: 127.0.0.1
Status: Slave, Running
Protocol: MySQLBackend
Port: 25235
Server Version: 10.0.21-MariaDB-log
Node Id: 104
Master Id: 10124
Slave Ids:
Repl Depth: 1
Slave delay: 0
Last Repl Heartbeat: Wed Aug 23 12:24:54 2017

=== SLAVE 2 ===
Server 0x65ef10 (server2)
Server: 127.0.0.1
Status: Slave, Running
Protocol: MySQLBackend
Port: 25231
Server Version: 10.0.21-MariaDB-log
Node Id: 1
Master Id: 10124
Slave Ids:
Repl Depth: 1
Slave delay: 0
Last Repl Heartbeat: Wed Aug 23 12:24:54 2017

Scenario (2): The 'master_id' is set to 2222.

  • router_options=server-id=93,...,master_id=2222
  • Master sees as slaves only 93 binlog server which must be monitored.
  • Binlog Server has 'Relay Master, Running' state and shows the slaves: 1, 104

The replication topology clearly shows 3 levels with Binlog Server as master of slaves.

==== MASTER ===
Server 0x65b690 (server5)
Server: 127.0.0.1
Status: Master, Running
Protocol: MySQLBackend
Port: 10124
Server Version: 10.1.24-MariaDB
Node Id: 10124
Master Id: -1
Slave Ids: 2222
Repl Depth: 0
Last Repl Heartbeat: Wed Aug 23 14:15:32 2017

=== BINLOG SERVER ===
Server 0x65c920 (binlog_server)
Server: 127.0.0.1
Status: Relay Master, Running
Protocol: MySQLBackend
Port: 8808
Server Version: 10.1.17-log
Node Id: 2222
Master Id: 10124
Slave Ids: 1, 104
Repl Depth: 1

=== SLAVE 1 ===
Server 0x65ef20 (server2)
Server: 127.0.0.1
Status: Slave, Running
Protocol: MySQLBackend
Port: 25231
Server Version: 10.0.21-MariaDB-log
Node Id: 1
Master Id: 2222
Slave Ids:
Repl Depth: 2

=== SLAVE 2 ===
Server 0x660220 (server1)
Server: 127.0.0.1
Status: Slave, Running
Protocol: MySQLBackend
Port: 25235
Server Version: 10.0.21-MariaDB-log
Node Id: 104
Master Id: 2222
Slave Ids:
Repl Depth: 2
Slave delay: 0
Last Repl Heartbeat: Wed Aug 23 14:15:22 2017

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