MySQL InnoDB Cluster(MGR)配置相关问题——configureInstance与configureLocalInstance区别

20 篇文章 0 订阅
10 篇文章 2 订阅

 本文援引自MySQL官方文档两处内容,如下:

Once dba.configureInstance() is issued against an instance, the command checks if the instance's settings are suitable for InnoDB Cluster usage. A report is displayed which shows the settings required by InnoDB Cluster . If the instance does not require any changes to its settings you can use it in an InnoDB Cluster, and can proceed to Section 7.4.3, “Creating an InnoDB Cluster”. If the instance's settings are not valid for InnoDB Cluster usage the dba.configureInstance() command displays the settings which require modification. Before configuring the instance you are prompted to confirm the changes shown in a table with the following information:

  • Variable - the invalid configuration variable.

  • Current Value - the current value for the invalid configuration variable.

  • Required Value - the required value for the configuration variable.

How you proceed depends on whether the instance supports persisting settings, see Section 6.2.4, “Persisting Settings”. When dba.configureInstance() is issued against the MySQL instance which MySQL Shell is currently running on, in other words the local instance, it attempts to automatically configure the instance. When dba.configureInstance() is issued against a remote instance, if the instance supports persisting configuration changes automatically, you can choose to do this. If a remote instance does not support persisting the changes to configure it for InnoDB Cluster usage, you have to configure the instance locally. See Configuring Instances with dba.configureLocalInstance().

google翻译:

一旦dba.configureInstance()针对实例发出,该命令将检查实例的设置是否适合 InnoDB Cluster 使用。将显示一份报告,其中显示 InnoDB Cluster 所需的设置。如果实例不需要对其设置进行任何更改,您可以在 InnoDB Cluster 中使用它,并且可以继续 第 7.4.3 节,“创建 InnoDB Cluster”。如果实例的设置对于 InnoDB Cluster 使用无效,则该 dba.configureInstance()命令会显示需要修改的设置。在配置实例之前,系统会提示您确认表格中显示的更改以及以下信息:

  • Variable- 无效的配置变量。

  • Current Value- 无效配置变量的当前值。

  • Required Value- 配置变量的必需值。

 如何继续取决于实例是否支持持久设置,请参阅 第 6.2.4 节,“持久设置”。当 dba.configureInstance()针对 MySQL Shell 当前运行的 MySQL 实例(即本地实例)发出时,它会尝试自动配置该实例。当 dba.configureInstance()针对远程实例发出时,如果该实例支持自动持久化配置更改,您可以选择执行此操作。如果远程实例不支持持久化更改以配置它以供 InnoDB Cluster 使用,则必须在本地配置实例。请参阅 使用配置实例 dba.configureLocalInstance()

6.2.4 Persisting Settings

The AdminAPI commands you use to work with an InnoDB Cluster, InnoDB ClusterSet, InnoDB ReplicaSet, and the individual member server instances in these deployments modify the configuration of MySQL Server on the instance. Depending on the way MySQL Shell is connected to an instance and the version of MySQL Server installed on the instance, these configuration changes can be persisted to the instance automatically.

By making settings to the instance persistent, you ensure that after the instance restarts, configuration changes are retained. For background information see SET PERSIST. This persistence is essential for reliable usage. For example, if settings are not persistent, an instance added to a cluster does not rejoin the cluster after a restart because configuration changes are lost.

Instances which meet the following requirements support persisting configuration changes automatically:

Instances which do not meet these requirements do not support persisting configuration changes automatically, and when AdminAPI operations result in changes to the instance's settings to be persisted you receive warnings such as:

WARNING: On instance 'localhost:3320' membership change cannot be persisted since MySQL version 5.7.21
does not support the SET PERSIST command (MySQL version >= 8.0.5 required). Please use the
<Dba>.configureLocalInstance command locally to persist the changes.

When AdminAPI commands are issued against the MySQL instance which MySQL Shell is currently running on, in other words, the local instance, MySQL Shell persists configuration changes directly to the instance. On local instances which support persisting configuration changes automatically, configuration changes are persisted to the instance's mysqld-auto.cnf file, and the configuration change does not require any further steps.

You must make the changes locally on local instances that do not support persisting configuration changes automatically. For more information, see Configuring Instances with dba.configureLocalInstance().

When run against a remote instance, in other words, an instance other than the one which MySQL Shell is currently running on, if the instance supports persisting configuration changes automatically, the AdminAPI commands persist configuration changes to the instance's mysql-auto.conf option file.

If a remote instance does not support persisting configuration changes automatically, the AdminAPI commands can not automatically configure the instance's option file. So, the AdminAPI commands can read information from the instance, for example, to display the current configuration. But changes to the configuration cannot be persisted to the instance's option file. In this case, you need to persist the changes locally. For more information, see Configuring Instances with dba.configureLocalInstance().

google翻译: 

6.2.4 持久设置

用于处理 InnoDB Cluster、InnoDB ClusterSet、InnoDB ReplicaSet 以及这些部署中的各个成员服务器实例的 AdminAPI 命令会修改实例上 MySQL Server 的配置。根据 MySQL Shell 连接到实例的方式以及实例上安装的 MySQL 服务器的版本,这些配置更改可以自动持久化到实例。

通过对实例进行持久化设置,您可以确保在实例重新启动后,配置更改得以保留。有关背景信息,请参阅 SET PERSIST。这种持久性对于可靠使用至关重要。例如,如果设置不是持久性的,添加到集群的实例在重启后不会重新加入集群,因为配置更改会丢失。

满足以下要求的实例支持自动持久化配置更改:

不满足这些要求的实例不支持自动持久化配置更改,并且当 AdminAPI 操作导致对实例设置的更改被持久化时,您会收到警告,例如:

WARNING: On instance 'localhost:3320' membership change cannot be persisted since MySQL version 5.7.21
does not support the SET PERSIST command (MySQL version >= 8.0.5 required). Please use the
<Dba>.configureLocalInstance command locally to persist the changes.

当针对 MySQL Shell 当前运行的 MySQL 实例(即本地实例)发出 AdminAPI 命令时,MySQL Shell 会将配置更改直接保存到该实例。在支持自动持久化配置更改的本地实例上,配置更改会持久保存到实例的 mysqld-auto.cnf文件中,并且配置更改不需要任何进一步的步骤。

您必须在不支持自动持久配置更改的本地实例上进行本地更改(补充:即执行<Dba>.configureLocalInstance(...)方法)有关详细信息,请参阅使用配置实例 dba.configureLocalInstance()

当针对远程实例运行时,换句话说,不是当前运行 MySQL Shell 的实例,如果实例支持自动持久化配置更改,则 AdminAPI 命令将配置更改持久化到实例的选项文件中mysql-auto.conf 。

如果远程实例不支持自动持久化配置更改,则 AdminAPI 命令无法自动配置实例的选项文件。因此,AdminAPI 命令可以从实例中读取信息,例如,显示当前配置。但是对配置的更改无法持久保存到实例的选项文件中。在这种情况下,您需要在本地保留更改。有关详细信息,请参阅 使用配置实例 dba.configureLocalInstance()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值