1. How do I make sure that a resource is ready?
Assume that you want to view the resource status of a cluster. Run the following command:
kubectl get obclusters.oceanbase.oceanbase.com test -n oceanbase
If the status is running in the response, the resource is ready.
# desired output
NAME STATUS AGE
test running 6m2s
2. How do I view the O&M status of a resource?
Assume that you want to view the resource status of a cluster. Run the following command:
kubectl get obclusters.oceanbase.oceanbase.com test -n oceanbase -o yaml
You can check the status and progress of O&M tasks based on values of parameters in the operationContext section in the response.
status:
image: oceanbase/oceanbase-cloud-native:4.2.0.0-101000032023091319
obzones:
- status: delete observer
zone: obcluster-1-zone1
- status: delete observer
zone: obcluster-1-zone2
- status: delete observer
zone: obcluster-1-zone3
operationContext:
failureRule:
failureStatus: running
failureStrategy: retry over
idx: 2
name: modify obzone replica
targetStatus: running
task: wait obzone topology match
taskId: c04aeb28-01e7-4f85-b390-8d855b9f30e3
taskStatus: running
tasks:
- modify obzone replica
- wait obzone topology match
- wait obzone running
parameters: []
status: modify obzone replica
3. How do I do troubleshooting for ob-operator and OceanBase?
- Generally, you need to first analyze the logs of ob-operator to locate an error. Run the following command to view the logs of ob-operator:
kubectl logs oceanbase-controller-manager-86cfc8f7bf-js95z -n oceanbase-system -c manager | less
- View the logs of the OBServer node
# Log on to the container of the OBServer node.
kubectl exec -it obcluster-1-zone1-8ab645f4d0f9 -n oceanbase -c observer -- bash
# The directory where the log files are located.
cd /home/admin/oceanbase/log