Documentation Home
MySQL Shell 8.3
Related Documentation Download this Manual
PDF (US Ltr) - 2.3Mb
PDF (A4) - 2.3Mb


MySQL Shell 8.3  /  ...  /  Monitoring Read Replicas

7.11.4 Monitoring Read Replicas

This section describes how to monitor your Read Replicas, view topologies, and so on.

Status

For detailed information on the Cluster.status() method, see Section 7.7, “Monitoring InnoDB Cluster”.

Read Replica information is listed in the readReplicas section of each source. In the following example, the Cluster primary, host1:4100 is the replication source for three Read Replicas, host4:4110, host5:4120, and host6:4130:

        "topology": {
            "host1:4100": {
                "address": "host1:4100",
                "memberRole": "PRIMARY",
                "mode": "R/W",
                "readReplicas": {
                    "RReplica1": {
                        "address": "host4:4110",
                        "role": "READ_REPLICA",
                        "status": "ONLINE",
                        "version": "8.1.0"
                    },
                    "RReplica2": {
                        "address": "host5:4120",
                        "role": "READ_REPLICA",
                        "status": "ONLINE",
                        "version": "8.1.0"
                    },
                    "RReplica3": {
                        "address": "host6:4130",
                        "role": "READ_REPLICA",
                        "status": "ONLINE",
                        "version": "8.1.0"
                    }
                },
                "replicationLag": "applier_queue_applied",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.1.0"
            },

The Read Replicas are listed according to the label defined when they were added to the Cluster, or by host:port if no label was provided.

The Read Replica-specific fields are as follows:

  • For Cluster.status():

    • address: The Read Replica's address.

    • role: READ_REPLICA.

    • status: contains one of the following statuses:

      • ONLINE: Replication channel connected and running.

      • CONNECTING: Replication channel connecting.

      • OFFLINE: Replication channel stopped gracefully.

      • ERROR: Replication channel stopped due to a replication error.

      • UNREACHABLE: MySQL Shell cannot connect to the Read Replica.

    • version: The MySQL Server version.

    • instanceErrors: List of diagnostic errors if at least one error has occurred.

  • For Cluster.status({extended: 1}):

    • applierStatus: Applier thread status.

    • applierThreadState: Applier thread current state.

    • applierWorkerThreads: Number of applier worker threads.

    • receiverStatus: Receiver thread status.

    • receiverThreadState: Current state of the receiver thread.

    • replicationLag: replication lag.

    • replicationSources: Lists the replication sources for the Read Replica, ordered by weight. Or, if the Read Replica was configured to replicate from the Primary, PRIMARY, or SECONDARY if the Read Replica was configured to replicate from the Secondary.

    • replicationSsl: Lists the current SSL cipher and the SSL version, if enabled.

  • For Cluster.status({extended: 2}):

    • applierQueuedTransactionSet: Applier queue GTID set.

    • applierQueuedTransactionSetSize: Applier queue size.

    • coordinatorState: Coordinator state.

    • coordinatorThreadState: Current state of coordinator thread.

    • receiverTimeSinceLastMessage: Time since last message received by I/O thread.

    • replicationSources: Lists the IP addresses and port numbers of the configured replication sources for the Read Replica, ordered by weight.

  • For Cluster.status({extended: 3}):

    • options: an array of the following configured options:

      • delay: Replication delay.

      • heartbeatPeriod: Heartbeat interval.

      • retryCount: Retry count.

      • connectRetry: connectRetry

Describe

Cluster.describe() returns the following for Read Replicas:

  • address: the address of the Read Replica.

  • label: the label provided when the Read Replica was created.

  • replicationSources: The Read Replica's replication source, PRIMARY or SECONDARY.

  • role: READ_REPLICA

         {
                "address": "127.0.0.1:4110",
                "label": "RReplica1",
                "replicationSources": [
                    "PRIMARY"
                ],
                "role": "READ_REPLICA"
            },
            {
                "address": "127.0.0.1:4120",
                "label": "RReplica2",
                "replicationSources": [
                    "PRIMARY"
                ],
                "role": "READ_REPLICA"
            },