在配置MySQL InnoDB Cluster时出现报错,版本5.7.24
问题描述
在MySQL Shell中执行如下命令时,出错
MySQL localhost:3307 JS > dba.checkInstanceConfiguration('root@localhost:3307')
Dba.checkInstanceConfiguration: This function is not available through a session to an instance belonging to an unmanaged replication group (RuntimeError)
解决方法
这是由于组复制已启动,需要将启动的组复制关闭。在每个MySQL组复制成员中登陆MySQL执行
mysql> STOP GROUP_REPLICATION;
当多有组复制成员执行完上述命名时,在MySQL Shell中再次执行检查命令
MySQL localhost:3307 JS > dba.checkInstanceConfiguration('root@localhost:3307')
Validating local MySQL instance listening at port 3307 for use in an InnoDB cluster...
This instance reports its own address as cmiot1
Clients and other cluster members will communicate with it through this address by default. If this is not correct, the report_host MySQL system variable should be changed.
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
Note: verifyMyCnf option was not given so only dynamic configuration will be verified.
Instance configuration is compatible with InnoDB cluster
The instance 'localhost:3307' is valid for InnoDB cluster usage.
{
"status": "ok"
}
问题得到解决。