A
A
Andrey Pavlenko2021-09-09 19:00:56
System administration
Andrey Pavlenko, 2021-09-09 19:00:56

What is the best way to set up two-server replication without sharding for Clickhouse?

Good afternoon!
I plan to raise three instances of Zookeeper and "synchronize" them with each other (so that there is agreement between them).
Then - raise two instances of ClickHouse on two servers.
And here is the question: is it necessary to configure the Clickhouse cluster with each other at all, if the servers, as I understand it, should be synchronized with each other using ZooKeeper?
That is, as I understand it, in theory, I should add one cluster inside remote_servers, one shard inside it, and two replicas inside the shard.
But then I thought, if ClickHouse will be synchronized with each other using ZooKeeper, then does it make sense for them to know about the existence of each other if they work exclusively as replicas? Or is it desirable to specify them in the config for some purpose that I don't know about?

Well, accordingly, if for some reason they still need to be specified in remote_servers, then should I indicate that they are part of a single shard, or can I write the xml tag of two replicas directly inside the cluster and explicitly indicate that they are inside " single shard" - I don't need it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-09-09
@Akdmeh

And here is the question: is it necessary to configure the Clickhouse cluster with each other at all, if the servers, as I understand it, should be synchronized with each other using ZooKeeper?

When reading the documentation, it led me to exactly the same thought, but no - in zookeper, only meta-information is added about the operations performed with the database and on which server it was performed. In fact, other hosts contact each other directly for data.
If sharding is not used, then nothing needs to be written to the configuration file - only the zookeeper configuration. They will find each other through him.
Further replication configuration is configured at the level of database engines

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question