Documentation Home
MySQL Shell for VS Code


Pre-General Availability: 2024-03-18

5.6 AdminAPI

AdminAPI of MySQL Shell includes several classes, implemented in JavaScript and Python, which you can use to develop code that interacts with MySQL. AdminAPI also provides operations to configure users for MySQL Router, to make integration with InnoDB Cluster, InnoDB ClusterSet, and InnoDB ReplicaSet as simple as possible.

The dba global object

The dba global object provides an entry point for creating, configuring, and obtaining the other InnoDB objects in AdminAPI.

InnoDB Object Administrative Actions
Cluster The dba.configureInstance() JavaScript method or the dba.configure_instance() Python method can be used to configure a MySQL instance with the settings required to use it in an InnoDB Cluster.

InnoDB Clusters can be created with the dba.createCluster() JavaScript method or the dba.create_cluster() Python method.

InnoDB Cluster management objects can be obtained with the dba.getCluster() JavaScript method or the dba.get_cluster() Python method.

ClusterSet ClusterSets can be created with the cluster.createClusterSet() JavaScript method or the cluster.create_cluster_set() Python method.

When created, InnoDB ClusterSet management objects can be obtained with the dba.getClusterSet() or cluster.getClusterSet() JavaScript methods, the dba.get_cluster_set() or cluster.get_cluster_set() Python methods.

ReplicaSet The dba.configureReplicaSetInstance() JavaScript method or the dba.configure_replica_set_instance() Python method can be used to configure a MySQL instance with the settings required to use it in an InnoDB ReplicaSet.

InnoDB ReplicaSets can be created with the dba.createReplicaSet() JavaScript method or the dba.create_replica_set() Python method.

InnoDB ReplicaSet management objects can be obtained with the dba.getReplicaSet() JavaScript method or the dba.get_replica_set() Python method.

InnoDB Cluster

InnoDB Cluster provides an integrated solution for high availability and scalability using InnoDB based MySQL databases. InnoDB Cluster is an alternative solution for using Group Replication, without requiring advanced MySQL expertise.

Each MySQL server instance in an InnoDB Cluster runs MySQL Group Replication, which provides the mechanism to replicate data within an InnoDB Cluster, with built-in failover. AdminAPI removes the need to work directly with Group Replication in an InnoDB Cluster. You can also set up InnoDB ClusterSet to provide disaster tolerance for InnoDB Cluster deployments by linking a primary InnoDB Cluster with one or more replicas of itself in alternate locations, such as different datacenters.

For more information, see InnoDB Cluster.

InnoDB ClusterSet

InnoDB ClusterSet provides disaster tolerance MySQL InnoDB Cluster deployments by linking a primary InnoDB Cluster with one or more replicas of itself in alternate locations.

Emergency failover between the primary InnoDB Cluster and a replica cluster in an InnoDB ClusterSet deployment can be triggered by an administrator through MySQL Shell, using AdminAPI, which is included with MySQL Shell. You can also carry out a controlled switchover from the primary cluster to a replica cluster while the primary cluster is still available, for example if a configuration change, or you require maintenance on the primary cluster.

For more information, see InnoDB ClusterSet.

InnoDB ReplicaSet

InnoDB ReplicaSet enables you to administer a set of MySQL instances running asynchronous Global Transaction ID (GTID)-based replication.

An InnoDB ReplicaSet consists of a single primary and multiple secondaries, referred to as the MySQL replication source and replicas). You administer your ReplicaSets using a ReplicaSet object and the AdminAPI operations, for example to check the status of the InnoDB ReplicaSet, and manually failover to a new primary in the event of a failure.

For more information, see InnoDB ReplicaSet.