From 4ae4d16043a9a7fc77dfbeedf59cf28235315337 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 4 Sep 2020 08:36:29 +0000 Subject: [PATCH] TD-1323 allow first and second not to configure port --- src/common/src/tglobal.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index b232b41296..4690b6654f 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -1284,6 +1284,9 @@ void taosInitGlobalCfg() { } bool taosCheckGlobalCfg() { + char fqdn[TSDB_EP_LEN]; + uint16_t port; + if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG || debugFlag & DEBUG_DUMP) { taosSetAllDebugFlag(); } @@ -1297,12 +1300,18 @@ bool taosCheckGlobalCfg() { if (tsFirst[0] == 0) { strcpy(tsFirst, tsLocalEp); + } else { + taosGetFqdnPortFromEp(tsFirst, fqdn, &port); + snprintf(tsFirst, sizeof(tsFirst), "%s:%d", fqdn, port); } if (tsSecond[0] == 0) { strcpy(tsSecond, tsLocalEp); + } else { + taosGetFqdnPortFromEp(tsSecond, fqdn, &port); + snprintf(tsSecond, sizeof(tsSecond), "%s:%d", fqdn, port); } - + taosGetSystemInfo(); tsSetLocale(); -- GitLab