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 == "" {