0

Is a 2 nodes Clickhouse setup possible? If yes would it be bad or unreasonable?

Most tutorials require a 3 node setup. For example the official documentation: https://clickhouse.com/docs/en/guides/sre/keeper/clickhouse-keeper

I found this example with a two node setup and not sure if it's a good idea. https://kb.altinity.com/altinity-kb-setup-and-maintenance/altinity-kb-zookeeper/clickhouse-keeper/

The alternative would be to use the second server for backups (with https://github.com/AlexAkulov/clickhouse-backup) but would prefer a replication setup.

Thanks for any hint!

MichaelRazum
  • 789
  • 1
  • 10
  • 26

2 Answers2

1

3 clickhouse-keeper nodes require for avoid split brain situation when connection between servers lost and each server will think - i'm leader

so, you just can setup two nodes clickhouse-server + 1 separatelly clickhouse-keeper and use Engine=ReplicatedMergeTree

Slach
  • 1,672
  • 13
  • 21
  • Got it. So 3 servers are the way to go. Would each server hold the whole data? Guess will maybe go with the backup solution. Since the second server is only needed for a hardware failure. – MichaelRazum Jul 24 '22 at 11:08
  • each server could clickhouse implements multi-master replication but not have unique contrains check and have only block level deduplication for ReplicatedMergeTree so you shall care about which data will insert to each node – Slach Jul 25 '22 at 06:39
0

I found this example with a two node setup and not sure if it's a good idea.

I made this example. Some people use this in production, and they are happy, though their ingestion rate is very low.

2 nodes is not a problem ( split brain is impossible with Keeper and Zookeeper ). But with 2 nodes of Keeper or Zookeeper you don't HighAvailability, if one node on Keeper is down, the second node stops to serve requests and Replicated tables in ClickHouse became readonly on all replicas.

Embedded Keeper or Keeper on the same server with ClickHouse is a bad idea if you have heavy loaded system with a high ingestion rate. ClickHouse server utilizes all CPU and all I/O, so Keeper or Zookeeper produce timeout errors because they starve for CPU and especially I/O (disk is too slow for them).

Denny Crane
  • 11,574
  • 2
  • 19
  • 30