首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >MySQL:无法使用dba.configureLocalInstance()为InnoDB群集设置MySQL服务器

MySQL:无法使用dba.configureLocalInstance()为InnoDB群集设置MySQL服务器
EN

Stack Overflow用户
提问于 2019-02-22 05:08:20
回答 1查看 3K关注 0票数 1

我正在尝试按照文档中概述的步骤设置InnoDB集群(https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-production-deployment.html)的生产部署。我使用的是MySQL 5.7.25

我的MySQL服务器成功启动,我(从MySQL外壳程序)运行

代码语言:javascript
复制
dba.checkInstanceConfiguration('root@localhost:3306')

哪种打印

代码语言:javascript
复制
    Validating local MySQL instance listening at port 3306 for use in an InnoDB cluster...

This instance reports its own address as ip-10-0-3-184.ap-south-1.compute.internal
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 the config file and restart the server    |
| gtid_mode                        | OFF           | ON             | Update the config file and restart the server    |
| log_bin                          | <not set>     | <no value>     | Update the config file                           |
| log_bin                          | OFF           | ON             | Update read-only variable and restart the server |
| log_slave_updates                | OFF           | ON             | Update the config file and restart the server    |
| master_info_repository           | FILE          | TABLE          | Update the config file and restart the server    |
| relay_log_info_repository        | FILE          | TABLE          | Update the config file and restart the server    |
| server_id                        | 0             | <unique ID>    | Update the config file and restart the server    |
| transaction_write_set_extraction | OFF           | XXHASH64       | Update the config file and restart the server    |
+----------------------------------+---------------+----------------+--------------------------------------------------+

Some variables need to be changed, but cannot be done dynamically on the server: an option file is required.
Please use the dba.configureInstance() command to repair these issues.

{
    "config_errors": [
        {
            "action": "config_update+restart", 
            "current": "OFF", 
            "option": "enforce_gtid_consistency", 
            "required": "ON"
        }, 
        {
            "action": "config_update+restart", 
            "current": "OFF", 
            "option": "gtid_mode", 
            "required": "ON"
        }, 
        {
            "action": "config_update", 
            "current": "<not set>", 
            "option": "log_bin", 
            "required": "<no value>"
        }, 
        {
            "action": "restart", 
            "current": "OFF", 
            "option": "log_bin", 
            "required": "ON"
        }, 
        {
            "action": "config_update+restart", 
            "current": "OFF", 
            "option": "log_slave_updates", 
            "required": "ON"
        }, 
        {
            "action": "config_update+restart", 
            "current": "FILE", 
            "option": "master_info_repository", 
            "required": "TABLE"
        }, 
        {
            "action": "config_update+restart", 
            "current": "FILE", 
            "option": "relay_log_info_repository", 
            "required": "TABLE"
        }, 
        {
            "action": "config_update+restart", 
            "current": "0", 
            "option": "server_id", 
            "required": "<unique ID>"
        }, 
        {
            "action": "config_update+restart", 
            "current": "OFF", 
            "option": "transaction_write_set_extraction", 
            "required": "XXHASH64"
        }
    ], 
    "status": "error"

(到目前为止还不错)

在此之后,我尝试运行dba.configureLocalInstance(),但得到以下错误消息:

代码语言:javascript
复制
Dba.configureLocalInstance: Dba.configureLocalInstance: An open session is required to perform this operation. (RuntimeError)

我不确定这是什么意思,但为了绕过它,我运行了dba.configureLocalInstance('root@localhost:3306'),它似乎起作用了:

代码语言:javascript
复制
Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster...

This instance reports its own address as ip-10-0-3-184.ap-south-1.compute.internal
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.

WARNING: User 'root' can only connect from localhost.
If you need to manage this instance while connected from other hosts, new account(s) with the proper source address specification must be created.

1) Create remotely usable account for 'root' with same grants and password
2) Create a new admin account for InnoDB cluster with minimal required grants
3) Ignore and continue
4) Cancel

Please select an option [1]: 3

Some configuration options need to be fixed:
+----------------------------------+---------------+----------------+--------------------------------------------------+
| Variable                         | Current Value | Required Value | Note                                             |
+----------------------------------+---------------+----------------+--------------------------------------------------+
| enforce_gtid_consistency         | OFF           | ON             | Update the config file and restart the server    |
| gtid_mode                        | OFF           | ON             | Update the config file and restart the server    |
| log_bin                          | <not set>     | <no value>     | Update the config file                           |
| log_bin                          | OFF           | ON             | Update read-only variable and restart the server |
| log_slave_updates                | OFF           | ON             | Update the config file and restart the server    |
| master_info_repository           | FILE          | TABLE          | Update the config file and restart the server    |
| relay_log_info_repository        | FILE          | TABLE          | Update the config file and restart the server    |
| server_id                        | 0             | <unique ID>    | Update the config file and restart the server    |
| transaction_write_set_extraction | OFF           | XXHASH64       | Update the config file and restart the server    |
+----------------------------------+---------------+----------------+--------------------------------------------------+

Some variables need to be changed, but cannot be done dynamically on the server: an option file is required.

Detecting the configuration file...
Found configuration file at standard location: /etc/my.cnf
Do you want to modify this file? [y/N]: y
Do you want to perform the required configuration changes? [y/n]: y
Configuring instance...
The instance 'localhost:3306' was configured for InnoDB cluster usage.
MySQL server needs to be restarted for configuration changes to take effect.

但是在我重新启动MySQL服务器后,我得到了与dba.checkInstanceConfiguration('root@localhost:3306')完全相同的输出...

我还注意到,/etc/my.cnf没有从初始安装的默认设置中进行修改。如果是权限问题,我将/etc/my.cnf的所有者更改为我的用户"mysql“,但结果是相同的……

有没有人能对此有所了解?任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

发布于 2019-02-22 07:08:02

通过手动修改我的/etc/my.cnf文件,使其包含dba.checkInstanceConfiguration('root@localhost:3306')输出中提到的变量的必要值,我已经克服了这个问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54816236

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档