Browse Source

remove master server and worker server listening port (5566、7788) (#1551)

* fix:When there are multiple nodes, the monitoring center dashboard displays only one node.

* fix:Catching exceptions and printing exception information

* fix:rollback

* fix:getting project name field bug

* fix: remove master server and worker server listening port (5566、7788)
魔方不在手 5 years ago
parent
commit
5cc82c5900

+ 0 - 1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java

@@ -26,7 +26,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
 @SpringBootApplication
 @ServletComponentScan
 @ComponentScan("org.apache.dolphinscheduler")
-@EnableSwagger2
 public class ApiApplicationServer extends SpringBootServletInitializer {
 
   public static void main(String[] args) {

+ 2 - 1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java

@@ -16,12 +16,12 @@
  */
 package org.apache.dolphinscheduler.api.configuration;
 
-import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Multimap;
 import io.swagger.models.*;
 import io.swagger.models.parameters.Parameter;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Primary;
 import org.springframework.context.i18n.LocaleContextHolder;
@@ -41,6 +41,7 @@ import static com.google.common.collect.Maps.newTreeMap;
  */
 @Component(value = "ServiceModelToSwagger2Mapper")
 @Primary
+@ConditionalOnWebApplication
 public class ServiceModelToSwagger2MapperImpl extends ServiceModelToSwagger2Mapper {
 
 

+ 2 - 0
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/SwaggerConfig.java

@@ -17,6 +17,7 @@
 package org.apache.dolphinscheduler.api.configuration;
 
 import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -37,6 +38,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
 @Configuration
 @EnableSwagger2
 @EnableSwaggerBootstrapUI
+@ConditionalOnWebApplication
 public class SwaggerConfig implements WebMvcConfigurer {
 
     @Bean

+ 3 - 2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java

@@ -35,6 +35,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
+import org.springframework.boot.WebApplicationType;
+import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.annotation.ComponentScan;
 
 import javax.annotation.PostConstruct;
@@ -95,8 +97,7 @@ public class MasterServer implements IStoppable {
      * @param args arguments
      */
     public static void main(String[] args) {
-        SpringApplication.run(MasterServer.class, args);
-
+        new SpringApplicationBuilder(MasterServer.class).web(WebApplicationType.NONE).run(args);
     }
 
     /**

+ 3 - 2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java

@@ -42,7 +42,8 @@ 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.SpringApplication;
+import org.springframework.boot.WebApplicationType;
+import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.annotation.ComponentScan;
 
 import javax.annotation.PostConstruct;
@@ -127,7 +128,7 @@ public class WorkerServer implements IStoppable {
      * @param args arguments
      */
     public static void main(String[] args) {
-        SpringApplication.run(WorkerServer.class,args);
+        new SpringApplicationBuilder(WorkerServer.class).web(WebApplicationType.NONE).run(args);
     }
 
 

+ 1 - 4
dolphinscheduler-server/src/main/resources/application-master.properties

@@ -15,7 +15,4 @@
 # limitations under the License.
 #
 
-logging.config=classpath:master_logback.xml
-
-# server port
-server.port=5566
+logging.config=classpath:master_logback.xml

+ 0 - 3
dolphinscheduler-server/src/main/resources/application-worker.properties

@@ -16,6 +16,3 @@
 #
 
 logging.config=classpath:worker_logback.xml
-
-# server port
-server.port=7788