MetaDB Status Check and Basic Maintenance
This document describes how to check the MetaDB status in a high-availability NineData deployment and collect the key information required for follow-up maintenance.
In HA deployments, MetaDB runs in Kubernetes. Routine checks are typically completed with kubectl together with mysql and mysqlsh.
Step 1: Confirm Kubernetes Access
Sign in to a Master node that can access the NineData Kubernetes cluster.
Run the following command to confirm that
kubectlis available:kubectl version --clientConfirm that the
jz-componentnamespace exists:kubectl get ns jz-component
Step 2: Confirm MetaDB Credentials and Instance Status
Check whether the MetaDB Secret exists:
kubectl get secret -n jz-component ninedata-pwdsCheck the MetaDB Pod status:
kubectl get pods -n jz-component -o wide | grep ninedata-meta-clusterIf you also want to view the planned instance count and current cluster state, run:
kubectl get innodbcluster -n jz-component ninedata-meta-cluster -o yamlParameter Notesinstancesis the planned MetaDB instance count.onlineInstancesis the number of instances currently online.statusdisplays the current cluster state, such asONLINE.
Step 3: Get the MetaDB Administrator Password
Run the following command to store the root password in an environment variable for the current shell session:
ROOT_PWD=$(kubectl get secret -n jz-component ninedata-pwds -o jsonpath='{.data.rootPassword}' | base64 -d)
The following commands can reuse this variable directly without manually copying the password.
Step 4: Check Basic Instance Information with MySQL
Run the following command to query the instance hostname, instance UUID, and read-only status:
kubectl exec -n jz-component ninedata-meta-cluster-0 -c mysql -- sh -lc \
"MYSQL_PWD='$ROOT_PWD' mysql -uroot -Nse \"select @@hostname as host, @@server_uuid as server_uuid, @@read_only as read_only;\""
In the returned result:
hostis the current MetaDB instance name.server_uuidis the unique identifier of the instance.read_only = 0means the current instance is writable.
Step 5: View Cluster Status with MySQL Shell
Run the following command to obtain the detailed InnoDBCluster status:
kubectl exec -n jz-component ninedata-meta-cluster-0 -c sidecar -- sh -lc \
"mysqlsh --js --user=root --password='$ROOT_PWD' --host=127.0.0.1 --port=3306 -e 'var s=dba.getCluster().status(); print(JSON.stringify(s, null, 2))'"
Focus on the following fields:
defaultReplicaSet.status: the current cluster state.statusText: the human-readable cluster status description.primary: the current Primary instance address.topology: the role, state, and version of each instance.
Step 6: Clear the Local Password Variable
After the check finishes, clear the password variable from the current shell session:
unset ROOT_PWD
Maintenance Recommendations
- Perform MetaDB checks on a Master node where
kubectlis available. - Before any high-risk maintenance action, review both the
innodbclusterinstance count and themysqlshcluster status output. - When MetaDB is deployed as a single instance, it does not tolerate failures. Plan related operations during a maintenance window.
- If you need multi-instance switchover, node rebuild, or topology adjustment, confirm the actual MetaDB deployment model first and then follow the matching maintenance procedure.