更多文章,欢迎关注作者公众号,欢迎一起交流。
1)部署 SandBox 环境
[root@serverc local]# mysqlsh
MySQL Shell 8.0.28-commercial
Copyright (c) 2016, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '?' for help; '\quit' to exit.
MySQL JS > dba.deploySandboxInstance(3307);
MySQL JS > dba.deploySandboxInstance(3308);
MySQL JS > dba.deploySandboxInstance(3309);
2)检查实例配置,若满足,则返回OK,否则修复配置项
MySQL localhost:3307 ssl JS > dba.checkInstanceConfiguration();
Validating local MySQL instance listening at port 3307 for use in an InnoDB cluster...
NOTE: Instance detected as a sandbox.
Please note that sandbox instances are only suitable for deploying test clusters for use within the same host.
This instance reports its own address as 127.0.0.1:3307
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
Instance configuration is compatible with InnoDB cluster
The instance '127.0.0.1:3307' is valid to be used in an InnoDB cluster.
{
"status": "ok"
}
3)配置实例
MySQL localhost:3307 ssl JS > dba.configureInstance('localhost:3307');
Configuring local MySQL instance listening at port 3307 for use in an InnoDB cluster...
NOTE: Instance detected as a sandbox.
Please note that sandbox instances are only suitab