3.5. Monitoring consensus latency for etcd
By using the etcdctl CLI, you can monitor the latency for reaching consensus as experienced by etcd. You must identify one of the etcd pods and then retrieve the endpoint health.
This procedure, which validates and monitors cluster health, can be run only on an active cluster.
Prerequisites
- During planning for cluster deployment, you completed the disk and network tests.
Procedure
Enter the following command:
# oc get pods -n openshift-etcd -l app=etcdExample output
NAME READY STATUS RESTARTS AGE etcd-m0 4/4 Running 4 8h etcd-m1 4/4 Running 4 8h etcd-m2 4/4 Running 4 8hEnter the following command. To better understand the etcd latency for consensus, you can run this command on a precise watch cycle for a few minutes to observe that the numbers remain below the ~66 ms threshold. The closer the consensus time is to 100 ms, the more likely the cluster will experience service-affecting events and instability.
# oc exec -ti etcd-m0 -- etcdctl endpoint health -w tableExample output
+----------------------------+--------+-------------+-------+ | ENDPOINT | HEALTH | TOOK | ERROR | +----------------------------+--------+-------------+-------+ | https://198.18.111.12:2379 | true | 3.798349ms | | | https://198.18.111.14:2379 | true | 7.389608ms | | | https://198.18.111.13:2379 | true | 6.263117ms | | +----------------------------+--------+-------------+-------+Enter the following command:
# oc exec -ti etcd-m0 -- watch -dp -c etcdctl endpoint health -w tableExample output
+----------------------------+--------+-------------+-------+ | ENDPOINT | HEALTH | TOOK | ERROR | +----------------------------+--------+-------------+-------+ | https://198.18.111.12:2379 | true | 9.533405ms | | | https://198.18.111.13:2379 | true | 4.628054ms | | | https://198.18.111.14:2379 | true | 5.803378ms | | +----------------------------+--------+-------------+-------+