Professional Documents
Culture Documents
All About Zookeeper and ClickHouse Keeper
All About Zookeeper and ClickHouse Keeper
(and ClickHouse
Keeper, too!)
Robert Hodges and Altinity Engineering
30 March 2022
Copyright © Altinity,
© 2022 AltinityInc.
Inc 2022 1
Let’s make some introductions
. . .
Consistent ON zookeeper-1
CLUSTER commands,
replicated table parts zookeeper-0 zookeeper-2
ZooKeeper Ensemble
ZooKeeper
Servers on zookeeper-0 zookeeper-1 zookeeper-2
Port :2181
Leader
Leader must maintain a
Leader coordinates writes zookeeper-0
quorum of followers
Follower Follower
events_local
zookeeper default
0
tables log
/ first
quorum
clickhouse
replicas
task_queue
...
query
Znode
query-0000 DROP TABLE IF EXISTS
000000 default.events_local ON
CLUSTER first
© 2022 Altinity, Inc. 11
What kind of ClickHouse information is stored in znodes?
● Tasks
○ Pending and completed ON CLUSTER DDL commands
● Table information
○ Schema information
○ Replicas
○ Leader elections used to control merges and mutations
○ Log of operations on the table (insert, merge, delete partition, etc.)
○ Parts contained in each replica
○ Last N blocks inserts so we can deduplicate data
○ Data to ensure quorum on writes
1 2 3 4 5
Row 1:
──────
name: clickhouse
value: Path value is required!
czxid: 4294967298
mzxid: 4294967298
ctime: 2021-12-08 01:54:50
mtime: 2021-12-08 01:54:50 If this query works, ClickHouse
. . . can see ZooKeeper!
path: /
● Use check_zookeeper.pl
ZooKeeper Connection
ClickHouse ZooKeeper
Consistent ON ch-keeper-1
CLUSTER commands,
replicated table parts ch-keeper-0 ch-keeper-2
keeper-2 keeper-3
events events
_local _local
clickhouse-1 clickhouse-2
ClickHouse
Keeper /var/lib/clickhouse/coordination
In-RAM
snapshots Snapshots
copy of
Znode
Tree
Questions?
https://altinity.com info@altinity.com
Copyright © Altinity,
© 2022 AltinityInc.
Inc 2022 45