Add missing property for API and worker (#7198)
This commit is contained in:
parent
1d4076fbc2
commit
e9d27015c3
|
|
@ -17,6 +17,13 @@
|
|||
|
||||
package org.apache.dolphinscheduler.api;
|
||||
|
||||
import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME;
|
||||
|
||||
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
|
|
@ -38,4 +45,11 @@ public class ApiApplicationServer extends SpringBootServletInitializer {
|
|||
new SpringApplicationBuilder(ApiApplicationServer.class).profiles("api").run(args);
|
||||
}
|
||||
|
||||
@Value("${spring.datasource.driver-class-name}")
|
||||
private String driverClassName;
|
||||
|
||||
@PostConstruct
|
||||
public void run() {
|
||||
PropertyUtils.setValue(SPRING_DATASOURCE_DRIVER_CLASS_NAME, driverClassName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,13 @@
|
|||
|
||||
package org.apache.dolphinscheduler.server.worker;
|
||||
|
||||
import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME;
|
||||
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.IStoppable;
|
||||
import org.apache.dolphinscheduler.common.enums.NodeType;
|
||||
import org.apache.dolphinscheduler.common.thread.Stopper;
|
||||
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
|
||||
import org.apache.dolphinscheduler.remote.NettyRemotingServer;
|
||||
import org.apache.dolphinscheduler.remote.command.CommandType;
|
||||
import org.apache.dolphinscheduler.remote.config.NettyServerConfig;
|
||||
|
|
@ -35,6 +38,7 @@ import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
|
@ -101,6 +105,9 @@ public class WorkerServer implements IStoppable {
|
|||
@Autowired
|
||||
private TaskPluginManager taskPluginManager;
|
||||
|
||||
@Value("${spring.datasource.driver-class-name}")
|
||||
private String driverClassName;
|
||||
|
||||
/**
|
||||
* worker server startup, not use web service
|
||||
*
|
||||
|
|
@ -119,6 +126,8 @@ public class WorkerServer implements IStoppable {
|
|||
*/
|
||||
@PostConstruct
|
||||
public void run() {
|
||||
PropertyUtils.setValue(SPRING_DATASOURCE_DRIVER_CLASS_NAME, driverClassName);
|
||||
|
||||
// alert-server client registry
|
||||
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(), Constants.ALERT_RPC_PORT);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue