Introspect cluster status
The /clusterStatus
resource gives you information about the status of all
ksqlDB servers in a ksqlDB cluster, which can be useful for troubleshooting.
Enable this endpoint by setting ksql.heartbeat.enable
to true
. Optionally, you can also set ksql.lag.reporting.enable
to true
to have your ksqlDB servers report state store lag, which will
then also be returned with the response from the /clusterStatus
endpoint.
Note
ksqlDB servers in a cluster discover each other through persistent queries.
If you have no persistent queries running, then the /clusterStatus
endpoint
contains info for the particular server that was queried, rather than
all servers in the cluster.
You can use the curl
command to query the /clusterStatus
endpoint
for a particular server:
1 |
|
The response object contains a clusterStatus
field with the following
information for each ksqlDB server (represented as host:port
):
- hostAlive (boolean): whether the server is alive, as determined by heartbeats received by the queried server
- lastStatusUpdateMs (long): epoch timestamp, in milliseconds, for when the last status update was received for this server, by the queried server
- activeStandbyPerQuery (object): for each query ID, a collection of active and standby partitions and state stores on this server
- hostStoreLags (object): state store lag information. Empty unless
ksql.lag.reporting.enable
is set totrue
. - hostStoreLags.stateStoreLags (object): partition-level lag breakdown for each state store.
- hostStoreLags.updateTimeMs (long): epoch timestamp, in milliseconds, for when the last lag update was received for this server, by the queried server
For a two-node cluster running a single CREATE TABLE ... AS SELECT
query,
with lag reporting enabled, your output should resemble:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|