我知道有很多系统表,如果有人可以访问这些表,那么我在哪里可以找到当前安装的版本?
SELECT version()
┌─version()───┐
│ 20.9.1.4571 │
└─────────────┘
SELECT *
FROM system.build_options
┌─name──────────────────────┬─value────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ VERSION_FULL │ ClickHouse 20.9.1.4571 │
│ VERSION_DESCRIBE │ v20.9.1.4571-testing
只需要通过HTTP就可以得到CH版本的另外两种方式:
# send the wrong query to standard CH endpoint to find the version at the end of the response
http://ch_server_hostname_or_ip:8123/?query=hello
# depends on the access settings you get
# either 'Code: 62, .. Exception: Syntax error .. (version 20.3.12.112 (official build))'
# or 'Code: 516, .. Authentication failed .. (version 20.3.12.112 (official build))'
# look at Prometheus-endpoint that contains the required metric
http://ch_server_hostname_or_ip:custom_port/metrics
# ..
# ClickHouseMetrics_VersionInteger 20003012
# ..