更多文章请看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/
参数介绍
属性 | 说明 | 默认值 |
---|---|---|
actuatorPrefix | Default prefix for actuator endpoints | “/actuator” |
appname | the name of the application to be registered with eureka. | “unknown” |
appGroupName | the name of the application group to be registered with eureka | |
instanceEnabledOnit | Indicates 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 | |
nonSecurePort | the non-secure port on which the instance should receive traffic. | 80 |
securePort | the Secure port on which the instance should receive traffic. | 443 |
nonSecurePortEnabled | Indicates whether the non-secure port should be enabled for traffic or not. | true |
securePortEnabled | Indicates whether the secure port should be enabled for traffic or not. | |
leaseRenewalIntervalInSeconds | Indicates 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 |
leaseExpirationDurationInSeconds | Indicates 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 |
virtualHostName | the virtual host name defined for this instance. | “unknown” |
instanceId | the unique Id (within the scope of the appName) of this instance to be registered with eureka. | |
secureVirtualHostName | the secure virtual host name defined for this instance. | “unknown” |
aSGName | the AWS autoscaling group name associated with this instance. | |
metadataMap | the metadata name/value pairs associated with this instance. This information | |
dataCenterInfo | the data center this instance is deployed. | |
ipAddress | the IPAdress of the instance | |
statusPageUrlPath | the relative status page URL path for this instance | actuatorPrefix + “/info” |
statusPageUrl | the absolute status page URL path for this instance | |
homePageUrlPath | the relative home page URL Path for this instance | “/” |
homePageUrl | 主路径 | |
healthCheckUrlPath | 查看运行状况的相对URL | actuatorPrefix + “/health” |
healthCheckUrl | 此实例的绝对运行状况检查页面URL | |
secureHealthCheckUrl | 此实例的绝对安全运行状况检查页面URL | |
namespace | 命名空间用于寻找属性,在SpringCloud中忽略 | “eureka” |
hostname | 主机名(localhost) | |
preferIpAddress | 当猜测主机名时,server的IP地址应当被用于操作系统报告的主机名 | false |
initialStatus | 注册远程Eureka服务器的初始状态 | InstanceStatus.UP |