0

I'm setting up my first mysql innodb cluster, following the instructions here: https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-production-deployment.html

I've configured the instances with dba.configureInstance() and confirmed that the configuration is OK with dba.checkInstanceConfiguration() on each of the hosts.

I've successfully started the cluster on the seed host with dba.createCluster() and that is up and running OK. However, when I try to add one of the other hosts as an instance by using cluster.addInstance(), whiel the instance is added to the cluster, the status of the instance is 'RECOVERING' for a while and then it becomes '(MISSING)'.

Looking in the mysql error log of the host I was trying to add as an instance I can see this error:

2019-05-23T16:25:55.390057Z 513548 [ERROR] [MY-010584] [Repl] Slave SQL for channel 'group_replication_recovery': Worker 1 failed executing transaction '21e117cb-7264-11e9-9b63-005056bca54b:79' at master log mysql-bin.000006, end_log_pos 2670; Error executing row event: 'Unknown database 'mysql_innodb_cluster_metadata'', Error_code: MY-001049

Setup

I have three VMs, each with a fresh installation of ubuntu16. I installed mysql8 on each by:

  • downloading mysql-apt-config_0.8.13-1_all.deb from https://dev.mysql.com/downloads/repo/apt/
  • dpkg –I mysql-apt-config_0.8.12-1_all.deb or dpkg-reconfigure mysql-apt-config
  • apt-get update
  • apt-get install mysql-client mysql-community-server mysql-shell
  • apt-get install mysql-router

Then on each host I created a user (cluadmin) with all the privileges listed here under "User Privileges", both @localhost and also @ the subnet for all three VMs.

On the mysqlclient command line for each host I then ran:

INSTALL PLUGIN group_replication SONAME 'group_replication.so';

Then I went into mysqlsh on each host and ran

dba.configureInstance('cluadmin@localhost:3306')

then

dba.checkInstanceConfiguration()

and got "status": "ok"

Then I went onto one of the hosts mysqlsh and ran

var cluster = dba.createCluster(‘mysqldevcluster’)
cluster.status()

The status showed

{
    "clusterName": "mysqldevcluster", 
    "defaultReplicaSet": {
        "name": "default", 
        "primary": "host1:3306", 
        "ssl": "REQUIRED", 
        "status": "OK_NO_TOLERANCE", 
        "statusText": "Cluster is NOT tolerant to any failures. 1 member is not active", 
        "topology": {
            "host1:3306": {
                "address": "host1:3306", 
                "mode": "R/W", 
                "readReplicas": {}, 
                "role": "HA", 
                "status": "ONLINE", 
                "version": "8.0.16"
            }
        }, 
        "topologyMode": "Single-Primary"
    }, 
    "groupInformationSourceMember": "host1:3306"
}

When I then run dba.addInstance('cluadmin@host2:3306') the instance is successfully added to the cluster:

{
    "clusterName": "mysqldevcluster", 
    "defaultReplicaSet": {
        "name": "default", 
        "primary": "host1:3306", 
        "ssl": "REQUIRED", 
        "status": "OK_NO_TOLERANCE", 
        "statusText": "Cluster is NOT tolerant to any failures.", 
        "topology": {
            "host2:3306": {
                "address": "host2:3306", 
                "mode": "n/a", 
                "readReplicas": {}, 
                "role": "HA", 
                "status": "RECOVERING", 
                "version": "8.0.16"
            }, 
            "host1:3306": {
                "address": "host1:3306", 
                "mode": "R/W", 
                "readReplicas": {}, 
                "role": "HA", 
                "status": "ONLINE", 
                "version": "8.0.16"
            }
        }, 
        "topologyMode": "Single-Primary"
    }, 
    "groupInformationSourceMember": "host1:3306"
}

host2 stays in RECOVERING while it tries a few times to start group replication, but eventually fails and goes to (MISSING) - with the error above "Unknown database 'mysql_innodb_cluster_metadata'" in the host2 /var/log/mysql/error.log

Said database is available on host1, but is not present on host 2 so I'm thinking that I have missed a step somewhere or done something in the wrong order. If anyone could shed any light on this I would be very grateful.

Thanks in advance for your valuable time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.