!245 数据源由 Druid 修改为 Hikari
* update 更新 dataSource 数据源, 由 druid 修改为 hikari, 更新相关配置 ;
已删除1个文件
已修改8个文件
224 ■■■■ 文件已修改
pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-dev.yml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-prod.yml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
script/sql/oracle/oracle_ry_vue_4.X.sql 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
script/sql/postgres/postgres_ry_vue_4.X.sql 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
script/sql/ry_vue_4.X.sql 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
script/sql/sqlserver/sqlserver_ry_vue_4.X.sql 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -20,7 +20,6 @@
        <java.version>1.8</java.version>
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <spring-boot.mybatis>2.2.2</spring-boot.mybatis>
        <druid.version>1.2.12</druid.version>
        <springdoc.version>1.6.12</springdoc.version>
        <poi.version>5.2.3</poi.version>
        <easyexcel.version>3.1.1</easyexcel.version>
@@ -70,13 +69,6 @@
                <version>${hutool.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- é˜¿é‡Œæ•°æ®åº“连接池 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid.version}</version>
            </dependency>
            <dependency>
ruoyi-admin/src/main/resources/application-dev.yml
@@ -33,7 +33,7 @@
--- # æ•°æ®æºé…ç½®
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    type: com.zaxxer.hikari.HikariDataSource
    # åŠ¨æ€æ•°æ®æºæ–‡æ¡£ https://www.kancloud.cn/tracy5546/dynamic-datasource/content
    dynamic:
      # æ€§èƒ½åˆ†æžæ’ä»¶(有性能损耗 ä¸å»ºè®®ç”Ÿäº§çŽ¯å¢ƒä½¿ç”¨)
@@ -51,75 +51,50 @@
          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
          username: root
          password: root
          type: ${spring.datasource.type}
        # ä»Žåº“数据源
        slave:
          lazy: true
          driverClassName: com.mysql.cj.jdbc.Driver
          url:
          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
          username:
          password:
          type: ${spring.datasource.type}
#        oracle:
#          driverClassName: oracle.jdbc.OracleDriver
#          url: jdbc:oracle:thin:@//localhost:1521/XE
#          username: ROOT
#          password: root
#          druid:
#            validationQuery: SELECT 1 FROM DUAL
#          type: ${spring.datasource.type}
#          hikari:
#            connectionTestQuery: SELECT 1 FROM DUAL
#        postgres:
#          driverClassName: org.postgresql.Driver
#          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
#          username: root
#          password: root
#          type: ${spring.datasource.type}
#        sqlserver:
#          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
#          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
#          username: SA
#          password: root
      druid:
        # åˆå§‹è¿žæŽ¥æ•°
        initialSize: 5
        # æœ€å°è¿žæŽ¥æ± æ•°é‡
        minIdle: 10
        # æœ€å¤§è¿žæŽ¥æ± æ•°é‡
        maxActive: 20
#          type: ${spring.datasource.type}
      hikari:
        # é…ç½®èŽ·å–è¿žæŽ¥ç­‰å¾…è¶…æ—¶çš„æ—¶é—´
        maxWait: 60000
        # é…ç½®é—´éš”多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
        timeBetweenEvictionRunsMillis: 60000
        # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å°ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
        minEvictableIdleTimeMillis: 300000
        # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å¤§ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
        maxEvictableIdleTimeMillis: 900000
        # é…ç½®æ£€æµ‹è¿žæŽ¥æ˜¯å¦æœ‰æ•ˆ
        validationQuery: SELECT 1
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        # æ³¨æ„è¿™ä¸ªå€¼å’Œdruid原生不一致,默认启动了stat
        filters: stat
