GreatSQL社区

搜索

[已解决] mysql router无法连接greatsql mgr集群

617 2 2024-3-12 17:04
如下,已经有了一个greatsql mgr集群

- select * from performance_schema.replication_group_members;


"CHANNEL_NAME"    "MEMBER_ID"    "MEMBER_HOST"    "MEMBER_PORT"    "MEMBER_STATE"    "MEMBER_ROLE"    "MEMBER_VERSION"    "MEMBER_COMMUNICATION_STACK"
"group_replication_applier"    "2c57a407-deb1-11ee-9713-22d12487914c"    "192.168.10.131"    "3306"    "ONLINE"    "SECONDARY"    "8.0.32"    "XCom"
"group_replication_applier"    "329b76c7-deb1-11ee-988f-b2c143c4f1b2"    "192.168.10.132"    "3306"    "ONLINE"    "SECONDARY"    "8.0.32"    "XCom"
"group_replication_applier"    "3612fecb-deb1-11ee-9707-3204c84864d7"    "192.168.10.133"    "3306"    "ONLINE"    "PRIMARY"    "8.0.32"    "XCom"
"group_replication_applier"    "729f3810-deac-11ee-9798-5eeddfa676bc"    "192.168.10.130"    "3306"    "ONLINE"    "SECONDARY"    "8.0.32"    "XCom"



使用mysql router无法连接greatsql mgr集群。

- 以交互模式启动一个mysql router容器

```bash
docker run -it \
--net=host \
--name=mysql-router-0 \
--restart=always \
mysql/mysql-router bash

```

- 在容器中输入引导命令
```bash
mysqlrouter --bootstrap root@192.168.10.133:3306 --user=mysqlrouter

```

- 提示如下错误
```log
Please enter MySQL password for root:
Error: Expected MySQL Server '192.168.10.133:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql- ... innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server
```






全部回复(2)
KAiTO 2024-3-12 17:09:33
你仅仅搭建了一个 MGR 集群,并没有使用 MySQL Shell,那么你的系统中就不会有 mysql_innodb_cluster_metadata 数据库
passio 2024-3-12 17:11:23
KAiTO 发表于 2024-3-12 17:09
你仅仅搭建了一个 MGR 集群,并没有使用 MySQL Shell,那么你的系统中就不会有 mysql_innodb_cluster_metad ...

尴尬,想使用mysql router还得先用mysql shell
passio

2

主题

0

博客

7

贡献

新手上路

Rank: 1

积分
12

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-27 12:14 , Processed in 0.021766 second(s), 15 queries , Redis On.
快速回复 返回顶部 返回列表