Code Monkey home page Code Monkey logo

eureka-server-demo's Introduction

SpringCloud eureka 服务宕机踢掉演示DEMO

版本信息:
springboot 1.5.9
springcloud Dalston.RC1

贴重点配置:
server:

eureka:
  instance:
    hostname: localhost
    prefer-ip-address: true
    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
  client:
    register-with-eureka: true
    fetch-registry: false
    service-url:
      defaultZone: http://172.16.80.194:8888/eureka/
  server:
    ###自我保护机制关闭
    enable-self-preservation: false
    ## 清理间隔(单位毫秒,默认是60*1000
    eviction-interval-timer-in-ms: 2000

client:

eureka:
  instance:
    hostname: localhost
    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
    prefer-ip-address: true
    ##设置心跳的周期间隔(默认90s)[如果10s没响应默认服务宕机]
    lease-expiration-duration-in-seconds: 10
    #设置心跳时间间隔(默认30s)[心跳时间2s]
    lease-renewal-interval-in-seconds: 2
  client:
    serviceUrl:
      defaultZone: http://172.16.80.194:8888/eureka/
    #开启健康检查(需要spring-boot-starter-actuator依赖)
    healthcheck:
      enable: true

重点提示:
生产环境不建议这么搞

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.