eureka.instance配置项说明

本文详细介绍了Spring Cloud Netflix Eureka Client的配置参数,包括执行器端点前缀、应用名、实例状态、端口设置、心跳间隔与过期时间等,这些参数对于服务注册与发现、流量控制至关重要。了解这些配置有助于更好地管理和维护微服务实例在Eureka集群中的行为。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文档基于spring-cloud-netflix-eureka-client-3.0.2版本。

本文档使用谷歌翻译

本文档基于spring-cloud-netflix-eureka-client\..\spring-cloud-netflix-eureka-client-*.*.*.jar!\org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean类注释。

actuatorPrefix

原文:

Default prefix for actuator endpoints.

值类型:String,描述:

执行器端点的默认前缀。

appname

原文:

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

值类型:String,描述:

获取要在eureka注册的应用程序的名称。

appGroupName

原文:

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

值类型:String,描述:

获取要在eureka注册的应用程序组的名称。

instanceEnabledOnit

原文:

Indicates whether the instance should be enabled for taking traffic as soon as itis registered with eureka. Sometimes the application might need to do somepre-processing before it is ready to take traffic.

值类型:boolean,描述:

指示是否应在向eureka注册后立即启用实例以进行流量。有时,应用程序可能需要做一些预处理才能准备好处理流量。

nonSecurePort

原文:

Get the non-secure port on which the instance should receive traffic.

值类型:int,描述:

获取实例应在其上接收流量的非安全端口。

securePort

原文:

Get the Secure port on which the instance should receive traffic.

值类型:int,描述:

获取实例应在其上接收流量的安全端口。

nonSecurePortEnabled

原文:

Indicates whether the non-secure port should be enabled for traffic or not.

值类型:boolean,描述:

指示是否应为非安全端口启用流量。

securePortEnabled

原文:

Indicates whether the secure port should be enabled for traffic or not.

值类型:boolean,描述:

指示是否应启用安全端口的流量。

leaseRenewalIntervalInSeconds

原文:

Indicates how often (in seconds) the eureka client needs to send heartbeats toeureka server to indicate that it is still alive. If the heartbeats are notreceived for the period specified in leaseExpirationDurationInSeconds, eurekaserver will remove the instance from its view, there by disallowing traffic to thisinstance. *Note that the instance could still not take traffic if it implementsHealthCheckCallback and then decides to make itself unavailable.

值类型:int,描述:

指示eureka客户端需要多久(以秒为单位)向eureka服务器发送心跳以指示其仍处于活动状态。如果在leaseExpirationDurationInSeconds中指定的时间内未接收到心跳,则eurekaserver将通过禁止访问该实例的流量从该实例的视图中删除该实例。 *请注意,如果实例实现HealthCheckCallback并决定使其自身不可用,则该实例仍无法获得流量。

leaseExpirationDurationInSeconds

原文:

Indicates the time in seconds that the eureka server waits since it received thelast heartbeat before it can remove this instance from its view and there bydisallowing traffic to this instance. *Setting this value too long could mean that the traffic could be routed to theinstance even though the instance is not alive. Setting this value too small couldmean, the instance may be taken out of traffic because of temporary networkglitches.This value to be set to atleast higher than the value specified inleaseRenewalIntervalInSeconds.

值类型:int,描述:

表示从接收到最后一个心跳以来,eureka服务器等待的时间(以秒为单位),然后它才能从该实例的视图中删除该实例,并禁止访问该实例的流量。 *将此值设置得太长可能意味着即使实例不活跃,也可以将流量路由到该实例。将该值设置得太小可能意味着实例由于临时的网络故障而无法进行通信。此值应设置为至少比inleaseRenewalIntervalInSeconds中指定的值高。

virtualHostName

原文:

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

值类型:String,描述:

获取为此实例定义的虚拟主机名。 *这通常是其他实例使用虚拟主机名找到该实例的方式。这类似于完全限定域名,您的服务的用户将需要找到该实例。

instanceId

