瀏覽代碼

eureka server 升级 版本

hanqingsong 3 年之前
父節點
當前提交
877afeb676
共有 2 個文件被更改,包括 16 次插入26 次删除
  1. 4 23
      pom.xml
  2. 12 3
      src/main/resources/application.yml

+ 4 - 23
pom.xml

@@ -14,7 +14,7 @@
14 14
 	<parent>
15 15
 		<groupId>org.springframework.boot</groupId>
16 16
 		<artifactId>spring-boot-starter-parent</artifactId>
17
-		<version>2.0.3.RELEASE</version>
17
+		<version>2.3.12.RELEASE</version>
18 18
 		<relativePath/> <!-- lookup parent from repository -->
19 19
 	</parent>
20 20
 
@@ -22,7 +22,8 @@
22 22
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23 23
 		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24 24
 		<java.version>1.8</java.version>
25
-		<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
25
+		<spring-cloud.version>Hoxton.SR12</spring-cloud.version>
26
+		<skipTests>true</skipTests>
26 27
 	</properties>
27 28
 
28 29
 	<dependencies>
@@ -30,7 +31,6 @@
30 31
 			<groupId>org.springframework.cloud</groupId>
31 32
 			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
32 33
 		</dependency>
33
-
34 34
 		<dependency>
35 35
 			<groupId>org.springframework.boot</groupId>
36 36
 			<artifactId>spring-boot-starter-test</artifactId>
@@ -51,31 +51,12 @@
51 51
 	</dependencyManagement>
52 52
 
53 53
 	<build>
54
+		<finalName>eureka-server</finalName>
54 55
 		<plugins>
55 56
 			<plugin>
56 57
 				<groupId>org.springframework.boot</groupId>
57 58
 				<artifactId>spring-boot-maven-plugin</artifactId>
58
-				<!--第一次打包时需要注释到 configuration 节点,因为我们要得到全部的jar包-->
59
- 				<!--<configuration>
60
-					<layout>ZIP</layout>
61
-					<includes>
62
-						<include>
63
-							<groupId>com.unis.module</groupId>
64
-							<artifactId>eureka</artifactId>
65
-						</include>
66
-					</includes>
67
-				</configuration>-->
68
-			</plugin>
69
-			<!--打包时不进行验证测试-->
70
-			<plugin>
71
-				<groupId>org.apache.maven.plugins</groupId>
72
-				<artifactId>maven-surefire-plugin</artifactId>
73
-				<version>2.21.0</version>
74
-				<configuration>
75
-					<skipTests>true</skipTests>
76
-				</configuration>
77 59
 			</plugin>
78 60
 		</plugins>
79
-		<finalName>eureka</finalName>
80 61
 	</build>
81 62
 </project>

+ 12 - 3
src/main/resources/application.yml

@@ -1,6 +1,8 @@
1 1
 spring:
2 2
   profiles:
3
-    active: local_dev
3
+    active: prod
4
+  application:
5
+    name: eureka-server
4 6
 server:
5 7
   port: 9001
6 8
 ---
@@ -38,13 +40,20 @@ spring:
38 40
 eureka:
39 41
   instance:
40 42
     prefer-ip-address: true
43
+    lease-renewal-interval-in-seconds: 10
44
+    lease-expiration-duration-in-seconds: 30
41 45
   client:
42
-    register-with-eureka: false
43
-    fetch-registry: false
44 46
     service-url:
47
+      # 集群地址多个用逗号隔开
45 48
       defaultZone: http://${spring.cloud.client.ip-address}:${server.port}/eureka/
49
+    # 是否将自己注册到Eureka Server 默认为true
50
+    fetch-registry: false
51
+    # 是否从Eureka Server查询注册信息
52
+    register-with-eureka: true
46 53
   server:
54
+    # 关闭自我保护模式
47 55
     enable-self-preservation: false
56
+    # 清理服务间隔
48 57
     eviction-interval-timer-in-ms: 30000
49 58
 management:
50 59
   endpoints: