From c2862be3734bf926beeb2ece98957a6ea4ca683a Mon Sep 17 00:00:00 2001 From: vipcxj Date: Thu, 19 Oct 2023 12:51:24 +0800 Subject: [PATCH 1/2] fix missing or wrong cluster host --- source/agent/index.js | 1 + source/event_bridge/index.js | 1 + source/management_api/requestHandler.js | 2 +- source/portal/index.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/agent/index.js b/source/agent/index.js index c6f1e853a..1bb542105 100644 --- a/source/agent/index.js +++ b/source/agent/index.js @@ -87,6 +87,7 @@ var joinCluster = function (on_ok) { rpcClient: rpcClient, purpose: myPurpose, clusterName: config.cluster.name, + clusterHost: config.cluster.host, joinRetry: config.cluster.worker.join_retry, // Cannot find a defination about |info|. It looks like it will be used by cluster manager, but agents and portal may have different properties of |info|. info: { diff --git a/source/event_bridge/index.js b/source/event_bridge/index.js index 41076d641..952a76c6a 100644 --- a/source/event_bridge/index.js +++ b/source/event_bridge/index.js @@ -100,6 +100,7 @@ var joinCluster = function (on_ok) { var spec = {rpcClient: rpcClient, purpose: 'eventbridge', clusterName: config.cluster.name, + clusterHost: config.cluster.host, joinRetry: config.cluster.join_retry, info: {ip: config.bridge.hostname || ip_address, port: config.bridge.port, diff --git a/source/management_api/requestHandler.js b/source/management_api/requestHandler.js index 2136f5734..b7782e83c 100644 --- a/source/management_api/requestHandler.js +++ b/source/management_api/requestHandler.js @@ -35,7 +35,7 @@ var e = require('./errors'); const enableGrpc = global.config?.server?.enable_grpc || false; if (enableGrpc) { - cluster_name = global.config?.cluster?.grpc_host || 'localhost:10080'; + cluster_name = global.config?.cluster?.host || global.config?.cluster?.grpc_host || 'localhost:10080'; } const scheduleAgent = function(agentName, tokenCode, origin, attempts, callback) { diff --git a/source/portal/index.js b/source/portal/index.js index e0b75fedb..20fde0a38 100644 --- a/source/portal/index.js +++ b/source/portal/index.js @@ -139,6 +139,7 @@ var joinCluster = function (on_ok) { var spec = {rpcClient: rpcClient, purpose: 'portal', clusterName: config.cluster.name, + clusterHost: config.cluster.host, joinRetry: config.cluster.join_retry, info: { ip: ip_address, From 74abb230604c39cdc6bc927739082ae9024bb83b Mon Sep 17 00:00:00 2001 From: vipcxj Date: Thu, 19 Oct 2023 12:53:13 +0800 Subject: [PATCH 2/2] ignore .vscode dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f9f2895a9..ac674bda6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ node_modules/ *.d *.a *.so +.vscode \ No newline at end of file