原文:

Get the unique Id (within the scope of the appName) of this instance to beregistered with eureka.

值类型:String,描述:

获取要在eureka中注册的该实例的唯一ID(在appName的范围内)。

secureVirtualHostName

原文:

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

值类型:String,描述:

获取为此实例定义的安全虚拟主机名。 *这通常是其他实例使用安全的虚拟主机名查找该实例的方式。这类似于完全限定域名,您的服务的用户将需要找到该实例。

aSGName

原文:

Gets the AWS autoscaling group name associated with this instance. This informationis specifically used in an AWS environment to automatically put an instance out ofservice after the instance is launched and it has been disabled for traffic..

值类型:String,描述:

获取与此实例关联的AWS自动扩展组名称。此信息专门用于AWS环境中,以在实例启动并已禁用流量后自动将实例退出服务。

String

原文:

Gets the metadata name/value pairs associated with this instance. This informationis sent to eureka server and can be used by other instances.

值类型:Map,描述:

获取与此实例关联的元数据名称/值对。该信息被发送到eureka服务器,并且可以被其他实例使用。

dataCenterInfo

原文:

Returns the data center this instance is deployed. This information is used to getsome AWS specific instance information if the instance is deployed in AWS.

值类型:DataCenterInfo,描述:

返回此实例已部署的数据中心。如果实例已部署在AWS中,则此信息用于获取一些特定于AWS的实例信息。

ipAddress

原文:

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

值类型:String,描述:

