Browse Source

Exclude DataSourceAutoConfiguration in worker server (#15169)

3.2.1-prepare
Wenjun Ruan 1 year ago committed by GitHub
parent
commit
d6175f3bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-master/src/main/resources/logback-spring.xml
  2. 6
      dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
  3. 3
      dolphinscheduler-worker/src/main/resources/application.yaml
  4. 4
      dolphinscheduler-worker/src/main/resources/logback-spring.xml

4
dolphinscheduler-master/src/main/resources/logback-spring.xml

@ -23,7 +23,7 @@
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern> <pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - [WorkflowInstance-%X{workflowInstanceId:-0}][TaskInstance-%X{taskInstanceId:-0}] - %msg%n [WI-%X{workflowInstanceId:-0}][TI-%X{taskInstanceId:-0}] - [%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - %msg%n
</pattern> </pattern>
<charset>UTF-8</charset> <charset>UTF-8</charset>
</encoder> </encoder>
@ -61,7 +61,7 @@
</rollingPolicy> </rollingPolicy>
<encoder> <encoder>
<pattern> <pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - [WorkflowInstance-%X{workflowInstanceId:-0}][TaskInstance-%X{taskInstanceId:-0}] - %msg%n [WI-%X{workflowInstanceId:-0}][TI-%X{taskInstanceId:-0}] - [%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - %msg%n
</pattern> </pattern>
<charset>UTF-8</charset> <charset>UTF-8</charset>
</encoder> </encoder>

6
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java

@ -43,16 +43,12 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
@EnableTransactionManagement @EnableTransactionManagement
@ComponentScan(basePackages = "org.apache.dolphinscheduler", excludeFilters = { @ComponentScan(basePackages = "org.apache.dolphinscheduler")
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DataSourceAutoConfiguration.class)
})
@Slf4j @Slf4j
public class WorkerServer implements IStoppable { public class WorkerServer implements IStoppable {

3
dolphinscheduler-worker/src/main/resources/application.yaml

@ -20,6 +20,9 @@ spring:
jackson: jackson:
time-zone: UTC time-zone: UTC
date-format: "yyyy-MM-dd HH:mm:ss" date-format: "yyyy-MM-dd HH:mm:ss"
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
registry: registry:
type: zookeeper type: zookeeper

4
dolphinscheduler-worker/src/main/resources/logback-spring.xml

@ -23,7 +23,7 @@
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern> <pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - [WorkflowInstance-%X{workflowInstanceId:-0}][TaskInstance-%X{taskInstanceId:-0}] - %msg%n [WI-%X{workflowInstanceId:-0}][TI-%X{taskInstanceId:-0}] - [%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - %msg%n
</pattern> </pattern>
<charset>UTF-8</charset> <charset>UTF-8</charset>
</encoder> </encoder>
@ -61,7 +61,7 @@
</rollingPolicy> </rollingPolicy>
<encoder> <encoder>
<pattern> <pattern>
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - [WorkflowInstance-%X{workflowInstanceId:-0}][TaskInstance-%X{taskInstanceId:-0}] - %msg%n [WI-%X{workflowInstanceId:-0}][TI-%X{taskInstanceId:-0}] - [%level] %date{yyyy-MM-dd HH:mm:ss.SSS Z} %logger{96}:[%line] - %msg%n
</pattern> </pattern>
<charset>UTF-8</charset> <charset>UTF-8</charset>
</encoder> </encoder>

Loading…
Cancel
Save