3

I have active master - slave (ssl) replication. I installed maxscale, set a configuration, but maxscale cannot get gtid_binlog_pos

error : [mariadbmon] Can not select 'master' as a demotion target for failover because it does not have a 'gtid_binlog_pos' and unsafe failover is disabled.

Database: MariaDB 10.3.25 OS: Ubuntu 20.04

my config maxscale:

threads=auto
log_info=1
log_debug=1
logdir=/opt/sslmaxscale/maxscale.log

[master]
type=server
address=192.168.89.234
port=3306
protocol=MariaDBBackend
ssl=required
ssl_ca_cert=/opt/sslmaxscale/ca-cert.pem
ssl_cert=/opt/sslmaxscale/server-cert.pem
ssl_key=/opt/sslmaxscale/server-key.pem

[slave]
type=server
address=192.168.89.231
port=3306
protocol=MariaDBBackend
ssl=required
ssl_ca_cert=/opt/sslmaxscale/ca-cert.pem
ssl_cert=/opt/sslmaxscale/server-cert.pem
ssl_key=/opt/sslmaxscale/server-key.pem

[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=master,slave
user=repl
password=password
monitor_interval=2000
auto_rejoin=true
auto_failover=true
replication_master_ssl=true ```

Ssl connection in mysql working, i checked it. And gtid_binlog_pos i can got


MariaDB [(none)]> SELECT @@global.gtid_binlog_pos;  @@global.gtid_binlog_pos - 1-1-517                  

2 Answers2

1

That error is logged whenever the replication isn't set up in a way that would allow safe failover to occur. This usually tells that there's something wrong with either the user the monitor is configured to use or that the replication was started in a way that isn't compatible with the automatic server management in MaxScale.

You can disable this safety check and force the monitor to create a simple topology by adding enforce_simple_topology=true to the monitor definition.

markusjm
  • 2,358
  • 1
  • 11
  • 23
  • Unfortunately it didn't help. Only the message has changed. `Cluster gtid domain is unknown. This is usually caused by the cluster never having a master server while MaxScale was running.` P.S. Maxscale was installed on active master > slave replication(with gtid). gtid_pos - slave_pos – Alexander Kolesnik Apr 01 '21 at 21:09
  • If you want to delegate the cluster initialization to MaxScale and reset the whole setup, you can do that with the MaxCtrl command `maxctrl call command mariadbmon reset-replication ` ( https://mariadb.com/kb/en/mariadb-maxscale-25-mariadb-monitor/#operation-details). This should make sure it's set up in a way that allows automated failover, I personally use this a lot in my testing. – markusjm Apr 04 '21 at 07:30
  • I've made some progress. There is now an error `The current master server 'master' is no longer valid because it has been down over 5 (failcount)`. It appeared after 5 unsuccessful authorizations and the error does not disappear now. – Alexander Kolesnik Apr 06 '21 at 20:24
1

Problem found. The skip-networking = 0 variable was missing in the database configuration. By default, it was set to 1. This meant that I could only connect via localhost.

But it's not clear how replication worked with skip-networking = 1...

  • I have the same problem, where do you need to post the "skip-networking" part? On the maxscale-server, master, or slaves? – Maybe Feb 11 '22 at 14:45