常用配置中文说明文档:
配置参数 | 默认值 | 说明 |
---|---|---|
eureka.instance | ||
eureka.instance.prefer-ip-address | true | 不使用主机名来定义注册中心的地址,而使用IP地址的形式,如果设置了 eureka.instance.ip-address 属性,则使用该属性配置的IP,否则自动获取除环路IP外的第一个IP地址 |
eureka.instance.ip-address | IP地址 | |
eureka.instance.hostname | 设置当前实例的主机名称 | |
eureka.instance.appname | 服务名,默认取 spring.application.name 配置值,如果没有则为 unknown | |
eureka.instance.lease-renewal-interval-in-seconds | 30 | 定义服务续约任务(心跳)的调用间隔,单位:秒 |
eureka.instance.lease-expiration-duration-in-seconds | 90 | 定义服务失效的时间,单位:秒 |
eureka.instance.status-page-url-path | /info | 状态页面的URL,相对路径,默认使用 HTTP 访问,如果需要使用 HTTPS则需要使用绝对路径配置 |
eureka.instance.status-page-url | 状态页面的URL,绝对路径 | |
eureka.instance.health-check-url-path | /health | 健康检查页面的URL,相对路径,默认使用 HTTP 访问,如果需要使用 HTTPS则需要使用绝对路径配置 |
eureka.instance.health-check-url | 健康检查页面的URL,绝对路径 | |
eureka.server | ||
eureka.server.enable-self-preservation | true | 是否开启自我保护,Eureka 会统计15分钟之内心跳失败的比例低于85%将会触发保护机制,不剔除服务提供者,如果关闭服务注册中心将不可用的实例正确剔除 |
eureka.server.eviction-interval-timer-in-ms | 60 | server清理无效节点的时间间隔 |
eureka.dashboard.enabled | true | 是否开启仪表盘 |
eureka.dashboard.path | / | 仪表盘访问路径 |
eureka.client | ||
eureka.client.enabled | true | 是否开启client |
eureka.client.service-url | 指定服务注册中心地址,类型为 HashMap,并设置有一组默认值,默认的Key为 defaultZone;默认的Value为 http://localhost:8761/eureka ,如果服务注册中心为高可用集群时,多个注册中心地址以逗号分隔。 如果服务注册中心加入了安全验证,这里配置的地址格式为: http://<username>:<password>@localhost:8761/eureka 其中 <username> 为安全校验的用户名;<password> 为该用户的密码 |
|
eureka.client.fetch-registery | true | 是否检索服务 |
eureka.client.registery-fetch-interval-seconds | 30 | 从Eureka服务器端获取注册信息的间隔时间,单位:秒 |
eureka.client.register-with-eureka | true | 启动服务注册 |
eureka.client.eureka-server-connect-timeout-seconds | 5 | 连接 Eureka Server 的超时时间,单位:秒 |
eureka.client.eureka-server-read-timeout-seconds | 8 | 读取 Eureka Server 信息的超时时间,单位:秒 |
eureka.client.filter-only-up-instances | true | 获取实例时是否过滤,只保留UP状态的实例 |
eureka.client.eureka-connection-idle-timeout-seconds | 30 | Eureka 服务端连接空闲关闭时间,单位:秒 |
eureka.client.eureka-server-total-connections | 200 | 从Eureka 客户端到所有Eureka服务端的连接总数 |
eureka.client.eureka-server-total-connections-per-host | 50 | 从Eureka客户端到每个Eureka服务主机的连接总数 |
配置说明源文件路径,可以到此路径下查看英文说明
Client端:
\org\springframework\cloud\spring-cloud-netflix-eureka-client\2.1.0.RELEASE\spring-cloud-netflix-eureka-client-2.1.0.RELEASE.jar!\META-INF\spring-configuration-metadata.json
{
"groups": [
{
"name": "eureka.client",
"type": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.transport",
"type": "com.netflix.discovery.shared.transport.EurekaTransportConfig",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"sourceMethod": "getTransport()"
},
{
"name": "eureka.instance",
"type": "org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean"
}
],
"properties": [
{
"name": "eureka.client.allow-redirects",
"type": "java.lang.Boolean",
"description": "Indicates whether server can redirect a client request to a backup server\/cluster. If set to false, the server will handle the request directly, If set to true, it may send HTTP redirect to the client, with a new server location.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": false
},
{
"name": "eureka.client.availability-zones",
"type": "java.util.Map<java.lang.String,java.lang.String>",
"description": "Gets the list of availability zones (used in AWS data centers) for the region in which this instance resides. The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.backup-registry-impl",
"type": "java.lang.String",
"description": "Gets the name of the implementation which implements BackupRegistry to fetch the registry information as a fall back option for only the first time when the eureka client starts. This may be needed for applications which needs additional resiliency for registry information without which it cannot operate.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.cache-refresh-executor-exponential-back-off-bound",
"type": "java.lang.Integer",
"description": "Cache refresh executor exponential back off related property. It is a maximum multiplier value for retry delay, in case where a sequence of timeouts occurred.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": 10
},
{
"name": "eureka.client.cache-refresh-executor-thread-pool-size",
"type": "java.lang.Integer",
"description": "The thread pool size for the cacheRefreshExecutor to initialise with",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": 2
},
{
"name": "eureka.client.client-data-accept",
"type": "java.lang.String",
"description": "EurekaAccept name for client data accept",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.decoder-name",
"type": "java.lang.String",
"description": "This is a transient config and once the latest codecs are stable, can be removed (as there will only be one)",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.disable-delta",
"type": "java.lang.Boolean",
"description": "Indicates whether the eureka client should disable fetching of delta and should rather resort to getting the full registry information. Note that the delta fetches can reduce the traffic tremendously, because the rate of change with the eureka server is normally much lower than the rate of fetches. The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": false
},
{
"name": "eureka.client.dollar-replacement",
"type": "java.lang.String",
"description": "Get a replacement string for Dollar sign <code>$<\/code> during serializing\/deserializing information in eureka server.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": "_-"
},
{
"name": "eureka.client.enabled",
"type": "java.lang.Boolean",
"description": "Flag to indicate that the Eureka client is enabled.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": true
},
{
"name": "eureka.client.encoder-name",
"type": "java.lang.String",
"description": "This is a transient config and once the latest codecs are stable, can be removed (as there will only be one)",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.escape-char-replacement",
"type": "java.lang.String",
"description": "Get a replacement string for underscore sign <code>_<\/code> during serializing\/deserializing information in eureka server.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": "__"
},
{
"name": "eureka.client.eureka-connection-idle-timeout-seconds",
"type": "java.lang.Integer",
"description": "Indicates how much time (in seconds) that the HTTP connections to eureka server can stay idle before it can be closed. In the AWS environment, it is recommended that the values is 30 seconds or less, since the firewall cleans up the connection information after a few mins leaving the connection hanging in limbo",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": 30
},
{
"name": "eureka.client.eureka-server-connect-timeout-seconds",
"type": "java.lang.Integer",
"description": "Indicates how long to wait (in seconds) before a connection to eureka server needs to timeout. Note that the connections in the client are pooled by org.apache.http.client.HttpClient and this setting affects the actual connection creation and also the wait time to get the connection from the pool.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"defaultValue": 5
},
{
"name": "eureka.client.eureka-server-d-n-s-name",
"type": "java.lang.String",
"description": "Gets the DNS name to be queried to get the list of eureka servers.This information is not required if the contract returns the service urls by implementing serviceUrls. The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.eureka-server-port",
"type": "java.lang.String",
"description": "Gets the port to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS.This information is not required if the contract returns the service urls eurekaServerServiceUrls(String). The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.",
"sourceType": "org.springframework.cloud.netflix.eureka.EurekaClientConfigBean"
},
{
"name": "eureka.client.eureka-server-read-timeout-seconds