获取实例的IPAdress。该信息仅用于学术目的,因为来自其他实例的通信主要使用{@link #getHostName(boolean)}中提供的信息进行。

statusPageUrlPath

原文:

Gets the relative status page URL path for this instance. The status page URL isthen constructed out of the hostName and the type of communication - secure orunsecure as specified in securePort and nonSecurePort. *It is normally used for informational purposes for other services to find about thestatus of this instance. Users can provide a simple HTML indicating what is thecurrent status of the instance.

值类型:String,描述:

获取此实例的相对状态页面URL路径。然后根据主机名和通信类型(如securePort和nonSecurePort中指定的安全或不安全)构造状态页URL。 *通常用于其他服务的信息目的,以查找该实例的状态。用户可以提供一个简单的HTML,指示实例的当前状态是什么。

statusPageUrl

原文:

Gets the absolute status page URL path for this instance. The users can provide thestatusPageUrlPath if the status page resides in the same instance talking toeureka, 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 find about thestatus of this instance. Users can provide a simple HTML indicating what is thecurrent status of the instance.

值类型:String,描述:

获取此实例的绝对状态页面URL路径。如果状态页位于与toeureka对话的同一实例中,则用户可以提供statusPageUrlPath,否则,如果该实例是其他服务器的代理,则用户可以提供完整的URL。如果提供了完整的URL,则具有优先权。 *通常用于其他服务的信息目的,以查找该实例的状态。用户可以提供一个简单的HTML,指示实例的当前状态是什么。

homePageUrlPath

原文:

Gets the relative home page URL Path for this instance. The home page URL is thenconstructed 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 alanding page.

值类型:String,描述:

获取此实例的相对主页URL路径。然后根据主机名和通信类型(安全或不安全)构造主页URL。 *通常将其用作参考信息,以供其他服务将其用作登陆页面。

homePageUrl

原文:

Gets the absolute home page URL for this instance. The users can provide thehomePageUrlPath 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 canprovide 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 alanding page. The full URL should follow the format http://${eureka.hostname}:7001/where the value ${eureka.hostname} is replaced at runtime.

值类型:String,描述:

获取此实例的绝对主页URL。如果主页位于与eureka对话的同一实例中,则用户可以提供homePageUrlPath,否则,如果该实例是其他服务器的代理,则用户可以提供完整的URL。如果提供了完整的URL,则具有优先权。 *通常将其用作参考信息,以供其他服务将其用作登陆页面。完整的URL应采用http://${eureka.hostname}:7001/的格式,其中在运行时将替换值${eureka.hostname}。

healthCheckUrlPath

原文:

Gets the relative health check URL path for this instance. The health check pageURL is then constructed out of the hostname and the type of communication - secureor unsecure as specified in securePort and nonSecurePort. *It is normally used for making educated decisions based on the health of theinstance - for example, it can be used to determine whether to proceed deploymentsto an entire farm or stop the deployments without causing further damage.

值类型:String,描述:

获取此实例的相对运行状况检查URL路径。然后,根据主机名和通信类型(如securePort和nonSecurePort中指定的安全或不安全)构造运行状况检查pageURL。 *它通常用于根据情况的健康状况做出有根据的决策-例如,它可用于确定是继续部署到整个服务器场还是停止部署而不会造成进一步的损害。

healthCheckUrl

原文:

Gets the absolute health check page URL for this instance. The users can providethe healthCheckUrlPath if the health check page resides in the same instancetalking to eureka, else in the cases where the instance is a proxy for some otherserver, users can provide the full URL. If the full URL is provided it takesprecedence. *<p>It is normally used for making educated decisions based on the health of theinstance - for example, it can be used to determine whether to proceed deploymentsto an entire farm or stop the deployments without causing further damage. The fullURL should follow the format http://${eureka.hostname}:7001/ where the value${eureka.hostname} is replaced at runtime.

值类型:String,描述:

获取此实例的绝对健康检查页面URL。如果运行状况检查页面位于与eureka对话的同一实例中,则用户可以提供healthCheckUrlPath,否则,如果该实例是其他服务器的代理,则用户可以提供完整的URL。如果提供了完整的URL,它将具有优先权。通常用于根据情况的健康状况做出有根据的决策-例如,它可以用于确定是继续部署到整个服务器场还是停止部署而不会造成进一步的损害。 fullURL应遵循http://${eureka.hostname}:7001/的格式,其中在运行时将替换值${eureka.hostname}。

secureHealthCheckUrl

原文:

Gets the absolute secure health check page URL for this instance. The users canprovide the secureHealthCheckUrl if the health check page resides in the sameinstance talking to eureka, else in the cases where the instance is a proxy forsome other server, users can provide the full URL. If the full URL is provided ittakes precedence. *<p>It is normally used for making educated decisions based on the health of theinstance - for example, it can be used to determine whether to proceed deploymentsto an entire farm or stop the deployments without causing further damage. The fullURL should follow the format http://${eureka.hostname}:7001/ where the value${eureka.hostname} is replaced at runtime.

值类型:String,描述:

获取此实例的绝对安全运行状况检查页面URL。如果运行状况检查页面位于与eureka对话的同一实例中,则用户可以提供secureHealthCheckUrl,否则,如果该实例是其他服务器的代理,则用户可以提供完整的URL。如果提供了完整的URL,则具有优先权。通常用于根据情况的健康状况做出有根据的决策-例如,它可以用于确定是继续部署到整个服务器场还是停止部署而不会造成进一步的损害。 fullURL应遵循http://${eureka.hostname}:7001/的格式,其中在运行时将替换值${eureka.hostname}。

namespace

原文:

Get the namespace used to find properties. Ignored in Spring Cloud.

值类型:String,描述:

获取用于查找属性的名称空间。在Spring Cloud中被忽略。

hostname

原文:

The hostname if it can be determined at configuration time (otherwise it will beguessed from OS primitives).

值类型:String,描述:

主机名(如果可以在配置时确定的话)(否则将从OS原语中推测出来)。

preferIpAddress

原文:

Flag to say that, when guessing a hostname, the IP address of the server should beused in preference to the hostname reported by the OS.

值类型:boolean,描述:

标记为在猜测主机名时,应优先使用服务器的IP地址,而不要使用OS报告的主机名。

initialStatus

原文:

Initial status to register with remote Eureka server.

值类型:InstanceStatus,描述:

向远程Eureka服务器注册的初始状态。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值