Hi everyone,
I have just began using Clickhouse on a Cluster and had a few doubts .
I have 2 shards and two replicas with my config file as :
<remote_servers>
<HouseCluster>
<shard>
<!-- Optional. Shard weight when writing data. By default, 1. -->
<weight>1</weight>
<!-- Optional. Whether to write data to just one of the replicas. By default, false - write data to all of the replicas. -->
<internal_replication>false</internal_replication>
<replica>
<host>server1</host>
<port>9000</port>
</replica>
<replica>
<host>server2</host>
<port>9000</port>
</replica>
<replica>
<host>server3</host>
<port>9000</port>
</replica>
</shard>
<shard>
<!-- Optional. Shard weight when writing data. By default, 1. -->
<weight>1</weight>
<!-- Optional. Whether to write data to just one of the replicas. By default, false - write data to all of the replicas. -->
<internal_replication>false</internal_replication>
<replica>
<host>server1</host>
<port>9000</port>
</replica>
<replica>
<host>server2</host>
<port>9000</port>
</replica>
<replica>
<host>server3</host>
<port>9000</port>
</replica>
</shard>
</HouseCluster>
</remote_servers>
To understand how clickhouse works on a cluster, I created a similar table in each of the server and a distributed table on one of the server, however when I insert a record into the distributed table, two copies are created into the distributed table instead of one, why is that so ?
Also I am confused about replicas, if I want to use zookeeper is it necessary to define macros for each server . In my case, I have replica for each shard on each of the server
How would my macros look in that case as each server has two shards .
Thanks .