Open chaos827 opened 5 days ago
It's 2 different problems. Replication doesn't care about remote_servers configuration, you need to check/fix interserver_http_host parameter instead. (and make sure that port 9009 is exposed)
hi @UnamedRus, thank you for sharing the suggestion. I updated my yaml to config the interserver_http_host parameter, however I tried serval ways, but the replica is still not work, this my new part in the yaml config.d/interserver_http_host.xml:
also I double confirmed the port 9009 already exposed, and I found some logs, seems it is related to dn servers
2024.11.04 10:43:21.593349 [ 764 ] {}
@chaos827 , why do you need external IPs for replication? Are you sure it is routable at all?
One thing to try is to use FQDN for replicas, maybe it will help, but what you are doing sounds strange in general
spec:
defaults:
replicasUseFQDN: "yes"
yes it is weird, because I want to set up ClickHouse cross region (cross AKS), the pod IP is dynamic, so I have to create Load Balance service for each replica.
I created a 2 * 2 ClickHouse DB (2 Shards and each Shard has 2 replicas) using ClickHouse-Operator and azure Kubernetes(AKS), meanwhile I created load balance services for each replica (each pod has its own load balance service and unique external IP), it works well. After that I updated the remote_servers xml file using the external ip instead of hostname, in this way the distribute query (i.e: create database TestDB on CLUSTER '{cluster}' ENGINE = Atomic) is not worked on the pod which with external ip, also the ReplicatedMergreeTree is not synced the data in the same pod, but the pod work well when I used HostName or Pod Ip, below is my remote_servers configuration in the yaml,
config.d/remote_servers.xml:
I did this test beacuse I want to set up the ClickHouse in the different data center (replica1 in primary and replica2 in the geolocation), so I have to split the ClickHouse in the two AKS, and using external ip to communicate, but I do not undershand why my yaml is not work, does someone know the root causes? many thanks!