Spring Cloud 学习--Eureka之配置类EurekaInstanceConfigBean.java

更多文章请看Spring Cloud 学习

Spring Cloud 学习–Eureka之配置类EurekaInstanceConfigBean.java

我们在配置文件中会进行eureka相关的配置,其中eureka.instance的配置是EurekaInstanceConfigBean类,
eureka.client配置的是EurekaClientConfigBean类。本文主要讲解EurekaInstanceConfigBean类。

eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url:
      defaultZone:
          http://${eureka.instance.hostname}:${server.port}/eureka/

参数介绍

属性说明默认值
actuatorPrefixDefault prefix for actuator endpoints“/actuator”
appnamethe name of the application to be registered with eureka.“unknown”
appGroupNamethe name of the application group to be registered with eureka
instanceEnabledOnitIndicates whether the instance should be enabled for taking traffic as soon as it is registered with eureka. Sometimes the application might need to do some pre-processing before it is ready to take traffic
nonSecurePortthe non-secure port on which the instance should receive traffic.80
securePortthe Secure port on which the instance should receive traffic.443
nonSecurePortEnabledIndicates whether the non-secure port should be enabled for traffic or not.true
securePortEnabledIndicates whether the secure port should be enabled for traffic or not.
leaseRenewalIntervalInSecondsIndicates how often (in seconds) the eureka client needs to send heartbeats to eureka server to indicate that it is still alive. If the heartbeats are not received for the period specified in leaseExpirationDurationInSeconds, eureka server will remove the instance from its view, there by disallowing traffic to this instance.30
leaseExpirationDurationInSecondsIndicates the time in seconds that the eureka server waits since it received the last heartbeat before it can remove this instance from its view and there by disallowing traffic to this instance.90
virtualHostNamethe virtual host name defined for this instance.“unknown”
instanceIdthe unique Id (within the scope of the appName) of this instance to be registered with eureka.
secureVirtualHostNamethe secure virtual host name defined for this instance.“unknown”
aSGNamethe AWS autoscaling group name associated with this instance.
metadataMapthe metadata name/value pairs associated with this instance. This information
dataCenterInfothe data center this instance is deployed.
ipAddressthe IPAdress of the instance
statusPageUrlPaththe relative status page URL path for this instanceactuatorPrefix + “/info”
statusPageUrlthe absolute status page URL path for this instance
homePageUrlPaththe relative home page URL Path for this instance“/”
homePageUrl主路径
healthCheckUrlPath查看运行状况的相对URLactuatorPrefix + “/health”
healthCheckUrl此实例的绝对运行状况检查页面URL
secureHealthCheckUrl此实例的绝对安全运行状况检查页面URL
namespace命名空间用于寻找属性,在SpringCloud中忽略“eureka”
hostname主机名(localhost)
preferIpAddress当猜测主机名时,server的IP地址应当被用于操作系统报告的主机名false
initialStatus注册远程Eureka服务器的初始状态InstanceStatus.UP
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值