瀏覽代碼

单数据源

zhoutg 4 年之前
父節點
當前提交
183ee9ab6a

+ 1 - 4
pom.xml

@@ -153,7 +153,7 @@
         </dependency>
         <!-- mybatis-plus end -->
 
-        <!--&lt;!&ndash; 阿里巴巴druid数据库连接池 &ndash;&gt;-->
+        <!-- 阿里巴巴druid数据库连接池 -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid-spring-boot-starter</artifactId>
@@ -188,15 +188,12 @@
             <artifactId>spring-boot-starter-data-neo4j</artifactId>
         </dependency>
 
-
-
         <dependency>
             <groupId>org.neo4j</groupId>
             <artifactId>neo4j-ogm-http-driver</artifactId>
             <version>3.2.9</version>
         </dependency>
 
-
         <!-- 文件上传相关�?? -->
         <dependency>
             <groupId>commons-beanutils</groupId>

+ 47 - 28
src/main/resources/application-dev.yml

@@ -37,37 +37,57 @@ feign:
 # 驱动配置信息
 spring:
   datasource:
-    dynamic:
-      primary: neo4j
-      # 数据库配置
-      datasource:
-        neo4j:
-          driver-class-name: org.neo4j.jdbc.Driver
-          url: jdbc:neo4j:http://192.168.2.234:7472
-          username: neo4j
-          password: root
-          #定义初始连接数
-          initialSize: 0
-          #定义最大连接数
-          maxActive: 20
-          #定义最大空闲
-          maxIdle: 20
-          #定义最小空闲
-          minIdle: 1
-          #定义最长等待时间
-          maxWait: 60000
-        mysql:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          platform: mysql
-          url: jdbc:mysql://192.168.2.236:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-          username: root
-          password: lantone
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
 
   #redis
   redis:
     database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
+      cache: 11 # cache索引
+      token: 11 # Token索引
     host: 192.168.2.236  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
@@ -83,7 +103,6 @@ spring:
     multipart:
       max-request-size: 2048MB
 
-
 neo4j:
   data:
     URI: http://192.168.3.150:7478

+ 46 - 27
src/main/resources/application-local.yml

@@ -34,32 +34,54 @@ feign:
     max-connections: 1000 # 默认值
     max-connections-per-route: 250 # 默认值
 
-
-
+# 驱动配置信息
 spring:
-  # 驱动配置信息
   datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    platform: mysql
-    url: jdbc:mysql://192.168.2.236:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-    username: root
-    password: lantone
-    # 连接池的配置信息
-    #定义初始连接数
-    initialSize: 5
-    #定义最大连接数
-    maxActive: 20
-    #定义最大空闲
-    maxIdle: 20
-    #定义最小空闲
-    minIdle: 1
-    #定义最长等待时间
-    maxWait: 60000
-
-
-
-
-
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
 
   #redis
   redis:
@@ -81,15 +103,12 @@ spring:
     multipart:
       max-request-size: 2048MB
 
-
 neo4j:
   data:
     URI: http://192.168.3.150:7478
     username: neo4j
     password: root
 
-
-
 #mybatis
 mybatis-plus:
   mapper-locations: classpath:/mapper/*Mapper.xml

+ 48 - 30
src/main/resources/application-pre.yml

@@ -37,37 +37,57 @@ feign:
 # 驱动配置信息
 spring:
   datasource:
-    dynamic:
-      primary: neo4j
-      # 数据库配置
-      datasource:
-        neo4j:
-          driver-class-name: org.neo4j.jdbc.Driver
-          url: jdbc:neo4j:http://192.168.2.234:7472
-          username: neo4j
-          password: root
-          #定义初始连接数
-          initialSize: 0
-          #定义最大连接数
-          maxActive: 20
-          #定义最大空闲
-          maxIdle: 20
-          #定义最小空闲
-          minIdle: 1
-          #定义最长等待时间
-          maxWait: 60000
-        mysql:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          platform: mysql
-          url: jdbc:mysql://192.168.2.121:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-          username: teamback
-          password: goTulmLeon
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.121:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: teamback
+      password: goTulmLeon
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
 
   #redis
   redis:
     database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
+      cache: 11 # cache索引
+      token: 11 # Token索引
     host: 192.168.2.121  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
@@ -83,14 +103,12 @@ spring:
     multipart:
       max-request-size: 2048MB
 
-
 neo4j:
   data:
     URI: http://192.168.3.150:7478
     username: neo4j
     password: root
 
-
 #mybatis
 mybatis-plus:
   mapper-locations: classpath:/mapper/*Mapper.xml
@@ -128,4 +146,4 @@ swagger:
   enable: true
 
 CRF:
-  url: http://192.168.2.234:3456
+  url: http://192.168.2.234:3456

+ 47 - 28
src/main/resources/application-pro.yml

@@ -37,38 +37,57 @@ feign:
 # 驱动配置信息
 spring:
   datasource:
-    dynamic:
-      primary: neo4j
-      # 数据库配置
-      datasource:
-        neo4j:
-          driver-class-name: org.neo4j.jdbc.Driver
-          url: jdbc:neo4j:http://192.168.2.234:7472
-          username: neo4j
-          password: root
-          #定义初始连接数
-          initialSize: 0
-          #定义最大连接数
-          maxActive: 20
-          #定义最大空闲
-          maxIdle: 20
-          #定义最小空闲
-          minIdle: 1
-          #定义最长等待时间
-          maxWait: 60000
-        mysql:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          platform: mysql
-          url: jdbc:mysql://192.168.2.122:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-          username: root
-          password: lantone
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.122:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
 
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
 
   #redis
   redis:
     database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
+      cache: 11 # cache索引
+      token: 11 # Token索引
     host: 192.168.2.122  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
@@ -129,4 +148,4 @@ swagger:
   enable: true
 
 CRF:
-  url: http://192.168.2.234:3456
+  url: http://192.168.2.234:3456

+ 47 - 29
src/main/resources/application-test.yml

@@ -37,38 +37,57 @@ feign:
 # 驱动配置信息
 spring:
   datasource:
-    dynamic:
-      primary: neo4j
-      # 数据库配置
-      datasource:
-        neo4j:
-          driver-class-name: org.neo4j.jdbc.Driver
-          url: jdbc:neo4j:http://192.168.2.234:7472
-          username: neo4j
-          password: root
-          #定义初始连接数
-          initialSize: 0
-          #定义最大连接数
-          maxActive: 20
-          #定义最大空闲
-          maxIdle: 20
-          #定义最小空闲
-          minIdle: 1
-          #定义最长等待时间
-          maxWait: 60000
-        mysql:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          platform: mysql
-          url: jdbc:mysql://192.168.2.241:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-          username: root
-          password: lantone
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
 
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
 
   #redis
   redis:
     database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
+      cache: 11 # cache索引
+      token: 11 # Token索引
     host: 192.168.2.241  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
@@ -84,7 +103,6 @@ spring:
     multipart:
       max-request-size: 2048MB
 
-
 neo4j:
   data:
     URI: http://192.168.3.150:7478
@@ -128,4 +146,4 @@ swagger:
   enable: true
 
 CRF:
-  url: http://192.168.2.234:3456
+  url: http://192.168.2.234:3456