User-defined Playground

ClickHouse Keeper Cluster Playground

A C++ coordination service designed to replace Apache ZooKeeper

Startup configuration
clickhouse-keeper-1
clickhouse-keeper-2
clickhouse-keeper-3
ClickHouse Keeper Cluster playground: A C++ coordination service designed to replace Apache ZooKeeper

This is a playground to help you play with ClickHouse Keeper, which is an alternative to Apache ZooKeeper

ClickHouse Keeper is written in C++. It's open-source coordination that scales

clickhouse-keeper-vs-zookeeper

Getting started

The ClickHouse Keeper Servers are already running in cluster mode - with 3 nodes, where one is a leader and the other two are followers

To interact with the ClickHouse Keeper Server, you can use the ClickHouse Keeper Client (clickhouse-keeper-client) like this

clickhouse-keeper-client

For help, type help in the client console

Some more things you can do - for example you check if the server is up and running -

# Health Check - ("Are you OK?")
echo ruok | nc -v localhost 9181; echo

# Detailed server stats
echo stat | nc -v localhost 9181; echo

# Server information
echo srvr | nc -v localhost 9181; echo

# Monitoring metrics. `mntr` stands for Monitor
echo mntr | nc -v localhost 9181; echo

# Client connections
echo cons | nc -v localhost 9181; echo

# Active configuration
echo conf | nc -v localhost 9181; echo

# Disk usage information
echo dirs | nc -v localhost 9181; echo

# Is server read-only?
echo isro | nc -v localhost 9181; echo

The ClickHouse Keeper Server is being run as a systemd service. To check more, check

systemctl status clickhouse-keeper.service

cat /usr/lib/systemd/system/clickhouse-keeper.service

To see the all the files related to the ClickHouse Keeper, check here:

sudo ls -al /var/lib/clickhouse-keeper/

sudo ls -al /var/run/clickhouse-keeper/

sudo ls -al /var/log/clickhouse-keeper/

sudo ls -al /etc/clickhouse-keeper/

More details about ClickHouse Keeper is below. The details are from the official website

ClickHouse Keeper solves the well-known drawbacks of ZooKeeper and makes many additional improvements.

Coordination without the drawbacks. In order to overcome some shortcomings of ZooKeeper, we (ClickHouse team) started building a ClickHouse native Keeper from scratch based on our own requirements, optimized for usage in ClickHouse.

Benefits?

  • Easier setup and operation
  • No overflow issues
  • Better compression
  • Faster recovery
  • Less memory used
  • Additional guarantees

Is ClickHouse Keeper a replacement for ZooKeeper? ClickHouse Keeper is a drop-in replacement for ZooKeeper written in C++, with a fully compatible client protocol and the same data model, and features these improvements

  • Compatible client protocol (all clients work out of the box)
  • The same state machine (data model)
  • Better guarantees (optionally allows linearizable reads)
  • Uses Raft algorithm (NuRaft implementation)
  • Optional TLS for clients and internal communication

When to use ClickHouse Keeper?

  • Most of your request are writes
  • Efficient memory utilization matters
  • Your project isn’t part of the Java ecosystem
  • You are managing a ClickHouse cluster

When NOT to use ClickHouse Keeper?

  • Most of your request are reads
  • You require scalability with a read-heavy workload
  • Java-based components are important to you

Keep your system afloat with RAFT!

ZooKeeper implementation: ZooKeeper is implemented in Java and its coordination algorithm, ZooKeeper Atomic Broadcast (ZAB), doesn't provide linearizability guarantees for reads.

ClickHouse Keeper implementation: Unlike ZooKeeper, ClickHouse Keeper is written in C++ and uses the RAFT algorithm implementation. This algorithm allows linearizability for reads and writes, and has several open-source implementations in different languages.

References:

Start
Settings