Secondary nodes in mysql 8.0.15 innodb cluster are not reading group_replication_member_expel_timeout variable from my.cnf
-
24-01-2021 - |
Question
I have setup a 3 node mysql 8.0.15 innodb cluster. I have been trying to set group_replication_member_expel_timeout
variable to 60
via the /etc/my.cnf
file. Although the primary node has read the variable properly, secondary nodes are not picking up this variable and are still using the default value 0
.
Here are the contents of the /etc/my.cnf
file
[mysqld]
default-authentication-plugin=mysql_native_password
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
group_replication_member_expel_timeout=60
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
collation-server = utf8_unicode_ci
character-set-server = utf8
After restart, here are the variables in the mysqld instance.
mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.15 |
+-----------+
mysql> select @@group_replication_member_expel_timeout;
+------------------------------------------+
| @@group_replication_member_expel_timeout |
+------------------------------------------+
| 0 |
+------------------------------------------+
I've tried replacing group_replication_member_expel_timeout
with group-replication-member-expel-timeout
in the /etc/my.cnf
, with no success.
I've also noticed that all other variables are being read properly, it is only a problem with group_replication_member_expel_timeout
variable.
Solution
When using the MySQL Shell and the AdminAPI to set up and manage MySQL InnoDB clusters there's no need, and it's not recommended, to manually change MySQL Server system variables and other configurations. The AdminAPI provides the functionalities to do any required configuration changes.
Regarding your need to change the value of group_replication_member_expel_timeout, what you need to do is as simple as:
cluster.setOption("expelTimeout", 60)
This command ensures the option is set on all the cluster members.
To verify the options being used by your cluster, you can use the following function:
cluster.options()
For more information please consult the InnoDB cluster userguide:
And for some examples and further details you can check the blog posts series published during the 8.0.14 release:
https://mysqlserverteam.com/mysql-innodb-cluster-whats-new-in-the-8-0-14-ga-release/
The series includes posts explaining the usage of the 'expelTimeout' option and also how to change cluster options 'live'.
Cheers,
Miguel