housepower / clickhouse_sinker

Easily load data from kafka to ClickHouse
https://housepower.github.io/clickhouse_sinker
Apache License 2.0
515 stars 118 forks source link

Http Server binding to ip:port #111

Closed josepowera closed 3 years ago

josepowera commented 3 years ago

We are running ClickHouse_Sinker on kubernetes.

When we start CHSinker we get in console: "Run http server http://10.42.2.253:2221"

Problem: after moving to Single Task per Process (in 1.8) we had to add image: vadv/prometheus-exporter-merger in order to consolidate all http metrics (for 20+ tasks) into one metric prometheus output. Consolidator (prometheus-exporter-merger) is running in same pod as all chsinker containers. We normally configure consolidator running in same pod as connecting to localhost. example: value: 'http://localhost:2221/metrics,type:chs_chsinkertask1'

However in case of ChSinker we see that ChSinker binds to Specific IP:PORT not to anyIP:port

selfIP = util.GetOutboundIP().String()
log.Error(http.ListenAndServe(selfAddr, mux))

Is there any special reason to have IP:port bindings (except that it is nice to see IP) and not general port only (http.ListenAndServe(":2121", nil))

yuzhichang commented 3 years ago

Good suggestion!