I have a similar issue when adding a fourth or fifth node to a running cluster. I was doing this in an effort to replace a host in a test env. Basically the node ends up in a state of "Instance not yet configured for clustering" and when I check the juju logs on the leader I can see the same message as above:
2023-09-12 15:31:34 INFO unit.mysql-innodb-cluster/2.juju-log server.go:325 cluster:1: Configuring instance for clustering: 192.168.6.227.
ERROR: Unable to connect to the target instance '192.168.6.227:3306'. Please verify the connection settings, make sure the instance is available and try again.
mysqlsh.DBError: MySQL Error (1130): Cluster.add_instance: Could not open connection to '192.168.6.227:3306': Host '192.168.6.5' is not allowed to connect to this MySQL server
2023-09-12 15:31:36 WARNING unit.mysql-innodb-cluster/2.juju-log server.go:325 cluster:1: Instance: 192.168.6.6, already clustered.
2023-09-12 15:31:36 WARNING unit.mysql-innodb-cluster/2.juju-log server.go:325 cluster:1: Instance: 192.168.6.7, already clustered.
2023-09-12 15:31:36 WARNING unit.mysql-innodb-cluster/2.juju-log server.go:325 cluster:1: Instance: 192.168.6.211, already clustered.
2023-09-12 15:31:37 INFO unit.mysql-innodb-cluster/2.juju-log server.go:325 cluster:1: Adding instance, 192.168.6.227, to the cluster.
I have a similar issue when adding a fourth or fifth node to a running cluster. I was doing this in an effort to replace a host in a test env. Basically the node ends up in a state of "Instance not yet configured for clustering" and when I check the juju logs on the leader I can see the same message as above:
2023-09-12 15:31:34 INFO unit.mysql- innodb- cluster/ 2.juju- log server.go:325 cluster:1: Configuring instance for clustering: 192.168.6.227.
ERROR: Unable to connect to the target instance '192.168. 6.227:3306' . Please verify the connection settings, make sure the instance is available and try again. add_instance: Could not open connection to '192.168. 6.227:3306' : Host '192.168.6.5' is not allowed to connect to this MySQL server innodb- cluster/ 2.juju- log server.go:325 cluster:1: Instance: 192.168.6.6, already clustered. innodb- cluster/ 2.juju- log server.go:325 cluster:1: Instance: 192.168.6.7, already clustered. innodb- cluster/ 2.juju- log server.go:325 cluster:1: Instance: 192.168.6.211, already clustered. innodb- cluster/ 2.juju- log server.go:325 cluster:1: Adding instance, 192.168.6.227, to the cluster.
mysqlsh.DBError: MySQL Error (1130): Cluster.
2023-09-12 15:31:36 WARNING unit.mysql-
2023-09-12 15:31:36 WARNING unit.mysql-
2023-09-12 15:31:36 WARNING unit.mysql-
2023-09-12 15:31:37 INFO unit.mysql-
On the new node:
mysql> select user, host from mysql.user; ------- -----+- ------- ------- + ------- -----+- ------- ------- + ------- -----+- ------- ------- +
+------
| user | host |
+------
| clusteruser | 192.168.6.227 |
| clusteruser | 192.168.6.6 |
| clusteruser | 192.168.6.7 |
| clusteruser | localhost |
| debian-sys-maint | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------
It looks like it doesn't add the clusteruser for every host. If I add it manually and the run the add-instance action from juju all is well.