From 3c6780c3cd155e357b21879bd2c1b99d6e7713c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A9=E5=90=88=E6=B0=91?= Date: Fri, 27 Dec 2019 16:53:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9AIn=20a=20cluster=20environment,=20v?= =?UTF-8?q?erify=20that=20nodes=20have=20matching=20bug.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apache/dolphinscheduler/common/zk/AbstractZKClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java index 5b937ce46d..0e95dddb36 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java @@ -144,7 +144,7 @@ public abstract class AbstractZKClient extends ZookeeperCachedOperator{ String parentPath = getZNodeParentPath(zkNodeType); String serverPathPrefix = parentPath + "/" + OSUtils.getHost(); String registerPath = zkClient.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath( - serverPathPrefix + "_", heartbeatZKInfo.getBytes()); + serverPathPrefix + UNDERLINE, heartbeatZKInfo.getBytes()); logger.info("register {} node {} success" , zkNodeType.toString(), registerPath); return registerPath; } @@ -307,7 +307,7 @@ public abstract class AbstractZKClient extends ZookeeperCachedOperator{ } Map serverMaps = getServerMaps(zkNodeType); for(String hostKey : serverMaps.keySet()){ - if(hostKey.startsWith(host)){ + if(hostKey.startsWith(host + UNDERLINE)){ return true; } }