MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL InnoDB Cluster – Changing cluster options "live"

As listed in the release announcement of the latest MySQL InnoDB Cluster release, 8.0.14 brings exciting new features! This blog post integrates a series detailing every single new feature added. We’ll follow up now with two very desired and useful features: Checking current cluster configuration options” and “Changing cluster members or global cluster options ‘live'”.

Checking current cluster configuration options

MySQL InnoDB cluster has always been focused on usability and flexibility. Thus, we have not only been improving the user experience overall but also introducing new features and capabilities to allow the full advanced control and personalization of clusters.

As you could notice throughout the releases of InnoDB Clusters, several new optional configurations have been introduced. The AdminAPI allows advanced users to make use of those configurations whenever setting up clusters. However, up to now, it was not possible to consult the current settings in place for an online cluster through the AdminAPI. Users would have to understand and learn about each configuration setting in order to query the internal MySQL tables to obtain the desired information. This is certainly not acceptable in our vision of usability and ease-of-use.

To overcome that, we have introduced a new function to list the current settings of a cluster:

  • <Cluster.>options()

This function lists the cluster configuration options for its ReplicaSets and Instances. The output follows the JSON fashion likewise the <Cluster.>status() command and provides the following information:

  • Cluster name
  • Default ReplicaSet global options
  • ReplicaSet topology tree with the options of each member

Changing cluster members or global cluster options “live”

Advanced users surely want to personalize and use the full capabilities of MySQL InnoDB cluster. Through the AdminAPI they are given that possibility, however, what if the use-case for a cluster changes? Or what if the requirements switch dramatically? Or even what if the network changed and the settings must be tweaked to overcome some limitation?

Up to now, changing any cluster member option required the removal of it from the cluster and further re-addition with the desired option. Even worse, if a general cluster option needed to be changed it wasn’t possible to do it unless the cluster was completely dissolved and re-created with the new options. Such behavior is certainly undesired and is most probably unacceptable in many scenarios.

With this release, we introduce a huge improvement in regard to this matter. We have introduced two new commands to allow changing a configuration option for a whole cluster or for a cluster member while the cluster and its members remain fully online and there’s absolutely no disruption of its operation.

The following functions were added to the AdminAPI:

  • <Cluster.>setOption(option, value)

This new command changes an InnoDB Cluster configuration option in all members of the cluster.

The accepted values for the configuration option are:

  • clusterName: string value to define the cluster name.
  • exitStateAction: string value indicating the group replication exit state action.
  • memberWeight: integer value with a percentage weight for the automatic primary election on failover.
  • failoverConsistency: string value indicating the consistency guarantees for primary failover in single primary mode.
  • expelTimeout: integer value to define the time period in seconds that cluster members should wait for a non-responding member before evicting it from the cluster.

WARNING: Changing the Cluster's Name requires a re-bootstrap of the Routers, otherwise, Routers won't recognize the Cluster.

  • <Cluster.>setInstanceOption(instance, option, value)

This function changes an option in a member of an InnoDB Cluster.

The accepted values for the configuration option are:

  • label: a string identifier of the instance.
  • exitStateAction: string value indicating the group replication exit state action.
  • memberWeight: integer value with a percentage weight for the automatic primary election on failover.

Try it now and send us your feedback

MySQL Shell 8.0.14 GA is available for download from the following links.

The documentation of MySQL Shell can be found in https://dev.mysql.com/doc/mysql-shell/8.0/en/ and the official documentation of InnoDB cluster can be found in the MySQL InnoDB Cluster User Guide.

Enjoy, and Thank you for using MySQL!