1

How can I check if a cluster setting is applied on server?

For example, I run --query "SET allow_experimental_live_view = 1" on my cluster. Which query should I use to check that this setting was changed? Is it possible to do with clickhouse-client command?

This question is similar but does not answer mine How to check whether Clickhouse server-settings is really applied?

vitaliis
  • 4,082
  • 5
  • 18
  • 40

1 Answers1

1

clickhouse-client has many options. Let's check them:

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

It needs to pass it this way:

clickhouse-client --allow_experimental_live_view 1

To check the current settings use:

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 │
└────────────────────────────────────────────┴───────┴─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────────┴─────────┘

To run this query around all cluster nodes see is there a better way to query system tables across a clickhouse cluster?.

vladimir
  • 13,428
  • 2
  • 44
  • 70
  • Hi @vladimir, if we do this clickhouse-client --allow_experimental_live_view 1 , does it apply to the current session or to the entire ch cluster? – sylvinho81 Apr 13 '22 at 12:19
  • Hi @sylvinho81, it be applied to the current session. To apply it persistently follow this one https://stackoverflow.com/a/65951690/303298 . – vladimir Apr 13 '22 at 20:05
  • So @vladimir, "clickhouse-client --allow_experimental_live_view 1" has the same effect than "SET allow_experimental_live_view = 1". So if I create a Live View within a specific session it not going to be available if other user opens an another session. is that what you mean? – sylvinho81 Apr 14 '22 at 13:21
  • @sylvinho81 You understood it right. – vitaliis Apr 28 '22 at 05:16