Selaa lähdekoodia

system and basic springboot up 2.3

hanqingsong 3 vuotta sitten
vanhempi
commit
00e5650be9

+ 4 - 3
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.0.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.M8</spring-cloud.version>
25
+		<skipTests>true</skipTests>
26
+		<spring-cloud.version>Hoxton.SR12</spring-cloud.version>
26 27
 	</properties>
27 28
 
28 29
 	<dependencies>
@@ -47,7 +48,7 @@
47 48
 		</dependency>
48 49
 		<dependency>
49 50
 			<groupId>org.springframework.cloud</groupId>
50
-			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
51
+			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
51 52
 		</dependency>
52 53
 		<dependency>
53 54
             <groupId>org.springframework.cloud</groupId>

+ 0 - 2
src/main/java/com/chinaitop/DepotBasicApplication.java

@@ -3,11 +3,9 @@ package com.chinaitop;
3 3
 import org.mybatis.spring.annotation.MapperScan;
4 4
 import org.springframework.boot.SpringApplication;
5 5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 6
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
8 7
 
9 8
 @EnableEurekaClient
10
-@EnableDiscoveryClient
11 9
 @SpringBootApplication
12 10
 @MapperScan(basePackages = {"com.chinaitop.depot.*.mapper"})
13 11
 public class DepotBasicApplication {

+ 8 - 20
src/main/resources/bootstrap.yml

@@ -1,54 +1,42 @@
1 1
 server:
2 2
   port: 9022
3
-  maxHttpHeaderSize: 102400
4 3
   tomcat:
5 4
     uri-encoding: utf-8
6
-
7 5
 # 注册中心配置
8 6
 eureka:
9 7
   client:
10 8
     service-url:
11
-      defaultZone: http://172.16.0.46:9511/eureka/
9
+      defaultZone: http://172.16.0.8:9001/eureka/,http://172.16.0.9:9001/eureka/
12 10
   instance:
13 11
     prefer-ip-address: true
14 12
     # 每隔10s发送一次心跳(默认30s)
15 13
     lease-renewal-interval-in-seconds: 10
16 14
     # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
17 15
     lease-expiration-duration-in-seconds: 30
18
-
19 16
 spring:
20 17
   application:
21 18
     name: depot-basic
22 19
 
23 20
   # 数据库配置
24 21
   datasource:
25
-    driverClassName: com.mysql.jdbc.Driver
26
-    url: jdbc:mysql://172.16.0.5:3306/depot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
22
+    driverClassName: com.mysql.cj.jdbc.Driver
23
+    url: jdbc:mysql://101.36.160.140:10311/depot_yunnan?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
27 24
     username: root
28 25
     password: 123456
29
-    #验证连接是否有效。此参数必须设置为非空字符串,下面三项设置成true才能生效
30
-    validation-query: SELECT 1
31
-    #指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除.
32
-    test-while-idle: true
33
-    #指明是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个
34
-    test-on-borrow: false
35
-    #指明是否在归还到池中前进行检验
36
-    test-on-return: true
37
-    time-between-eviction-runs-millis: 18800
38 26
   # 缓存配置
39 27
   session:
40 28
     store-type: redis
41 29
 
42 30
   redis:
43
-    database: 1
44
-    host: 172.16.0.46
45
-    port: 6679
31
+    database: 13
32
+    host: 172.16.0.2
33
+    port: 6379
46 34
     password: 123456
47
-    timeout: 3000
35
+    timeout: 3000ms
48 36
     jedis:
49 37
       pool:
50 38
         max-active: 8
51
-        max-wait: -1
39
+        max-wait: -1ms
52 40
         max-idle: 8
53 41
         min-idle: 0
54 42
   # 静态资源配置