tuonina преди 6 години
родител
ревизия
4870bace5d

+ 1 - 1
build.gradle

@@ -84,7 +84,7 @@ subprojects {
         // SpringBoot Starter
 
         compile('org.springframework.cloud:spring-cloud-config-server')
-        compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')
+        compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
         compile('org.springframework.cloud:spring-cloud-starter-openfeign')
 //
         compile('org.springframework.boot:spring-boot-starter')

+ 2 - 4
zen-web/src/main/kotlin/cn/gygxzc/envir/MainApplication.kt

@@ -5,14 +5,12 @@ import org.springframework.boot.SpringApplication
 import org.springframework.boot.autoconfigure.SpringBootApplication
 import org.springframework.boot.builder.SpringApplicationBuilder
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient
-import org.springframework.cloud.openfeign.EnableFeignClients
+import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
 
 /**
  * 注解配置
  */
-@EnableDiscoveryClient
-@EnableFeignClients
+@EnableEurekaServer
 @SpringBootApplication(scanBasePackages = ["com.gxzc", "cn.gygxzc"])
 @MapperScan(basePackages = ["com.gxzc", "cn.gygxzc"])
 class MainApplication : SpringBootServletInitializer() {

+ 7 - 13
zen-web/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 
 server:
-  port: 11000
+  port: 11001
 
 spring:
   profiles:
@@ -31,10 +31,11 @@ eureka:
     prefer-ip-address: true
     ip-address: 192.168.1.96  # 把自己的ip替换
   client:
-    register-with-eureka: true
-    fetch-registry: true
-    service-url:
-      registry1: http://192.168.1.206:11000/eureka/
+    register-with-eureka: false
+    fetch-registry: false
+  server:
+    enable-self-preservation: false
+    eviction-interval-timer-in-ms: 60000
 
 ---
 spring:
@@ -43,17 +44,10 @@ spring:
 
 swagger:
   open: true
-
-eureka:
-  client:
-    service-url:
-      defaultZone: http://192.168.1.206:11000/eureka/
 ---
+
 spring:
   profiles: prod
 
-server:
-  port: 10000 # 生产环境端口号
-
 swagger:
   open: false

+ 22 - 27
zen-web/src/main/resources/logback-spring.xml

@@ -151,35 +151,32 @@
             <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
         </encoder>
     </appender>
-    <logger name="com.minlia" level="DEBUG"/>
-    <logger name="org.springframework.data.mybatis" level="DEBUG"/>
+    <logger name="cn.gygxzc" level="DEBUG"/>
+    <logger name="com.gxzc" level="DEBUG"/>
+    <logger name="org.springframework" level="INFO"/>
     <logger name="org.springframework.aop.aspectj" level="ERROR"/>
 
     <logger name="javax.activation" level="WARN"/>
-    <logger name="javax.mail" level="WARN"/>
-    <logger name="javax.xml.bind" level="WARN"/>
+    <logger name="javax.mail" level="ERROR"/>
+    <logger name="javax.xml.bind" level="ERROR"/>
     <logger name="ch.qos.logback" level="INFO"/>
-    <logger name="com.codahale.metrics" level="WARN"/>
-    <logger name="com.ryantenney" level="WARN"/>
-    <logger name="com.sun" level="WARN"/>
-    <logger name="com.zaxxer" level="WARN"/>
-    <logger name="io.undertow" level="WARN"/>
-    <logger name="net.sf.ehcache" level="WARN"/>
-    <logger name="org.apache" level="WARN"/>
+    <logger name="com.codahale.metrics" level="ERROR"/>
+    <logger name="com.sun" level="ERROR"/>
+    <logger name="com.zaxxer" level="ERROR"/>
+    <logger name="io.undertow" level="ERROR"/>
+    <logger name="net.sf.ehcache" level="ERROR"/>
+    <logger name="org.apache" level="ERROR"/>
     <logger name="org.apache.catalina.startup.DigesterFactory" level="OFF"/>
-    <logger name="org.bson" level="WARN"/>
-    <logger name="org.hibernate.validator" level="WARN"/>
-    <logger name="org.hibernate" level="WARN"/>
-    <logger name="org.hibernate.ejb.HibernatePersistence" level="OFF"/>
+    <logger name="org.bson" level="ERROR"/>
     <logger name="org.springframework.web" level="INFO"/>
-    <logger name="org.springframework.security" level="WARN"/>
-    <logger name="org.springframework.cache" level="WARN"/>
-    <logger name="org.thymeleaf" level="WARN"/>
-    <logger name="org.xnio" level="WARN"/>
-    <logger name="springfox" level="WARN"/>
-    <logger name="sun.rmi" level="WARN"/>
-    <logger name="liquibase" level="WARN"/>
-    <logger name="sun.rmi.transport" level="WARN"/>
+    <logger name="org.springframework.security" level="ERROR"/>
+    <logger name="org.springframework.cache" level="ERROR"/>
+    <logger name="org.thymeleaf" level="ERROR"/>
+    <logger name="org.xnio" level="ERROR"/>
+    <logger name="springfox" level="ERROR"/>
+    <logger name="sun.rmi" level="ERROR"/>
+    <logger name="liquibase" level="ERROR"/>
+    <logger name="sun.rmi.transport" level="ERROR"/>
 
     <logger name="jdbc.connection" level="ERROR"/>
     <logger name="jdbc.resultset" level="ERROR"/>
@@ -187,10 +184,8 @@
     <logger name="jdbc.audit" level="ERROR"/>
     <logger name="jdbc.sqltiming" level="ERROR"/>
     <logger name="jdbc.sqlonly" level="INFO"/>
+    <logger name="org.mybatis" level="INFO"/>
 
-    <!--<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">-->
-    <!--<resetJUL>true</resetJUL>-->
-    <!--</contextListener>-->
 
     <springProfile name="prod">
         <root level="DEBUG">
@@ -198,7 +193,7 @@
             <appender-ref ref="FILEERROR"/>
             <appender-ref ref="FILEWARN"/>
             <appender-ref ref="FILEINFO"/>
-            <appender-ref ref="DBAPPENDER"/>
+            <!--<appender-ref ref="DBAPPENDER"/>-->
         </root>
     </springProfile>