微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

查询Clickhouse以获取当前安装的版本

如何解决查询Clickhouse以获取当前安装的版本

我知道有很多系统表。如果可以访问那些文件,我可以在哪里找到当前安装的版本?

解决方法

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
# ..

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。