Guwan-smartSchool/shapelight-admin/src/main/resources/application-dev.yml

323 lines
11 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.20:3306/cell_db_v8_http_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
username: user
password: user@server001
# url: jdbc:mysql://39.96.9.232:3306/cell_db_v8_http?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
# username: rootuser
# password: xtzg_db_USER@0325
initial-size: 50
max-active: 110
min-idle: 31
max-wait: 110000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 22
time-between-eviction-runs-millis: 70000
min-evictable-idle-time-millis: 310000
#validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: true
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
login-username: admin
login-password: admin@A1
allow:
web-stat-filter:
enabled: true
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
enabled: true
db-type: mysql
wall:
config:
multi-statement-allow: true
#sharding.jdbc:
# data-sources:
# ds_master:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=utf-8&useSSL=true
# username: root
# password: root
# ds_slave_0:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db_0?useUnicode=true&characterEncoding=utf-8&useSSL=true
# username: root
# password: root
# master-slave-rule:
# name: ds_ms
# master-data-source-name: ds_master
# slave-data-source-names: ds_slave_0
# load-balance-algorithm-type: round_robin
#mybatis-plus:
# mapper-locations: classpath*:/com/hjc/sharding/*/mapper/xml/*Mapper.xml
# #实体扫描多个package用逗号或者分号分隔
# typeAliasesPackage: com.hjc.sharding.*.entity
# global-config:
# #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
# id-type: 2
# #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
# field-strategy: 2
# #驼峰下划线转换
# db-column-underline: true
# #刷新mapper 调试神器
# refresh-mapper: true
# #数据库大写下划线转换
# #capital-mode: true
# #序列接口实现类配置
# #key-generator: com.baomidou.springboot.xxx
# #逻辑删除配置下面3个配置
# logic-delete-value: 0
# logic-not-delete-value: 1
# #自定义SQL注入器
# #sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
# #自定义填充策略接口实现
# #meta-object-handler: com.baomidou.springboot.xxx
# configuration:
# map-underscore-to-camel-case: true
# cache-enabled: fals
#sharding:
# jdbc:
# datasource:
# names: ds0
# # 数据源ds0
# ds0:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db
# username: root
# password: root
# config:
# sharding:
# props:
# sql.show: true
# tables:
# ten_person: #t_user表
# key-generator-column-name: id #主键
# actual-data-nodes: ds0.ten_person${0..1} #数据节点,均匀分布
# table-strategy: #分表策略
# inline: #行表达式
# sharding-column: id
# algorithm-expression: ten_person${id % 2} #按模运算分配
#spring:
# shardingsphere:
# datasource:
# names: ds0,ds1
# ds0:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# jdbc-url: jdbc:mysql://localhost:3306/cell_db
# username: root
# password: root
# ds1:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# jdbc-url: jdbc:mysql://localhost:3306/cell_db_0
# username: root
# password: root
# sharding:
# tables:
# t_order:
# actual-data-nodes: ds$->{0..1}.t_order$->{0..1}
# ## 指定分库规则
# database-strategy:
# inline:
# sharding-column: user_id
# algorithm-expression: ds$->{user_id % 2}
# ## 指定分表规则
# table-strategy:
# inline:
# sharding-column: order_id
# algorithm-expression: t_order$->{order_id % 2}
#
# t_order_item:
# actual-data-nodes: ds$->{0..1}.t_order_item$->{0..1}
# ## 通过hint方式自定义分库规则
# database-strategy:
# hint:
# algorithmClassName: com.hujy.demo.hint.HintSharding
# ## 指定分表规则
# table-strategy:
# inline:
# sharding-column: order_id
# algorithm-expression: t_order_item$->{order_id % 2}
# ## 生成分布式主键
# key-generator:
# column: item_id
# type: SNOWFLAKE
#
# ## 绑定主表与子表,避免关联查询导致的全数据源路由
# binding-tables: t_order,t_order_item
#
# ## 配置广播表:以广播的形式保存(如果只涉及查询的话可以不配置,会随机取一个数据源)
# broadcast-tables: t_config
#
# ## 打印sql
# props:
# sql:
# show: true
#spring:
# datasource:
# # 数据源shard_one
# dataOne:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: root
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# max-evictable-idle-time-millis: 60000
# validation-query: SELECT 1 FROM DUAL
# # validation-query-timeout: 5000
# test-on-borrow: false
# test-on-return: false
# test-while-idle: true
# connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# # 数据源shard_two
# dataTwo:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driverClassName: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: root
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# max-evictable-idle-time-millis: 60000
# validation-query: SELECT 1 FROM DUAL
# # validation-query-timeout: 5000
# test-on-borrow: false
# test-on-return: false
# test-while-idle: true
# connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# # 数据源shard_three
# dataThree:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driverClassName: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: root
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# max-evictable-idle-time-millis: 60000
# validation-query: SELECT 1 FROM DUAL
# # validation-query-timeout: 5000
# test-on-borrow: false
# test-on-return: false
# test-while-idle: true
# connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#sharding:
# jdbc:
# type: com.alibaba.druid.pool.DruidDataSource
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF-8
# username: root
# password: root
# connectionProperties: config.decrypt=true;druid.stat.slowSqlMillis=3000;druid.stat.logSlowSql=true;druid.stat.mergeSql=true
# filters: stat
# maxActive: 100
# initialSize: 1
# maxWait: 15000
# minIdle: 1
# timeBetweenEvictionRunsMillis: 30000
# minEvictableIdleTimeMillis: 180000
# validationQuery: SELECT 'x'
# testWhileIdle: true
# testOnBorrow: false
# testOnReturn: false
# poolPreparedStatements: false
# maxPoolPreparedStatementPerConnectionSize: 20
# removeAbandoned: true
# removeAbandonedTimeout: 600
# logAbandoned: false
# connectionInitSqls:
#mybatis-plus:
# # config-location: classpath:mybatis-config.xml
# mapper-locations: classpath*:mapper/*.xml
# type-aliases-package: net.shapelight.modules.*.entity
# global-config:
# id-type: 3 #1:数据库ID自增 2:用户输入id 3:全局唯一id(IdWorker) 4:全局唯一ID(uuid)
# db-column-underline: false
# refresh-mapper: true
# configuration:
# map-underscore-to-camel-case: true
# cache-enabled: true #配置的缓存的全局开关
# lazyLoadingEnabled: true #延时加载的开关
# multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
#spring:
# shardingsphere:
# datasource:
# names: m1 #配置库的名字,随意
# m1: #配置目前m1库的数据源信息
# type: com.alibaba.druid.pool.DruidDataSource
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF-8
# username: root
# password: root
# sharding:
# tables:
# t_order: # 指定t_order表的数据分布情况配置数据节点
# actualDataNodes: m1.sys_db_bak_$->{1..2}
# tableStrategy:
# inline: # 指定t_order表的分片策略分片策略包括分片键和分片算法
# shardingColumn: id
# algorithmExpression: sys_db_bak_$->{order_id % 2 + 1}
# keyGenerator: # 指定t_order表的主键生成策略为SNOWFLAKE
# type: SNOWFLAKE #主键生成策略为SNOWFLAKE
# column: id #指定主键
# props:
# sql:
# show: truearticle/details/103767507