zoukankan      html  css  js  c++  java
  • springCloud 之 Eureka注册中心高可用配置

    Eureka1 配置

    #高可用实例1
    spring:
      application:
        name: eureka
    
    server:
      port: 8010
    
    #eureka.instance.lease-expiration-duration-in-seconds
    #eureka server设置剔除出注册中心的超时时间(单位:秒)
    
    #eureka.instance.lease-renewal-interval-in-seconds
    #eureka client客户端发送心跳给服务端的频率. 该值至少要比lease-expiration-duration-in-seconds小才有意义(单位:秒)
    
    #eureka.client.registry-fetch-interval-seconds
    #eureka client客户端更新注册发现的时间间隔(单位:秒)
    
    eureka:
      instance:
        hostname: dev1
        lease-expiration-duration-in-seconds: 30
        lease-renewal-interval-in-seconds: 10
        appname: ${spring.application.name}
      client:
        registerWithEureka: false
        fetchRegistry: false
        serviceUrl:
          defaultZone: http://localhost:8011/eureka/,http://localhost:8012/eureka/
        registry-fetch-interval-seconds: 5
      server:
        enable-self-preservation: false
        eviction-interval-timer-in-ms: 10000 #清理无效节点的时间间隔,默认60000毫秒,即60秒
    
    management:
      server:
        port: ${server.port}
      endpoints:
        web:
          exposure:
            include: '*'
        jmx:
          exposure:
            include: '*'
      endpoint:
        health:
          show-details: always

    Eureka2 配置

    #高可用实例1
    spring:
      application:
        name: eureka
    
    server:
      port: 8011
    
    #eureka.instance.lease-expiration-duration-in-seconds
    #eureka server设置剔除出注册中心的超时时间(单位:秒)
    
    #eureka.instance.lease-renewal-interval-in-seconds
    #eureka client客户端发送心跳给服务端的频率. 该值至少要比lease-expiration-duration-in-seconds小才有意义(单位:秒)
    
    #eureka.client.registry-fetch-interval-seconds
    #eureka client客户端更新注册发现的时间间隔(单位:秒)
    
    eureka:
      instance:
        hostname: dev2
        lease-expiration-duration-in-seconds: 30
        lease-renewal-interval-in-seconds: 10
        appname: ${spring.application.name}
      client:
        registerWithEureka: false
        fetchRegistry: false
        serviceUrl:
          defaultZone: http://localhost:8010/eureka/,http://localhost:8012/eureka/
        registry-fetch-interval-seconds: 5
      server:
        enable-self-preservation: false
        eviction-interval-timer-in-ms: 10000 #续期时间,清理无效服务的时间间隔,默认是60*1000
    
    management:
      server:
        port: ${server.port}
      endpoints:
        web:
          exposure:
            include: '*'
        jmx:
          exposure:
            include: '*'
      endpoint:
        health:
          show-details: always

    Eureka3 配置

    #高可用实例1
    spring:
      application:
        name: eureka
    
    server:
      port: 8012
    
    #eureka.instance.lease-expiration-duration-in-seconds
    #eureka server设置剔除出注册中心的超时时间(单位:秒)
    
    #eureka.instance.lease-renewal-interval-in-seconds
    #eureka client客户端发送心跳给服务端的频率. 该值至少要比lease-expiration-duration-in-seconds小才有意义(单位:秒)
    
    #eureka.client.registry-fetch-interval-seconds
    #eureka client客户端更新注册发现的时间间隔(单位:秒)
    
    eureka:
      instance:
        hostname: dev3 #服务注册中心实例主机名
        lease-expiration-duration-in-seconds: 30
        lease-renewal-interval-in-seconds: 10
        appname: ${spring.application.name}
      client:
        registerWithEureka: false #是否向注册中心注册自己
        fetchRegistry: false #是否获取注册表
        serviceUrl:
          defaultZone: http://localhost:8010/eureka/,http://localhost:8011/eureka/
        registry-fetch-interval-seconds: 5
      server:
        enable-self-preservation: false
        eviction-interval-timer-in-ms: 10000 #续期时间,清理无效服务的时间间隔,默认是60*1000
    
    management:
      server:
        port: ${server.port}
      endpoints:
        web:
          exposure:
            include: '*'
        jmx:
          exposure:
            include: '*'
      endpoint:
        health:
          show-details: always

    client 配置

    server:
      port: 8021
    
    eureka:
      client:
        serviceUrl:
          defaultZone: http://localhost:8010/eureka/,http://localhost:8011/eureka/,http://localhost:8012/eureka/
    
    spring:
      zipkin:
        base-url: http://localhost:9411
      sleuth:
        sampler:
          probability: 1.0
  • 相关阅读:
    nginx 附件上传不上去 client_max_body_size 设置的太小
    python 1
    NGINX 常用配置
    Linux OOM Killer 保护机制
    MacbookPro接上HDM连接显示器不能上网的解决方法
    python 逻辑运算符 () > not > and > or
    TASSL 服务端 客户端测试代码
    SSL通信双方如何判断对方采用了国密
    C/S boringSSL那点事
    从Chrome源码看浏览器的事件机制
  • 原文地址:https://www.cnblogs.com/code4app/p/13366881.html
Copyright © 2011-2022 走看看