Documentation Home
MySQL Shell for VS Code


MySQL Shell for VS Code  /  ...  /  InnoDB Cluster Methods

Pre-General Availability: 2023-01-18

5.6.2 InnoDB Cluster Methods

The Cluster object is the entry point to manage and monitor a MySQL InnoDB Cluster.

A cluster is a set of MySQL Server Instances that hold your data. A cluster provides high-availability and scalability for your data.

The following table provides a list of the available InnoDB Cluster Python Methods.

InnoDB Cluster Method Description
add_instance() Adds an Instance to the InnoDB Cluster.
check_instance_state() Verifies the instance global transaction ID (GTID) for short state in relation to the InnoDB Cluster.
create_cluster_set() Creates a MySQL InnoDB ClusterSet from an existing standalone InnoDB Cluster.
describe() Describe the structure of the InnoDB Cluster.
disconnect() Disconnects all internal sessions used by the InnoDB Cluster object.
dissolve() Dissolves the InnoDB Cluster.
fence_all_traffic() Fences an InnoDB Cluster from All Traffic.
fence_writes() Fences an InnoDB Cluster from Write Traffic.
force_quorum_using_partition_of() Restores the InnoDB Cluster from quorum loss.
get_cluster_set() Returns an object representing a InnoDB ClusterSet.
get_name() Retrieves the name of the InnoDB Cluster.
help() Provides help about this class and it’s specified member.
list_routers() Lists the Router instances.
options() Lists the InnoDB Cluster configuration options.
rejoin_instance() Rejoins an Instance to the Cluster.
remove_instance() Removes an Instance from the Cluster.
remove_router_metadata() Removes metadata for a Router instance.
rescan() Re-scans the Cluster.
reset_recovery_accounts_password() Reset the password of the recovery accounts of the InnoDB Cluster.
set_instance_option() Changes the value of an option in an InnoDB Cluster member.
set_option() Changes the value of an option for the entire InnoDB Cluster.
set_primary_instance() Elects a specific InnoDB Cluster member as the new primary.
setup_admin_account() Create or upgrade an InnoDB Cluster admin account.
setup_router_account() Create or upgrade a MySQL account to use with MySQL Router.
status() Describe the status of the InnoDB Cluster.
switch_to_multi_primary_mode() Switches the InnoDB Cluster to multi-primary mode.
switch_to_single_primary_mode() Switches the InnoDB Cluster to single-primary mode.
unfence_writes() Un-fences an InnoDB Cluster.

You can find more help about a specific method by using the cluster.help command. For example, to see the help details about the unfence_writes method for the InnoDB Cluster assigned to the cluster1 variable, type:

Python

cluster1.help("unfence_writes")

JavaScript

cluster1.help("unfenceWrites")