0

We use MySQL Server 8 with three nodes in a group replication on single primary mode. The server is running under windows. To communicate with the servers we use MySQL Router 8.

The problem is, that the router doesn't know which of the three nodes is the one which can write. So there ist always a chance the promt returns "The MySQL server is running with the --super-read-only option".

How do I configure the router correctly to send all writing commands to the actual donor server? If this is not possible, is there a way to configure a second router which takes always the primary server?

Edit: Here is the content of mysqlrouter.conf:

[DEFAULT]
user = routing
logging_folder = D:\MySQL Router\logs

max_total_connections = 1500

[routing:primary]
bind_address = db.lan
bind_port = 3306
destinations = db03.lan:3306, db04.lan:3306, db05.lan:3306
routing_strategy = round-robin
DanielW
  • 3
  • 3

1 Answers1

0

I'll give you a reference configuration of MGR single master mode under node 3:

[DEFAULT]
config_folder = /etc/mysqlrouter
logging_folder = /usr/local/mysqlrouter/log
runtime_folder = /var/run/mysqlrouter

[logger]
level = INFO

[routing:slaves]
bind_address = 192.168.100.21:7001
destinations = 192.168.100.23:3306,192.168.100.24:3306
mode = read-only
connect_timeout = 1

[routing:masters]
bind_address = 192.168.100.21:7002
destinations = 192.168.100.22:3306
mode = read-write
connect_timeout = 2

mysql router:192.168.100.21 master:192.168.100.22 slave:192.168.100.23/24

dogs Cute
  • 564
  • 3
  • 9
  • This approach doubtlessly works if the master always remains the same server, but in our environment the master server may change when updates or any other incident restarts the server. Is there a way to handle this scenario? The main problem is, we don't know in advance which one will be the future master when the current one restarts. – DanielW Jul 19 '23 at 06:55
  • @DanielW add ip to destinations – dogs Cute Jul 19 '23 at 07:57