zoukankan      html  css  js  c++  java
  • 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),测试环境修改小点

  • 相关阅读:
    在Linux服务器上添加ip白名单允许ssh登录访问
    crontab + shell脚本实现文件重命名
    mysql数据库提示ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    附加题2:中文编程的发展角度
    附加题1:实体店的未来存在形式
    第八周作业
    第七周作业
    第六周作业
    第五周作业
    第四周作业
  • 原文地址:https://www.cnblogs.com/yunyunde/p/11174536.html
Copyright © 2011-2022 走看看