Closed yahor-ivanou closed 2 years ago
I think you properly identified a bug. You can statically define the hosts using "multi host" setup.
Pull requests for a fix would also be accepted.
Hi,
Sorry for the late reply. I'll look into this this week. But to me, having a cluster with 3 production nodes and 1 localhost doesn't seem right. That said, I'll look into it.
I would agree with @lwolters the fact that CH returns 127.0.0.1
is an incorrect configuration somewhere in the CH cluster, maybe remote_servers
or listen_host
are not configured correctly. The crobox client cannot do much about this since well it's a client.
I am trying to use Crobox Clickhouse Client along with Clickhouse cluster configuration(2 shards with 2 replicas). When Clickhouse Client is starting, I am getting the error saying that Clickhouse Client is not able to connect to the host 127.0.0.1. After looking into the source code of
ClusterConnectionFlow
it turned out that client is sending the following query to some Clickhouse replica:SELECT host_address FROM system.clusters WHERE cluster='$cluster'
which in fact returns the following result: 127.0.0.1 10.244.106.15 10.244.5.26 10.244.3.2The fact that 127.0.0.1 is returned is expected behaviour of CH cluster according to the answers from CH team from yandex: the replica has loopback address as
host_address
for itself.How should I use crobox client for cluster setup then?