|
|
@@ -10,24 +10,75 @@ spring:
|
|
|
|
|
|
#注: 切换数据库时需要将项目根目录中的.init文件删除再重启
|
|
|
# <<=======内置H2数据库连接设置开始==========
|
|
|
+ # jpa:
|
|
|
+ # show-sql: true
|
|
|
+ # hibernate:
|
|
|
+ # ddl-auto: update
|
|
|
+ # properties:
|
|
|
+ # hibernate:
|
|
|
+ # format_sql: true
|
|
|
+ # sql:
|
|
|
+ # init:
|
|
|
+ # schema-locations: classpath:sql/schema.sql
|
|
|
+ # mode: ALWAYS
|
|
|
+ # datasource:
|
|
|
+ # url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
+ # username: sa
|
|
|
+ # password: 123456
|
|
|
+ # driverClassName: org.h2.Driver
|
|
|
+ # type: com.zaxxer.hikari.HikariDataSource
|
|
|
+ # # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
|
|
+ # dynamic:
|
|
|
+ # hikari:
|
|
|
+ # connection-timeout: 5000
|
|
|
+ # idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
|
|
|
+ # min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
|
|
|
+ # max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
|
|
|
+ # max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
|
|
|
+ # is-auto-commit: true
|
|
|
+ # primary: master #设置默认的数据源或者数据源组,默认值即为master
|
|
|
+ # strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
|
|
|
+ # datasource:
|
|
|
+ # # 主库数据源
|
|
|
+ # master:
|
|
|
+ # type: ${spring.datasource.type}
|
|
|
+ # driverClassName: org.h2.Driver
|
|
|
+ # # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
|
|
+ # # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
|
|
+ # url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
+ # username: sa
|
|
|
+ # password: 123456
|
|
|
+ # # 从库数据源
|
|
|
+ # slave:
|
|
|
+ # lazy: true
|
|
|
+ # type: ${spring.datasource.type}
|
|
|
+ # driverClassName: org.h2.Driver
|
|
|
+ # url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
+ # username: sa
|
|
|
+ # password: 123456
|
|
|
+ #
|
|
|
+ # # 内置h2 web console设置
|
|
|
+ # platform: h2
|
|
|
+ # h2:
|
|
|
+ # console:
|
|
|
+ # enabled: true
|
|
|
+ # path: /h2
|
|
|
+ # settings:
|
|
|
+ # web-allow-others: true
|
|
|
+ #=======内置H2数据库连接设置结束==========>>
|
|
|
+
|
|
|
+ # <<==========mysql配置开始==============
|
|
|
jpa:
|
|
|
+ database: MySQL
|
|
|
+ database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
|
|
|
show-sql: true
|
|
|
hibernate:
|
|
|
ddl-auto: update
|
|
|
properties:
|
|
|
hibernate:
|
|
|
format_sql: true
|
|
|
- sql:
|
|
|
- init:
|
|
|
- schema-locations: classpath:sql/schema.sql
|
|
|
- mode: ALWAYS
|
|
|
datasource:
|
|
|
- url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
- username: sa
|
|
|
- password: 123456
|
|
|
- driverClassName: org.h2.Driver
|
|
|
type: com.zaxxer.hikari.HikariDataSource
|
|
|
- # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
|
|
dynamic:
|
|
|
hikari:
|
|
|
connection-timeout: 5000
|
|
|
@@ -42,62 +93,11 @@ spring:
|
|
|
# 主库数据源
|
|
|
master:
|
|
|
type: ${spring.datasource.type}
|
|
|
- driverClassName: org.h2.Driver
|
|
|
+ driverClassName: com.mysql.cj.jdbc.Driver
|
|
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
|
|
- # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
|
|
- url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
- username: sa
|
|
|
- password: 123456
|
|
|
- # 从库数据源
|
|
|
- slave:
|
|
|
- lazy: true
|
|
|
- type: ${spring.datasource.type}
|
|
|
- driverClassName: org.h2.Driver
|
|
|
- url: jdbc:h2:./data/iotkit;MODE=MySQL
|
|
|
- username: sa
|
|
|
+ url: jdbc:mysql://192.168.56.104:3306/iotkit3?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
|
|
|
+ username: root
|
|
|
password: 123456
|
|
|
-
|
|
|
- # 内置h2 web console设置
|
|
|
- platform: h2
|
|
|
- h2:
|
|
|
- console:
|
|
|
- enabled: true
|
|
|
- path: /h2
|
|
|
- settings:
|
|
|
- web-allow-others: true
|
|
|
- #=======内置H2数据库连接设置结束==========>>
|
|
|
-
|
|
|
- # <<==========mysql配置开始==============
|
|
|
-# jpa:
|
|
|
-# database: MySQL
|
|
|
-# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
|
|
|
-# show-sql: true
|
|
|
-# hibernate:
|
|
|
-# ddl-auto: update
|
|
|
-# properties:
|
|
|
-# hibernate:
|
|
|
-# format_sql: true
|
|
|
-# datasource:
|
|
|
-# type: com.zaxxer.hikari.HikariDataSource
|
|
|
-# dynamic:
|
|
|
-# hikari:
|
|
|
-# connection-timeout: 5000
|
|
|
-# idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
|
|
|
-# min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
|
|
|
-# max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
|
|
|
-# max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
|
|
|
-# is-auto-commit: true
|
|
|
-# primary: master #设置默认的数据源或者数据源组,默认值即为master
|
|
|
-# strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
|
|
|
-# datasource:
|
|
|
-# # 主库数据源
|
|
|
-# master:
|
|
|
-# type: ${spring.datasource.type}
|
|
|
-# driverClassName: com.mysql.cj.jdbc.Driver
|
|
|
-# # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
|
|
-# url: jdbc:mysql://192.168.56.104:3306/iotkit3?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
|
|
|
-# username: root
|
|
|
-# password: 123456
|
|
|
# ============mysql配置结束============>>
|
|
|
|
|
|
#<<================es时序数据配置开始===============
|
|
|
@@ -137,7 +137,7 @@ spring:
|
|
|
rocketmq:
|
|
|
name-server: 127.0.0.1:9876
|
|
|
producer:
|
|
|
- group: iotkit
|
|
|
+ group: iotkit
|
|
|
|
|
|
#图片存储用的是阿里云oss,如果需要上传产品图片才需要配置
|
|
|
aliyun:
|
|
|
@@ -206,4 +206,4 @@ plugin:
|
|
|
mainPackage: cc.iotkit
|
|
|
# 如果配置是 windows 下路径, mac、linux 自行修改
|
|
|
pluginPath:
|
|
|
- - ./data/plugins
|
|
|
+ - ./data/plugins
|