|
|
@ -27,7 +27,6 @@ import org.apache.dolphinscheduler.server.master.config.MasterConfig; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskKillResponseProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskKillResponseProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.registry.MasterRegistry; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.runner.MasterSchedulerService; |
|
|
|
import org.apache.dolphinscheduler.server.master.runner.MasterSchedulerService; |
|
|
|
import org.apache.dolphinscheduler.server.worker.WorkerServer; |
|
|
|
import org.apache.dolphinscheduler.server.worker.WorkerServer; |
|
|
|
import org.apache.dolphinscheduler.server.zk.ZKMasterClient; |
|
|
|
import org.apache.dolphinscheduler.server.zk.ZKMasterClient; |
|
|
@ -73,12 +72,6 @@ public class MasterServer implements IStoppable { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private NettyRemotingServer nettyRemotingServer; |
|
|
|
private NettyRemotingServer nettyRemotingServer; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* master registry |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private MasterRegistry masterRegistry; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* zk master client |
|
|
|
* zk master client |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -108,7 +101,6 @@ public class MasterServer implements IStoppable { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PostConstruct |
|
|
|
@PostConstruct |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
try { |
|
|
|
|
|
|
|
// init remoting server
|
|
|
|
// init remoting server
|
|
|
|
NettyServerConfig serverConfig = new NettyServerConfig(); |
|
|
|
NettyServerConfig serverConfig = new NettyServerConfig(); |
|
|
|
serverConfig.setListenPort(masterConfig.getListenPort()); |
|
|
|
serverConfig.setListenPort(masterConfig.getListenPort()); |
|
|
@ -118,15 +110,8 @@ public class MasterServer implements IStoppable { |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_RESPONSE, new TaskKillResponseProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_RESPONSE, new TaskKillResponseProcessor()); |
|
|
|
this.nettyRemotingServer.start(); |
|
|
|
this.nettyRemotingServer.start(); |
|
|
|
|
|
|
|
|
|
|
|
this.masterRegistry.getZookeeperRegistryCenter().setStoppable(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
logger.error(e.getMessage(), e); |
|
|
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// self tolerant
|
|
|
|
// self tolerant
|
|
|
|
this.zkMasterClient.start(); |
|
|
|
this.zkMasterClient.start(this); |
|
|
|
|
|
|
|
|
|
|
|
// scheduler start
|
|
|
|
// scheduler start
|
|
|
|
this.masterSchedulerService.start(); |
|
|
|
this.masterSchedulerService.start(); |
|
|
@ -183,10 +168,9 @@ public class MasterServer implements IStoppable { |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
logger.warn("thread sleep exception ", e); |
|
|
|
logger.warn("thread sleep exception ", e); |
|
|
|
} |
|
|
|
} |
|
|
|
//
|
|
|
|
//close
|
|
|
|
this.masterSchedulerService.close(); |
|
|
|
this.masterSchedulerService.close(); |
|
|
|
this.nettyRemotingServer.close(); |
|
|
|
this.nettyRemotingServer.close(); |
|
|
|
this.masterRegistry.unRegistry(); |
|
|
|
|
|
|
|
this.zkMasterClient.close(); |
|
|
|
this.zkMasterClient.close(); |
|
|
|
//close quartz
|
|
|
|
//close quartz
|
|
|
|
try { |
|
|
|
try { |
|
|
|