--- # druid é…ç½®
spring.datasource.druid:
  webStatFilter:
    enabled: true
  statViewServlet:
    enabled: true
    # è®¾ç½®ç™½åå•,不填则允许所有访问
    allow:
    url-pattern: /druid/*
    # æŽ§åˆ¶å°ç®¡ç†ç”¨æˆ·åå’Œå¯†ç 
    login-username: ruoyi
    login-password: 123456
  filter:
    stat:
      enabled: true
      # æ…¢SQL记录
      log-slow-sql: true
      slow-sql-millis: 1000
      merge-sql: true
    wall:
      config:
        multi-statement-allow: true
        connection-timeout: 60000
        # ç©ºé—²è¿žæŽ¥å­˜æ´»æœ€å¤§æ—¶é—´ï¼Œé»˜è®¤10分钟
        idle-timeout: 60000
        # æ­¤å±žæ€§æŽ§åˆ¶æ± ä¸­è¿žæŽ¥çš„æœ€é•¿ç”Ÿå‘½å‘¨æœŸï¼Œå€¼0表示无限生命周期,默认30分钟
        max-lifetime: 900000
        # æœ€å¤§è¿žæŽ¥æ± æ•°é‡ï¼Œé»˜è®¤æ˜¯10
        max-pool-size: 20
        # æœ€å°è¿žæŽ¥æ± æ•°é‡
        min-idle: 10
        # è¿žæŽ¥æµ‹è¯•query(配置检测连接是否有效)
        connectionTestQuery: SELECT 1
        # æ­¤å±žæ€§æŽ§åˆ¶ä»Žæ± è¿”回的连接的默认自动提交行为,默认值:true
        isAutoCommit: true
--- # redis å•机配置(单机与集群只能开启一个另一个需要注释掉)
spring:
ruoyi-admin/src/main/resources/application-prod.yml
@@ -36,7 +36,7 @@
--- # æ•°æ®æºé…ç½®
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    type: com.zaxxer.hikari.HikariDataSource
    # åŠ¨æ€æ•°æ®æºæ–‡æ¡£ https://www.kancloud.cn/tracy5546/dynamic-datasource/content
    dynamic:
      # æ€§èƒ½åˆ†æžæ’ä»¶(有性能损耗 ä¸å»ºè®®ç”Ÿäº§çŽ¯å¢ƒä½¿ç”¨)
@@ -54,75 +54,50 @@
          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
          username: root
          password: root
          type: ${spring.datasource.type}
        # ä»Žåº“数据源
        slave:
          lazy: true
          driverClassName: com.mysql.cj.jdbc.Driver
          url:
          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
          username:
          password:
          type: ${spring.datasource.type}
#        oracle:
#          driverClassName: oracle.jdbc.OracleDriver
#          url: jdbc:oracle:thin:@//localhost:1521/XE
#          username: ROOT
#          password: root
#          druid:
#            validationQuery: SELECT 1 FROM DUAL
#          type: ${spring.datasource.type}
#          hikari:
#            connectionTestQuery: SELECT 1 FROM DUAL
#        postgres:
#          driverClassName: org.postgresql.Driver
#          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
#          username: root
#          password: root
#          type: ${spring.datasource.type}
#        sqlserver:
#          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
#          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
#          username: SA
#          password: root
      druid:
        # åˆå§‹è¿žæŽ¥æ•°
        initialSize: 5
        # æœ€å°è¿žæŽ¥æ± æ•°é‡
        minIdle: 10
        # æœ€å¤§è¿žæŽ¥æ± æ•°é‡
        maxActive: 20
#          type: ${spring.datasource.type}
      hikari:
        # é…ç½®èŽ·å–è¿žæŽ¥ç­‰å¾…è¶…æ—¶çš„æ—¶é—´
        maxWait: 60000
        # é…ç½®é—´éš”多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
        timeBetweenEvictionRunsMillis: 60000
        # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å°ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
        minEvictableIdleTimeMillis: 300000
        # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å¤§ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
        maxEvictableIdleTimeMillis: 900000
        # é…ç½®æ£€æµ‹è¿žæŽ¥æ˜¯å¦æœ‰æ•ˆ
        validationQuery: SELECT 1
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        # æ³¨æ„è¿™ä¸ªå€¼å’Œdruid原生不一致,默认启动了stat
        filters: stat
--- # druid é…ç½®
spring.datasource.druid:
  webStatFilter:
    enabled: true
  statViewServlet:
    enabled: true
    # è®¾ç½®ç™½åå•,不填则允许所有访问
    allow:
    url-pattern: /druid/*
    # æŽ§åˆ¶å°ç®¡ç†ç”¨æˆ·åå’Œå¯†ç 
    login-username: ruoyi
    login-password: 123456
  filter:
    stat:
      enabled: true
      # æ…¢SQL记录
      log-slow-sql: true
      slow-sql-millis: 1000
      merge-sql: true
    wall:
      config:
        multi-statement-allow: true
        connection-timeout: 60000
        # ç©ºé—²è¿žæŽ¥å­˜æ´»æœ€å¤§æ—¶é—´ï¼Œé»˜è®¤10分钟
        idle-timeout: 60000
        # æ­¤å±žæ€§æŽ§åˆ¶æ± ä¸­è¿žæŽ¥çš„æœ€é•¿ç”Ÿå‘½å‘¨æœŸï¼Œå€¼0表示无限生命周期,默认30分钟
        max-lifetime: 900000
        # æœ€å¤§è¿žæŽ¥æ± æ•°é‡ï¼Œé»˜è®¤æ˜¯10
        max-pool-size: 20
        # æœ€å°è¿žæŽ¥æ± æ•°é‡
        min-idle: 10
        # è¿žæŽ¥æµ‹è¯•query(配置检测连接是否有效)
        connectionTestQuery: SELECT 1
        # æ­¤å±žæ€§æŽ§åˆ¶ä»Žæ± è¿”回的连接的默认自动提交行为,默认值:true
        isAutoCommit: true
--- # redis å•机配置(单机与集群只能开启一个另一个需要注释掉)
spring:
ruoyi-framework/pom.xml
@@ -40,12 +40,6 @@
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <!-- é˜¿é‡Œæ•°æ®åº“连接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
        </dependency>
        <!-- sql性能分析插件 -->
        <dependency>
            <groupId>p6spy</groupId>
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java
ÎļþÒÑɾ³ý
script/sql/oracle/oracle_ry_vue_4.X.sql
@@ -257,7 +257,6 @@
insert into sys_menu values('107',  '通知公告', '1',   '8', 'notice',     'system/notice/index',      '', 1, 0, 'C', '0', '0', 'system:notice:list',      'message',       'admin', sysdate, '', null, '通知公告菜单');
insert into sys_menu values('108',  '日志管理', '1',   '9', 'log',        '',                         '', 1, 0, 'M', '0', '0', '',                        'log',           'admin', sysdate, '', null, '日志管理菜单');
insert into sys_menu values('109',  '在线用户', '2',   '1', 'online',     'monitor/online/index',     '', 1, 0, 'C', '0', '0', 'monitor:online:list',     'online',        'admin', sysdate, '', null, '在线用户菜单');
insert into sys_menu values('111',  '数据监控', '2',   '3', 'druid',      'monitor/druid/index',      '', 1, 0, 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', sysdate, '', null, '数据监控菜单');
insert into sys_menu values('112',  '缓存列表', '2',   '6', 'cacheList',  'monitor/cache/list',       '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis-list',    'admin', sysdate, '', null, '缓存列表菜单');
insert into sys_menu values('113',  '缓存监控', '2',   '5', 'cache',      'monitor/cache/index',      '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis',         'admin', sysdate, '', null, '缓存监控菜单');
insert into sys_menu values('114',  '表单构建', '3',   '1', 'build',      'tool/build/index',         '', 1, 0, 'C', '0', '0', 'tool:build:list',         'build',         'admin', sysdate, '', null, '表单构建菜单');
script/sql/postgres/postgres_ry_vue_4.X.sql
@@ -260,7 +260,6 @@
insert into sys_menu values('107',  '通知公告', '1',   '8', 'notice',     'system/notice/index',      '', '1', '0', 'C', '0', '0', 'system:notice:list',      'message',       'admin', now(), '', null, '通知公告菜单');
insert into sys_menu values('108',  '日志管理', '1',   '9', 'log',        '',                         '', '1', '0', 'M', '0', '0', '',                        'log',           'admin', now(), '', null, '日志管理菜单');
insert into sys_menu values('109',  '在线用户', '2',   '1', 'online',     'monitor/online/index',     '', '1', '0', 'C', '0', '0', 'monitor:online:list',     'online',        'admin', now(), '', null, '在线用户菜单');
insert into sys_menu values('111',  '数据监控', '2',   '3', 'druid',      'monitor/druid/index',      '', '1', '0', 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', now(), '', null, '数据监控菜单');
insert into sys_menu values('112',  '缓存列表', '2',   '6', 'cacheList',  'monitor/cache/list',       '', '1', '0', 'C', '0', '0', 'monitor:cache:list',      'redis-list',    'admin', now(), '', null, '缓存列表菜单');
insert into sys_menu values('113',  '缓存监控', '2',   '5', 'cache',      'monitor/cache/index',      '', '1', '0', 'C', '0', '0', 'monitor:cache:list',      'redis',         'admin', now(), '', null, '缓存监控菜单');
insert into sys_menu values('114',  '表单构建', '3',   '1', 'build',      'tool/build/index',         '', '1', '0', 'C', '0', '0', 'tool:build:list',         'build',         'admin', now(), '', null, '表单构建菜单');
script/sql/ry_vue_4.X.sql
@@ -172,7 +172,6 @@
insert into sys_menu values('107',  '通知公告', '1',   '8', 'notice',     'system/notice/index',      '', 1, 0, 'C', '0', '0', 'system:notice:list',      'message',       'admin', sysdate(), '', null, '通知公告菜单');
insert into sys_menu values('108',  '日志管理', '1',   '9', 'log',        '',                         '', 1, 0, 'M', '0', '0', '',                        'log',           'admin', sysdate(), '', null, '日志管理菜单');
insert into sys_menu values('109',  '在线用户', '2',   '1', 'online',     'monitor/online/index',     '', 1, 0, 'C', '0', '0', 'monitor:online:list',     'online',        'admin', sysdate(), '', null, '在线用户菜单');
insert into sys_menu values('111',  '数据监控', '2',   '3', 'druid',      'monitor/druid/index',      '', 1, 0, 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', sysdate(), '', null, '数据监控菜单');
insert into sys_menu values('112',  '缓存列表', '2',   '6', 'cacheList',  'monitor/cache/list',       '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis-list',    'admin', sysdate(), '', null, '缓存列表菜单');
insert into sys_menu values('113',  '缓存监控', '2',   '5', 'cache',      'monitor/cache/index',      '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis',         'admin', sysdate(), '', null, '缓存监控菜单');
insert into sys_menu values('114',  '表单构建', '3',   '1', 'build',      'tool/build/index',         '', 1, 0, 'C', '0', '0', 'tool:build:list',         'build',         'admin', sysdate(), '', null, '表单构建菜单');
script/sql/sqlserver/sqlserver_ry_vue_4.X.sql
@@ -1078,8 +1078,6 @@
GO
INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (109, N'在线用户', 2, 1, N'online', N'monitor/online/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:online:list', N'online', N'admin', getdate(), N'', NULL, N'在线用户菜单')
GO
INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (111, N'数据监控', 2, 3, N'druid', N'monitor/druid/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:druid:list', N'druid', N'admin', getdate(), N'', NULL, N'数据监控菜单')
GO
INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (112, N'缓存列表', 2, 6, N'cacheList', N'monitor/cache/list', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis-list', N'admin', getdate(), N'', NULL, N'缓存列表菜单')
GO
INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis', N'admin', getdate(), N'', NULL, N'缓存监控菜单')