【问题标题】:Check if a setting was applied with clickhouse-client检查是否使用 clickhouse-client 应用了设置
【发布时间】:2021-09-24 18:58:46
【问题描述】:

如何检查服务器上是否应用了集群设置?

例如, 我在集群上运行--query "SET allow_experimental_live_view = 1"。 我应该使用哪个查询来检查此设置是否已更改?是否可以使用 clickhouse-client 命令?

这个问题很相似,但没有回答我的How to check whether Clickhouse server-settings is really applied?

【问题讨论】:

    标签: clickhouse clickhouse-client


    【解决方案1】:

    clickhouse-client 有很多选项。让我们检查一下:

    clickhouse-client --help
    
    ...
      --allow_experimental_live_view arg                               Enable LIVE VIEW. Not mature enough.
      --live_view_heartbeat_interval arg                               The heartbeat interval in seconds to indicate live query is alive.
      --max_live_view_insert_blocks_before_refresh arg                 Limit maximum number of inserted blocks after which mergeable blocks are dropped and query is re-executed.
    ...
    

    需要这样传递:

    clickhouse-client --allow_experimental_live_view 1
    

    要检查当前设置,请使用:

    SELECT *
    FROM system.settings
    WHERE name LIKE '%_live_%'
    
    ┌─name───────────────────────────────────────┬─value─┬─changed─┬─description────────────────────────────────────────────────────────────────────────────────────────────────┬─min──┬─max──┬─readonly─┬─type────┐
    │ tcp_keep_alive_timeout                     │ 0     │       0 │ The time in seconds the connection needs to remain idle before TCP starts sending keepalive probes         │ ᴺᵁᴸᴸ │ ᴺᵁᴸᴸ │        0 │ Seconds │
    │ allow_experimental_live_view               │ 1     │       1 │ Enable LIVE VIEW. Not mature enough.                                                                       │ ᴺᵁᴸᴸ │ ᴺᵁᴸᴸ │        0 │ Bool    │
    │ max_live_view_insert_blocks_before_refresh │ 64    │       0 │ Limit maximum number of inserted blocks after which mergeable blocks are dropped and query is re-executed. │ ᴺᵁᴸᴸ │ ᴺᵁᴸᴸ │        0 │ UInt64  │
    │ temporary_live_view_timeout                │ 5     │       0 │ Timeout after which temporary live view is deleted.                                                        │ ᴺᵁᴸᴸ │ ᴺᵁᴸᴸ │        0 │ Seconds │
    │ periodic_live_view_refresh                 │ 60    │       0 │ Interval after which periodically refreshed live view is forced to refresh.                                │ ᴺᵁᴸᴸ │ ᴺᵁᴸᴸ │        0 │ Seconds │
    └────────────────────────────────────────────┴───────┴─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────────┴─────────┘
    

    要围绕所有集群节点运行此查询,请参阅is there a better way to query system tables across a clickhouse cluster?

    【讨论】:

      猜你喜欢
      • 2021-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-05-11
      相关资源
      最近更新 更多