SpringCloud項目之Eureka 配置 application.yml


記下來供以后參考
項目使用config集中管理其他配置
其中eureka的配置為:
application.yml


spring:
application:
name: EurekaServer
redis:
database: 0
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
maxIdle: 30
maxTotal: 200
timeBetweenEvictionRunsMillis: 30000
minEvictableIdleTimeMillis: 30000
testOnBorrow: true
timeout: 1000
password: 5tgb7ygv
cluster.nodes: 10.....,10.1.....,1111,10.....
cluster.max-redirects: 6


server:
port: 8761

eureka:
instance:
hostname: 34.........120 #本機ip地址,可不配
preferIpAddress: true
instance-id; ${spring.cloud.client.ipAddress}:${server.port}
environment: local #如果使用config 統一配置 environment也不需要
client:
registerWithEureka: false #表示是否注冊自身到eureka服務器, 做集群是設置成true 生產配置為true
fetchRegistry: false #表示是否從eureka服務器獲得注冊信息,生產配置為true
registry-fetch-interval-seconds: 5 #默認為30s 生產使用缺省時間,測試環境修改小點
lease-renewal-interval-in-seconds: 5 #心跳時間,生產使用缺省時間,即服務續約間隔時間(缺省為30秒,生產使用缺省時間,測試環境修改小點)
lease-expiration-duration-in-seconds: 10 #發呆時間,即服務續約到期時間(缺省為90秒,生產使用缺省時間,測試環境修改小點)
serviceUrl:
defaultZone: http://localhost:8761/eureka
server:
enableSelfPreservation: true #關閉自我保護模式(缺省為打開)
eviction-interval-timer-in-ms: 5000 #續期時間,即掃描失效服務的間隔時間(缺省為60*1000ms),測試環境修改小點


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM