原 微服务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 条评论
登录 后参与评论

相关文章

来自专栏生信宝典

任务流管理工具 - Airflow配置和使用

Airflow能做什么 Airflow是一个工作流分配管理系统,通过有向非循环图的方式管理任务流程,设置任务依赖关系和时间调度。 Airflow独立于我们要运行...

3656
来自专栏运维小白

Linux基础(day39)

11.1 LAMP架构介绍 LAMP架构介绍 LAMP架构包含了 Linux+Apache(httpd)+MySQL+PHP ,简称LAMP Linux是操...

1828
来自专栏醉生梦死

Centos6.9系统部分基础优化(更新时间2018/04/19)

注:此博客仅供参考,读者可根据自己的实际情况进行合理的配置,博客内容参考老男孩书籍《web集群实战》一书

743
来自专栏清风

企业Linux运维SHELL编写规范 原

为了方便维护人员维护,需要规定两个正式脚本的发布路径和维护人员的测试路径,不要将脚本放到规定路径以外,例如:

916
来自专栏java相关

nginx启动和配置

1015
来自专栏java学习

MySQL安装图解

MySQL安装图解 一、MYSQL的安装 1、打开下载的mysql安装文件mysql-5.5.27-win32.zip,双击解压缩,运行“setup.exe”。...

3516
来自专栏菩提树下的杨过

[原创]在msmq3.0中使用http协议发送消息

1.先声明: msmq3.0仅在winxp和win2003以上系统支持,如果windows vista系统,据说已经开始支持msmq4.0了 2.为什么要使...

2078
来自专栏python学习指南

Elasticsearch--配置文件

config目录下有2个配置文件:es的配置文件:elasticsearch.yml日志配置文件:logging.yml,更多内容请参考:ELK教程 c...

1819
来自专栏北京马哥教育

解决八种Linux硬盘问题的技巧

#1 - 错误: 设备上无剩余空间 当你的类UNIX系统磁盘写满了时你会在屏幕上看到这样的信息。本例中,我运行fallocate命令然后我的系统就会提示磁盘空间...

5006
来自专栏云计算教程系列

如何在Ubuntu 14.04上设置Gogs

Gogs是一个用Go编写的自托管Git服务,它很容易运行并且系统使用率也很低。它渴望成为建立自托管Git服务的最简单,最快速,最轻松的方式。

853

扫码关注云+社区