Bug #93302 MySQL Router: bootstrap support for cluster with multiple cluster in metadata
Submitted: 22 Nov 2018 20:25 Modified: 24 Nov 2018 4:34
Reporter: Frederic Descamps Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Router Configuration Severity:S4 (Feature request)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[22 Nov 2018 20:25] Frederic Descamps
Description:
If we setup 2 InnoDB Cluster like explained in this blog : https://lefred.be/content/migration-from-mysql-master-slave-pair-to-mysql-innodb-cluster-h...

It's not possible to boostrap mysqlrouter.

How to repeat:
So after the setup (see blog in description), we have mysql_innodb_cluster_metadata.clusters tables with 2 records:

mysql> select * from mysql_innodb_cluster_metadata.clusters\G
*************************** 1. row ***************************
         cluster_id: 1
       cluster_name: clusterDC1
 default_replicaset: 1
        description: Default Cluster
mysql_user_accounts: NULL
            options: null
         attributes: {"default": true}
*************************** 2. row ***************************
         cluster_id: 2
       cluster_name: clusterDC2
 default_replicaset: 2
        description: Default Cluster
mysql_user_accounts: NULL
            options: null
         attributes: {"default": true}

If we try too boostrap, we have the following error:

[root@mysql2 vagrant]# mysqlrouter --bootstrap clusteradmin@mysql2 --user mysqlrouter
Please enter MySQL password for clusteradmin: 
Error: Error fetching query results: Subquery returns more than 1 row (1242)

Suggested fix:
We could resolve it in two different ways:

1. run the command as above and it should find the cluster the host belongs to
2. add a parameter --clustername= to specify it
[24 Nov 2018 4:34] Umesh Shastry
Hello Frederic,

Thank you for the report and feature request!

regards,
Umesh