SpringBoot鍜孲pringCloud閰嶇疆
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot鍜孲pringCloud閰嶇疆相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/127.0.0.1' title='127.0.0.1'>127.0.0.1
use spring driver The tween ebe app enable1銆佸熀鏈厤缃?/p>
#椤圭洰鍚嶇О(璁块棶璺緞)
server.context-path=/manager
#绔彛
server.port=8764
#session杩囨湡鏃堕棿
server.sessionTimeout=30
#鏈嶅姟鍚嶇О
spring.application.name=ribbon
eureka.instance.hostname=${spring.cloud.client.ipAddress}
#娉ㄥ唽涓績鍦板潃
eureka.client.serviceUrl.defaultZone=http://admin:[email protected]:9501/eureka/
#琛ㄧず鏄惁灏嗚嚜宸辨敞鍐屽埌Eureka Server
eureka.client.registerWithEureka=false
#琛ㄧず鏄惁浠嶦ureka Server鑾峰彇娉ㄥ唽淇℃伅
eureka.client.fetchRegistry=true
#娉ㄥ唽涓績
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
#娉ㄥ唽涓績鐢ㄦ埛瀵嗙爜
security.basic.enabled=true
security.user.name=admin
security.user.password=123456
#浣跨敤IP娉ㄥ唽
eureka.instance.preferIpAddress=true
eureka.instance.instance-id=${spring.cloud.client.ipAddress}:${server.port}
#浣跨敤鐜
spring.profiles.active=dev
#鏈嶅姟璋冪敤瓒呮椂
#璇锋眰澶勭悊鐨勮秴鏃舵椂闂?榛樿5s)
ribbon.ReadTimeout=5000
#璇锋眰杩炴帴鐨勮秴鏃舵椂闂?榛樿2s)
ribbon.ConnectTimeout=2000
#瀵规墍鏈夋搷浣滆姹傞兘杩涜閲嶈瘯
hello-service.ribbon.OkToRetryOnAllOperations=false
#瀵瑰綋鍓嶅疄渚嬬殑閲嶈瘯娆℃暟
ribbon.MaxAutoRetries=0
#鍒囨崲瀹炰緥鐨勯噸璇曟鏁?br />ribbon.MaxAutoRetriesNextServer=0
#缂栫爜
server.tomcat.uri-encoding=UTF-8
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
spring.messages.encoding=UTF-8
2銆佹暟鎹簱
datasource.driver-class-name=com.mysql.jdbc.Driver
datasource.username=admin
datasource.password=123456
datasource.url=jdbc:mysql://127.0.0.1:3306/db?characterEncoding=UTF-8&useUnicode=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
#鏁版嵁搴撻厤缃畇tart
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#鍒濆鍖栧ぇ灏?br />spring.datasource.initial-size=5
#閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂?br />spring.datasource.max-wait=10000
#杩炴帴姹犳渶灏忕┖闂?br />spring.datasource.min-idle=5
#鏈€澶?br />spring.datasource.max-active=20
#閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫€娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
spring.datasource.time-between-eviction-runs-millis=30000
#閰嶇疆涓€涓繛鎺ュ湪姹犱腑鏈€灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
spring.datasource.min-evictable-idle-time-millis=600000
spring.datasource.validation-query=SELECT 1 FROM DUAL
spring.datasource.test-while-idle=true
#spring.datasource.test-on-borrow=false
#spring.datasource.test-on-return=false
#鎵撳紑PSCache,骞朵笖鎸囧畾姣忎釜杩炴帴涓婄殑PSCache鐨勫ぇ灏?br />#spring.datasource.pool-prepared-statements=true
#spring.datasource.max-pool-prepared-statement-per-connection-size=20
#閰嶇疆鐩戞帶缁熻鎷︽埅鐨刦ilters,鍘绘帀鍚庣洃鎺х晫闈ql鏃犳硶缁熻 wall鐢ㄤ簬闃茬伀澧?br />spring.datasource.filters=stat,wall,log4j
#閫氳繃connectProperties灞炴€ф潵鎵撳紑mergeSql鍔熻兘锛涙參SQL璁板綍
spring.datasource.connection-properties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 鍚堝苟澶氫釜DruidDataSource鐨勭洃鎺ф暟鎹?br />#spring.datasource.useGlobalDataSourceStat=true
#鏁版嵁搴撻厤缃甧nd
#druid鐧诲綍鐢ㄦ埛鍚嶅瘑鐮?br />druid_loginUsername=root
druid_loginPassword=123456
3銆佹棩蹇?/p>
#LOG
logging.file=./logs/log.log
#鏃ュ織绾у埆
logging.level.org.springframework=DEBUG
logging.level.com.creditlink.center.provider.dao=DEBUG
4銆丮ybatis
#mybatis
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
mybatis.config-location=classpath:mybatis.xml
5銆乵ongodb
#spring.data.mongodb.uri=mongodb://name:[email protected]:37777/creditlink
spring.data.mongodb.uri=mongodb://127.0.01:37777/creditlink
6銆丷edis
-
spring.redis.host=localhost
-
spring.redis.port=6379
-
#spring.redis.password=
-
spring.redis.database=1
-
spring.redis.pool.max-active=8
-
spring.redis.pool.max-wait=-1
-
spring.redis.pool.max-idle=500
-
spring.redis.pool.min-idle=0
-
spring.redis.timeout=0
以上是关于SpringBoot鍜孲pringCloud閰嶇疆的主要内容,如果未能解决你的问题,请参考以下文章
鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?