Browse Source

[1.3.6-prepare][Master] Fix First master fault tolerance when startup #5045

pr #5045
issue #5044
CalvinKirs 4 years ago
parent
commit
95c1f38c2a
  1. 7
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java

7
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java

@ -84,8 +84,8 @@ public class ZKMasterClient extends AbstractZKClient {
// master registry // master registry
masterRegistry.registry(); masterRegistry.registry();
masterRegistry.getZookeeperRegistryCenter().setStoppable(masterServer); masterRegistry.getZookeeperRegistryCenter().setStoppable(masterServer);
String registPath = this.masterRegistry.getMasterPath(); String registryPath = this.masterRegistry.getMasterPath();
masterRegistry.getZookeeperRegistryCenter().getRegisterOperator().handleDeadServer(registPath, ZKNodeType.MASTER, Constants.DELETE_ZK_OP); masterRegistry.getZookeeperRegistryCenter().getRegisterOperator().handleDeadServer(registryPath, ZKNodeType.MASTER, Constants.DELETE_ZK_OP);
// init system znode // init system znode
this.initSystemZNode(); this.initSystemZNode();
@ -176,9 +176,6 @@ public class ZKMasterClient extends AbstractZKClient {
* @throws Exception exception * @throws Exception exception
*/ */
private void failoverServerWhenDown(String serverHost, ZKNodeType zkNodeType) throws Exception { private void failoverServerWhenDown(String serverHost, ZKNodeType zkNodeType) throws Exception {
if (StringUtils.isEmpty(serverHost)) {
return;
}
switch (zkNodeType) { switch (zkNodeType) {
case MASTER: case MASTER:
failoverMaster(serverHost); failoverMaster(serverHost);

Loading…
Cancel
Save