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