PDF (US Ltr) - 2.2Mb
PDF (A4) - 2.3Mb
在从服务器实例创建生产部署之前,您需要检查每个实例上的 MySQL 是否已正确配置。 dba.configureInstance()
函数在配置实例时会执行此操作,但您可以选择使用 dba.checkInstanceConfiguration(
函数。 这将检查实例是否满足 第 7.1 章,“InnoDB 集群要求” 中列出的要求,而不会更改实例上的任何配置。instance
)
您用来连接到实例的用户必须具有适当的权限,例如在 手动配置 InnoDB 集群管理员帐户 中配置的权限。 以下演示了在运行的 MySQL Shell 中发出此命令的方法
mysql-js> dba.checkInstanceConfiguration('icadmin@ic-1:3306')
Please provide the password for 'icadmin@ic-1:3306': ***
Validating MySQL instance at ic-1:3306 for use in an InnoDB cluster...
This instance reports its own address as ic-1
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...
Some configuration options need to be fixed:
+--------------------------+---------------+----------------+--------------------------------------------------+
| Variable | Current Value | Required Value | Note |
+--------------------------+---------------+----------------+--------------------------------------------------+
| enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server |
| gtid_mode | OFF | ON | Update read-only variable and restart the server |
| server_id | 1 | | Update read-only variable and restart the server |
+--------------------------+---------------+----------------+--------------------------------------------------+
Please use the dba.configureInstance() command to repair these issues.
{
"config_errors": [
{
"action": "restart",
"current": "OFF",
"option": "enforce_gtid_consistency",
"required": "ON"
},
{
"action": "restart",
"current": "OFF",
"option": "gtid_mode",
"required": "ON"
},
{
"action": "restart",
"current": "1",
"option": "server_id",
"required": ""
}
],
"status": "error"
}
对您计划作为集群的一部分使用的每个服务器实例重复此过程。 运行 dba.checkInstanceConfiguration()
后生成的报告提供了有关在 InnoDB 集群部署中使用实例所需的任何配置更改的信息。 报告的 config_error
部分中的 action
字段告诉您实例上的 MySQL 是否需要重新启动才能检测到对配置文件所做的任何更改。