system.clusters

Contains information about clusters available in the config file and the servers in them.

Columns:

  • cluster (String) — The cluster name.
  • shard_num (UInt32) — The shard number in the cluster, starting from 1.
  • shard_weight (UInt32) — The relative weight of the shard when writing data.
  • replica_num (UInt32) — The replica number in the shard, starting from 1.
  • host_name (String) — The host name, as specified in the config.
  • host_address (String) — The host IP address obtained from DNS.
  • port (UInt16) — The port to use for connecting to the server.
  • is_local (UInt8) — Flag that indicates whether the host is local.
  • user (String) — The name of the user for connecting to the server.
  • default_database (String) — The default database name.
  • errors_count (UInt32) — The number of times this host failed to reach replica.
  • slowdowns_count (UInt32) — The number of slowdowns that led to changing replica when establishing a connection with hedged requests.
  • estimated_recovery_time (UInt32) — Seconds remaining until the replica error count is zeroed and it is considered to be back to normal.

Example

Query:

  1. SELECT * FROM system.clusters LIMIT 2 FORMAT Vertical;

Result:

  1. Row 1:
  2. ──────
  3. cluster: test_cluster_two_shards
  4. shard_num: 1
  5. shard_weight: 1
  6. replica_num: 1
  7. host_name: 127.0.0.1
  8. host_address: 127.0.0.1
  9. port: 9000
  10. is_local: 1
  11. user: default
  12. default_database:
  13. errors_count: 0
  14. slowdowns_count: 0
  15. estimated_recovery_time: 0
  16. Row 2:
  17. ──────
  18. cluster: test_cluster_two_shards
  19. shard_num: 2
  20. shard_weight: 1
  21. replica_num: 1
  22. host_name: 127.0.0.2
  23. host_address: 127.0.0.2
  24. port: 9000
  25. is_local: 0
  26. user: default
  27. default_database:
  28. errors_count: 0
  29. slowdowns_count: 0
  30. estimated_recovery_time: 0

See Also