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   enable   

1銆佸熀鏈厤缃?/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

  1. spring.redis.host=localhost
  2. spring.redis.port=6379
  3. #spring.redis.password=
  4. spring.redis.database=1
  5. spring.redis.pool.max-active=8
  6. spring.redis.pool.max-wait=-1
  7. spring.redis.pool.max-idle=500
  8. spring.redis.pool.min-idle=0
  9. spring.redis.timeout=0

以上是关于SpringBoot鍜孲pringCloud閰嶇疆的主要内容,如果未能解决你的问题,请参考以下文章

鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?

Linux閰嶇疆闈欐€両P

Spring Cloud Alibaba锛堜簩锛?閰嶇疆涓績澶氶」鐩€佸閰嶇疆鏂囦欢銆佸垎鐩綍瀹炵幇

HBase闆嗙兢鎼缓閮ㄥ垎閰嶇疆

redis 閰嶇疆

nginx 閰嶇疆浜岀骇鍩熷悕