|
@@ -0,0 +1,95 @@
|
|
|
+#########################################基础配置#################################################
|
|
|
+server.workId=0
|
|
|
+server.dataCenterId=1
|
|
|
+#########################################数据源配置#################################################
|
|
|
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
|
|
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
|
|
+spring.datasource.url=jdbc:mysql://47.112.217.10:3306/smart_city?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
|
|
|
+spring.datasource.username=root
|
|
|
+spring.datasource.password=100Zone@123
|
|
|
+spring.datasource.druid.initial-size=5
|
|
|
+spring.datasource.druid.min-idle=5
|
|
|
+spring.datasource.druid.max-active=20
|
|
|
+spring.datasource.druid.max-wait=60000
|
|
|
+spring.datasource.druid.time-between-eviction-runs-millis=60000
|
|
|
+spring.datasource.druid.min-evictable-idle-time-millis=300000
|
|
|
+spring.datasource.druid.validation-query=SELECT 1
|
|
|
+spring.datasource.druid.test-while-idle=true
|
|
|
+spring.datasource.druid.test-on-borrow=true
|
|
|
+spring.datasource.druid.test-on-return=false
|
|
|
+spring.datasource.druid.pool-prepared-statements=true
|
|
|
+spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
|
|
|
+spring.datasource.druid.filters=stat,wall
|
|
|
+spring.datasource.druid.connection-properties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
|
|
+#########################################MyBatis配置#################################################
|
|
|
+mybatis.mapper-locations=classpath*:mapper/*.xml
|
|
|
+mybatis.type-aliases-package=com.huaxu.zoniot.entity
|
|
|
+mybatis.configuration.map-underscore-to-camel-case=true
|
|
|
+mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
|
|
+mybatis.configuration.use-column-label=true
|
|
|
+#########################################Redis配置#################################################
|
|
|
+#spring.redis.host=114.135.61.188
|
|
|
+#spring.redis.port=26379
|
|
|
+#spring.redis.password=zoniot
|
|
|
+spring.redis.sentinel.nodes=10.0.0.71:26379,10.0.0.72:26379,10.0.0.73:26379
|
|
|
+spring.redis.sentinel.master=mymaster
|
|
|
+spring.redis.database=0
|
|
|
+spring.redis.timeout=6000
|
|
|
+spring.redis.lettuce.pool.max-active=8
|
|
|
+spring.redis.lettuce.pool.max-wait=100
|
|
|
+spring.redis.lettuce.pool.max-idle=8
|
|
|
+spring.redis.lettuce.pool.min-idle=0
|
|
|
+spring.redis.lettuce.shutdown-timeout=100
|
|
|
+######################################################MongoDB配置#####################################################
|
|
|
+#基础连接参数
|
|
|
+#要连接的数据库
|
|
|
+mongodb.database=meter-reading-database
|
|
|
+#用户名
|
|
|
+mongodb.username=water
|
|
|
+#密码
|
|
|
+mongodb.password=zcxk100
|
|
|
+#IP和端口(host:port),例如127.0.0.1:27017。集群模式用,分隔开,例如host1:port1,host2:port2
|
|
|
+mongodb.address=20.0.0.67:27017
|
|
|
+#设置认证数据库,如果有的话
|
|
|
+mongodb.authenticationDatabase=meter-reading-database
|
|
|
+# 客户端连接池参数
|
|
|
+#客户端的标识,用于定位请求来源等,一般用程序名
|
|
|
+mongodb.clientName=${spring.application.name}
|
|
|
+#TCP(socket)连接超时时间,毫秒
|
|
|
+mongodb.connectionTimeoutMs=5000
|
|
|
+#TCP(socket)连接闲置时间,毫秒
|
|
|
+mongodb.maxConnectionIdleTimeMs=60000
|
|
|
+#TCP(socket)连接最多可以使用多久,毫秒
|
|
|
+mongodb.maxConnectionLifeTimeMs=300000
|
|
|
+#TCP(socket)读取超时时间,毫秒
|
|
|
+mongodb.readTimeoutMs=15000
|
|
|
+#当连接池无可用连接时客户端阻塞等待的最大时长,毫秒
|
|
|
+mongodb.maxWaitTimeMs=5000
|
|
|
+#心跳检测发送频率,毫秒
|
|
|
+mongodb.heartbeatFrequencyMs=20000
|
|
|
+#最小的心跳检测发送频率,毫秒
|
|
|
+mongodb.minHeartbeatFrequencyMs=8000
|
|
|
+#心跳检测连接超时时间,毫秒
|
|
|
+mongodb.heartbeatConnectionTimeoutMs=10000
|
|
|
+#心跳检测读取超时时间,毫秒
|
|
|
+mongodb.heartbeatReadTimeoutMs=15000
|
|
|
+#线程池允许的最大连接数
|
|
|
+mongodb.connectionsPerHost=20
|
|
|
+#线程池空闲时保持的最小连接数
|
|
|
+mongodb.minConnectionsPerHost=4
|
|
|
+#计算允许多少个线程阻塞等待时的乘数,算法:threadsAllowedToBlockForConnectionMultiplier*maxConnectionsPerHost
|
|
|
+mongodb.threadsAllowedToBlockForConnectionMultiplier=10
|
|
|
+#spring.data.mongodb.uri=mongodb://114.135.61.188:17017/meter-reading-database
|
|
|
+logging.level.org.springframework.data.mongodb.core=info
|
|
|
+######################################################SpringBatch配置#####################################################
|
|
|
+# 默认情况下,项目启动时就会自动执行配置好的批处理操作。这里将其设为不自动执行,后面我们通过手动触发执行批处理
|
|
|
+spring.batch.job.enabled=false
|
|
|
+# 项目启动时创建数据表(用于记录批处理执行状态)的 SQL 脚本,该脚本由Spring Batch提供
|
|
|
+spring.datasource.schema=classpath:/org/springframework/batch/core/schema-mysql.sql
|
|
|
+# 项目启动时执行建表 SQL
|
|
|
+spring.batch.initialize-schema=always
|
|
|
+# 每次执行的批大小
|
|
|
+spring.batch.chunk.size=500
|
|
|
+#########################################业务配置############################################
|
|
|
+#定义每个任务的数据集大小
|
|
|
+task.chunk.size=2000
|