From aca7950cb9fe8b2d4f13436a2b19d2a0e4f0d08b Mon Sep 17 00:00:00 2001 From: YenchangChan Date: Wed, 17 Apr 2024 09:46:50 +0800 Subject: [PATCH] perf: http-port conflicts when more than 1 instance running on a machine --- cmd/clickhouse_sinker/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/clickhouse_sinker/main.go b/cmd/clickhouse_sinker/main.go index e95e321e..fcc904e5 100644 --- a/cmd/clickhouse_sinker/main.go +++ b/cmd/clickhouse_sinker/main.go @@ -201,8 +201,9 @@ func main() { // cmdOps.HTTPPort=0: let OS choose the listen port, and record the exact metrics URL to log. httpPort := cmdOps.HTTPPort if httpPort == 0 { - httpPort = util.GetSpareTCPPort(HttpPortBase) + httpPort = HttpPortBase } + httpPort = util.GetSpareTCPPort(httpPort) httpHost := cmdOps.HTTPHost if httpHost == "" {