原 微服务Spring Cloud Eur

提取自 spring-cloud-netflix-eureka-client-1.4.4.RELEASE.jar!/META-INF/spring-configuration-metadata.json Bean类:org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean 参考配置说明:https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/EurekaInstanceConfig.java

常见配置

name(eureka.instance.xxx开头配置)

defaultValue

description

instance-id

Get the unique Id (within the scope of the appName) of this instance to be registered with eureka. 此实例注册到eureka服务端的唯一的实例ID,其组成为${spring.application.name}:${spring.application.instance_id:${random.value}}

appname

unknown

Get the name of the application to be registered with eureka. 服务名,默认取 spring.application.name 配置值

hostname

The hostname if it can be determined at configuration time (otherwise it will be guessed from OS primitives). 主机名,不配置的时候讲根据操作系统的主机名来获取

prefer-ip-address

false

Flag to say that, when guessing a hostname, the IP address of the server should be used in prference to the hostname reported by the OS. 是否优先使用IP地址作为主机名的标识 如果设置了tru,则使用该属性配置的IP,否则自动获取除环路IP外的第一个IP地址

ip-address

Get the IPAdress of the instance. This information is for academic purposes only as the communication from other instances primarily happen using the information supplied in {@link #getHostName(boolean)}. IP地址

lease-expiration-duration-in-seconds

90

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. Setting this value too long could mean that the traffic could be routed to the instance even though the instance is not alive. Setting this value too small could mean, the instance may be taken out of traffic because of temporary network glitches.This value to be set to atleast higher than the value specified in leaseRenewalIntervalInSeconds. 定义服务续约任务(心跳)的调用间隔,单位:秒 表示eureka client发送心跳给server端的频率。如果在leaseExpirationDurationInSeconds后,server端没有收到client的心跳,则将摘除该instance。除此之外,如果该instance实现了HealthCheckCallback,并决定让自己unavailable的话,则该instance也不会接收到流量。

lease-renewal-interval-in-seconds

30

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. Note that the instance could still not take traffic if it implements HealthCheckCallback and then decides to make itself unavailable. 定义服务失效的时间,单位:秒 表示eureka server至上一次收到client的心跳之后,等待下一次心跳的超时时间,在这个时间内若没收到下一次心跳,则将移除该instance。 该值至少应该大于leaseRenewalIntervalInSeconds

home-page-url

Gets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to use it as a landing page. The full URL should follow the format http:// 获取此实例的绝对主页URL路径,为其他服务提供信息时使用的路径,默认为null

home-page-url-path

/

Gets the relative home page URL Path for this instance. The home page URL is then constructed out of the hostName and the type of communication - secure or unsecure. It is normally used for informational purposes for other services to use it as a landing page. 获取此实例的相关主页URL路径,然后构造出主机名,安全端口等,默认为/

health-check-url

Gets the absolute health check page URL for this instance. The users can provide the healthCheckUrlPath if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. <p> It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http:// 配置健康检查页面的URL,绝对路径

health-check-url-path

/health

Gets the relative health check URL path for this instance. The health check page URL is then constructed out of the hostname and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. 健康检查页面的URL,相对路径,默认使用 HTTP 访问,如果需要使用 HTTPS则需要使用绝对路径

secure-health-check-url

Gets the absolute secure health check page URL for this instance. The users can provide the secureHealthCheckUrl if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. <p> It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http:// 获取此实例的绝对安全健康检查网页的URL路径,默认为null

其他配置

name(eureka.instance.xxx开头配置)

defaultValue

description

a-s-g-name

Gets the AWS autoscaling group name associated with this instance. This information is specifically used in an AWS environment to automatically put an instance out of service after the instance is launched and it has been disabled for traffic.. 与此实例相关联 AWS自动缩放组名称。此项配置是在AWS环境专门使用的实例启动,它已被用于流量停用后自动把一个实例退出服务。

app-group-name

Get the name of the application group to be registered with eureka.

data-center-info

Returns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS. 该实例被部署在数据中心

default-address-resolution-order

获取实例的网络地址,默认为[]

environment

initial-status

Initial status to register with rmeote Eureka server.

instance-enabled-onit

false

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. 实例注册到eureka服务器时,是否开启通讯,默认为false

metadata-map

Gets the metadata name/value pairs associated with this instance. This information is sent to eureka server and can be used by other instances. 获取与此实例相关联的元数据(key,value)。这个信息被发送到eureka服务器,其他实例可以使用。

namespace

eureka

Get the namespace used to find properties. Ignored in Spring Cloud. 获取用于查找属性的命名空间,默认为eureka

non-secure-port

80

Get the non-secure port on which the instance should receive traffic. 获取该实例应该接收通信的非安全端口。默认为80

non-secure-port-enabled

true

Indicates whether the non-secure port should be enabled for traffic or not. 该实例应该接收通信的非安全端口是否启用,默认为true

secure-port

443

Get the Secure port on which the instance should receive traffic.  获取该实例应该接收通信的安全端口,默认为443

secure-port-enabled

false

Indicates whether the secure port should be enabled for traffic or not. 该实例应该接收通信的安全端口是否启用,默认为false

secure-virtual-host-name

unknown

Gets the secure virtual host name defined for this instance. This is typically the way other instance would find this instance by using the secure virtual host name.Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance.

by 斯武丶风晴 https://my.oschina.net/langxSpirit

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏Java技术栈

Jodd - Java界的瑞士军刀轻量级工具包!

2282
来自专栏IMWeb前端团队

pm2模块编写入门

本文作者:IMWeb zzbozheng 原文出处:IMWeb社区 未经同意,禁止转载 PM2 模块 PM2模块是通过PM2来安装和管理,代码可以托管...

2086
来自专栏龙首琴剑庐

原 微服务Spring Cloud Eur

1554
来自专栏云鼎实验室的专栏

跨站的艺术-XSS入门与介绍

什么是XSS? XSS全称跨站脚本(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写...

4027
来自专栏orientlu

FreeRTOS 任务通知

FreeRTOS 从版本 V8.2.0开始提供任务通知这个功能,每个任务都有一个32位的通知值。按照 FreeRTOS 官方的说法,使用消息通知比通过二进制信...

1462
来自专栏葡萄城控件技术团队

Web API 持续集成:PostMan+Newman+Jenkins(图文讲解)

上篇文章我们已经完成了API测试工具选型,接下来是一系列周期性的开发测试过程:接口开发、检出代码、运行测试、记录结果、发送报告。为了快速发现问题,并减少重复过程...

1212
来自专栏Android开发实战

android Ndk JNI 入门

相信很多人对于NDK 开发都是懵逼的,比如都知道把加密的逻辑以及密钥放在so文件中,但是你知道怎么生成so文件吗?你知道开发jni吗?你熟悉jni语法吗?怎么配...

1082
来自专栏C/C++基础

GDB入门教程

GDB(The GNU Debugger),是GNU开源组织发布的一个强大的UNIX程序调试工具。如果你是在 UNIX平台下开发软件,你会发现GDB这个调试工具...

1983
来自专栏逸鹏说道

浅谈zip格式处理逻辑漏洞

前言:zip压缩格式应用广泛,各个平台都有使用,Windows平台使用来压缩文件,Android平台使用来作为apk文件的格式。由于zip文件格式比较复杂,在解...

3785
来自专栏Vamei实验室

Linux进程间通信

我们在Linux信号基础中已经说明,信号可以看作一种粗糙的进程间通信(IPC, interprocess communication)的方式,用以向进程封闭的内...

21710

扫码关注云+社区