PDF (美式信紙) - 2.3Mb
PDF (A4) - 2.3Mb
在從伺服器執行個體建立生產環境部署之前,您需要檢查每個執行個體上的 MySQL 是否已正確設定。 dba.configureInstance()
函式會在設定執行個體時執行此操作,但您可以選擇性地使用 dba.checkInstanceConfiguration(
函式。這會檢查執行個體是否符合第 7.1 節「InnoDB Cluster 需求」中列出的需求,而不會變更執行個體上的任何組態。instance
)
您用來連線至執行個體的使用者必須具有適當的權限,例如在手動設定 InnoDB Cluster 管理員帳戶中設定的權限。以下示範在執行中的 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 Cluster 部署中所需的任何組態變更的資訊。報告的 config_error
區段中的 action
欄位會告訴您執行個體上的 MySQL 是否需要重新啟動才能偵測到對組態檔所做的任何變更。