123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- dataSources:
- cpp:
- dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
- driverClassName: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://192.168.1.205:3306/cpp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
- username: root
- password: '!QAZ2root'
- # 初始连接数
- initialSize: 5
- # 最小连接池数量
- minIdle: 10
- # 最大连接池数量
- maxActive: 20
- # 配置获取连接等待超时的时间
- maxWait: 60000
- # 配置连接超时时间
- connectTimeout: 30000
- # 配置网络超时时间
- socketTimeout: 60000
- # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
- timeBetweenEvictionRunsMillis: 60000
- # 配置一个连接在池中最小生存的时间,单位是毫秒
- minEvictableIdleTimeMillis: 300000
- # 配置一个连接在池中最大生存的时间,单位是毫秒
- maxEvictableIdleTimeMillis: 900000
- # 配置检测连接是否有效
- validationQuery: SELECT 1 FROM DUAL
- testWhileIdle: true
- testOnBorrow: false
- testOnReturn: false
- 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
- # cpp:
- # dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- # driverClassName: com.mysql.jdbc.Driver
- # jdbcUrl: jdbc:mysql://192.168.1.205:3306/cpp?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
- # username: root
- # password: '!QAZ2root'
- # hikari:
- # minimum-idle: 5 # 最小空闲连接数量
- # idle-timeout: 600000 # 空闲连接存活最大时间,默认为10分钟(600000毫秒),此处设置为3分钟(180000毫秒)
- # maximum-pool-size: 20 # 连接池最大连接数,默认为10
- # auto-commit: true # 自动提交事务,默认为true
- # max-lifetime: 1800000 # 连接最大生命周期,默认为30分钟(1800000毫秒)
- # connection-timeout: 30000 # 数据库连接超时时间,默认为30秒(30000毫秒)
- rules:
- - !SHARDING
- tables:
- cpp_forecast_power_ultra_short_term_regulation:
- actualDataNodes: cpp.cpp_forecast_power_ultra_short_term_regulation
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_ultra_short_term_station:
- actualDataNodes: cpp.cpp_forecast_power_ultra_short_term_station
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_ultra_short_term_cloud:
- actualDataNodes: cpp.cpp_forecast_power_ultra_short_term_cloud
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_short_term_station:
- actualDataNodes: cpp.cpp_forecast_power_short_term_station
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_short_term_send:
- actualDataNodes: cpp.cpp_forecast_power_short_term_send
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_short_term_regulation:
- actualDataNodes: cpp.cpp_forecast_power_short_term_regulation
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_forecast_power_short_term_cloud:
- actualDataNodes: cpp.cpp_forecast_power_short_term_cloud
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_power_station_status_data:
- actualDataNodes: cpp.cpp_power_station_status_data
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_parsing_log:
- actualDataNodes: cpp.cpp_parsing_log
- tableStrategy:
- standard:
- shardingColumn: create_time
- shardingAlgorithmName: auto-custom
- cpp_weather_station_status_data:
- actualDataNodes: cpp.cpp_weather_station_status_data
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_wind_tower_status_data:
- actualDataNodes: cpp.cpp_wind_tower_status_data
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_wind_turbine_status_data:
- actualDataNodes: cpp.cpp_wind_turbine_status_data
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_inverter_status_data:
- actualDataNodes: cpp.cpp_inverter_status_data
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_nwp_cloud:
- actualDataNodes: cpp.cpp_nwp_cloud
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- cpp_nwp_station:
- actualDataNodes: cpp.cpp_nwp_station
- tableStrategy:
- standard:
- shardingColumn: time
- shardingAlgorithmName: auto-custom
- shardingAlgorithms:
- auto-custom:
- type: CLASS_BASED
- props:
- strategy: standard
- algorithmClassName: com.cpp.web.core.config.sharding.TimeShardingAlgorithm
- interval:
- type: INTERVAL
- props:
- datetime-pattern: 'yyyy-MM'
- datetime-lower: '2024-01'
- datetime-upper: '2025-12'
- sharding-suffix-pattern: 'yyyyMM'
- # 间隔大小
- datetime-interval-amount: 1
- datetime-interval-unit: 'Months'
- props:
- sql-show: false
- allow-range-query-with-inline-sharding: true
|