SpringCloud之Eureka详细的配置
介绍
SpringCloud是一个完整的微服务治理框架,包括服务发现和注册,服务网关,熔断,限流,负载均衡和链路跟踪等组件。
SpringCloud-Eureka主要提供服务注册和发现功能。本文提供了该组件配置的全面说明。
术语和概念
- Eureka服务端:负责服务注册、发现并管理每项服务的中心
- Eureka实例:服务(如订单系统)部署多个服务器,每个服务器上提供的服务都是实例。
- Eureka服务:指提供特定服务功能的服务,例如:订单系统,同一服务可以提供多个实例;
- Eureka客户端:主要向服务中心注册自己成为服务。但它既可以是服务提供者,也可以是消费者。它与Eureka实例感觉相似,但实际上意义不同。
配置说明
Eureka服务器配置
- ################server Configuration associated with client####################33
- # Open self-protection mode. No matter what the situation, the server will maintain a certain number of services. Avoid network problems between client and server, and a large number of services are cleared.
- eureka.server.enable-self-preservation=true
- # Enable the timed task to clear invalid services. Default 1 minute
- eureka.server.eviction-interval-timer-in-ms= 60000
- # How long, clear expired delta data
- eureka.server.delta-retention-timer-interval-in-ms=0
- # , is it also available to the client?
- eureka.server.disable-delta=false
- #eureka Whether the server records the identity of the client header
- eureka.server.log-identity-headers=true
- #Request frequency limiter
- eureka.server.rate-limiter-burst-size=10
- # Whether to enable the request frequency limiter
- eureka.server.rate-limiter-enabled=false
- #Request frequency average
- eureka.server.rate-limiter-full-fetch-average-rate=100
- # Whether to limit the frequency request to the standard client. If false, only limit non-standard clients
- eureka.server.rate-limiter-throttle-standard-clients=false
- #Register service, average value of request frequency for pulling service list data
- eureka.server.rate-limiter-registry-fetch-average-rate=500
- #Set the trusted client list
- eureka.server.rate-limiter-privileged-clients=
- # In the set time range class, the percentage expected to be renewed with the client.
- eureka.server.renewal-percent-threshold=0.85
- #How long to update the renewal threshold
- eureka.server.renewal-threshold-update-interval-ms=0
- #How long does it take for cached registration data to expire?
- eureka.server.response-cache-auto-expiration-in-seconds=180
- #How long to update the service registration data in the cache
- eureka.server.response-cache-update-interval-ms=0
- #Cache the time of the incremental data so that no information is lost when searching
- eureka.server.retention-time-in-m-s-in-delta-queue=0
- #When the timestamps are inconsistent, whether to synchronize
- eureka.server.sync-when-timestamp-differs=true
- # Whether to adopt a read-only cache policy, the read-only policy does not expire for cached data.
- eureka.server.use-read-only-response-cache=true
- ################server Customized Implementation Configuration####################33
- #json's implementation class name for conversion
- eureka.server.json-codec-name=
- #PropertyResolver
- eureka.server.property-resolver=
- #eureka server xml codec implementation name
- eureka.server.xml-codec-name=
- ################Association between server node and node####################33
- # replication data is in the request, always compressed
- eureka.server.enable-replicated-request-compression=false
- # Indicates whether replication between cluster nodes should be batched to improve network efficiency.
- eureka.server.batch-replication=false
- #Allow the maximum number of replication events that are backed up to the backup pool. This backup pool is responsible for other events except status updates. This value can be set according to memory size, timeout and replication traffic.
- eureka.server.max-elements-in-peer-replication-pool=10000
- #Allow the maximum number of replication events that are backed up to the stateful backup pool
- eureka.server.max-elements-in-status-replication-pool=10000
- #Multiple service centers synchronize the maximum idle time of information threads with each other
- eureka.server.max-idle-thread-age-in-minutes-for-peer-replication=15
- #Status synchronization thread maximum idle time
- eureka.server.max-idle-thread-in-minutes-age-for-status-replication=15
- #Service registry each instance of the maximum number of threads to copy data to each other
- eureka.server.max-threads-for-peer-replication=20
- #Service registry each instance of the maximum number of threads copying state data
- eureka.server.max-threads-for-status-replication=1
- Communication time between #instance and data replication
- eureka.server.max-time-for-replication=30000
- # The minimum number of normal peer-to-peer services. -1 indicates that the service center is a single node.
- eureka.server.min-available-instances-for-peer-replication=-1
- The minimum number of threads opened between #instance and mutual replication
- eureka.server.min-threads-for-peer-replication=5
- Between #instance for state replication, the minimum number of threads opened
- eureka.server.min-threads-for-status-replication=1
- Number of times that can be retried when copying data between #instance
- eureka.server.number-of-replication-retries=5
- #eureka How often to update data between nodes. The default is 10 minutes.
- eureka.server.peer-eureka-nodes-update-interval-ms=600000
- #eureka The time interval between service status updates.
- eureka.server.peer-eureka-status-refresh-time-interval-ms=0
- #eureka Peer-to-peer connection timeout
- eureka.server.peer-node-connect-timeout-ms=200
- #eureka idle time after peer node connection
- eureka.server.peer-node-connection-idle-timeout-seconds=30
- #Read data connection timeout between nodes
- eureka.server.peer-node-read-timeout-ms=200
- #eureka server Total number of connections between nodes
- eureka.server.peer-node-total-connections=1000
- #eureka server Maximum number of single machines connected between nodes
- eureka.server.peer-node-total-connections-per-host=10
- #The number of times eureka tried to obtain registration information when the service node was started
- eureka.server.registry-sync-retries=
- # When eureka tries to obtain registration information multiple times when the service node starts up
- eureka.server.registry-sync-retry-wait-ms=
- # When the eureka server is started, you cannot wait for the instance registration information from the peer node. How long should it wait?
- eureka.server.wait-time-in-ms-when-sync-empty=0
- ################server Configuration associated with remote####################33
- # , is it also provided to the remote region?
- eureka.server.disable-delta-for-remote-regions=false
- #Old behavior of the application that is rolled back to the remote zone (if configured) If there is no instance of the application in the local zone, it will be disabled.
- eureka.server.disable-transparent-fallback-to-other-region=false
- # Indicates whether the content obtained from the Eureka server must be compressed for the remote zone if the server supports it.
- eureka.server.g-zip-content-from-remote-region=true
- #Connection eureka remote note connection timeout
- eureka.server.remote-region-connect-timeout-ms=1000
- #remote region Application whitelist
- eureka.server.remote-region-app-whitelist.
- #Connect eureka remote note connection idle time
- eureka.server.remote-region-connection-idle-timeout-seconds=30
- #Executing remote region The request thread pool size for obtaining registration information
- eureka.server.remote-region-fetch-thread-pool-size=20
- #remote region Timeout from reading data from peer eureka
- eureka.server.remote-region-read-timeout-ms=1000
- #Time interval for obtaining registration information from remote region
- eureka.server.remote-region-registry-fetch-interval=30
- #remote region The total number of connections connecting eureka nodes
- eureka.server.remote-region-total-connections=1000
- #remote region The number of stand-alone connections connecting eureka nodes
- eureka.server.remote-region-total-connections-per-host=50
- #remote region fetches the storage file of the registration information, and this reliable storage file needs a fully qualified name to specify
- eureka.server.remote-region-trust-store=
- #remote region Password of the stored file
- eureka.server.remote-region-trust-store-password=
- #remote region url. separated by multiple commas
- eureka.server.remote-region-urls=
- #remote region url. separated by multiple commas
- eureka.server.remote-region-urls-with-name.
- ################server Configuration associated with ASG/AWS/EIP/route52################### #33
- #Cache the expiration time of ASG information.
- eureka.server.a-s-g-cache-expiry-timeout-ms=0
- #Query the timeout time of ASG information.
- eureka.server.a-s-g-query-timeout-ms=300
- #Service update ASG information frequency
- eureka.server.a-s-g-update-interval-ms=0
- #AWSAccess ID
- eureka.server.a-w-s-access-id=
- #AWSSecurity Key
- eureka.server.a-w-s-secret-key=
- #AWSbinding strategy
- eureka.server.binding-strategy=eip
- #Use the name of the role that automatically extends the grouping from a third-party AWS account description.
- eureka.server.list-auto-scaling-groups-role-name=
- #Whether should establish a connection guide
- eureka.server.prime-aws-replica-connections=true
- #Number of times the server tries to bind candidate EIPs
- eureka.server.e-i-p-bind-rebind-retries=3
- # The time interval at which the server binds the EIP. If the binding is checked, it is re-bound if the binding fails. If and only if it is already bound
- eureka.server.e-i-p-binding-retry-interval-ms=10
- #Time interval at which the server binds EIP. If and only if the service is bound
- eureka.server.e-i-p-binding-retry-interval-ms-when-unbound=
- #The number of times the server tries to bind route53
- eureka.server.route53-bind-rebind-retries=3
- #Servlet interval how long to try to bind route53
- eureka.server.route53-binding-retry-interval-ms=30
- #
- eureka.server.route53-domain-t-t-l=10
Eureka Instacen配置
- #Hostname of the service registry instance
- eureka.instance.hostname=localhost
- #Register the application group name in the Eureka service
- eureka.instance.app-group-name=
- #Register the application name in the Eureka service
- eureka.instance.appname=
- # Unique ID of the instance registered to the service center
- eureka.instance.instance-id=
- #IP address of the instance
- eureka.instance.ip-address=
- #Instance, whether IP is preferred over hostname
- eureka.instance.prefer-ip-address=false
- #Group name associated with this instance for automatic extension of the AWS platform,
- eureka.instance.a-s-g-name=
- #Deploy the data center for this instance
- eureka.instance.data-center-info=
- #Default address resolution order
- eureka.instance.default-address-resolution-order=
- #Instance environment configuration
- eureka.instance.environment=
- #Initialize the instance and register to the initial state of the service center
- eureka.instance.initial-status=up
- # Indicate whether as long as this instance is registered to the service center, immediately communicate
- eureka.instance.instance-enabled-onit=false
- #The namespace of the service instance for finding attributes
- eureka.instance.namespace=eureka
- #The child definition metadata of the service instance can be accepted by the service center.
- eureka.instance.metadata-map.test = test
- #Service center deletes the waiting time (in seconds) of this service instance, and the time interval is the heartbeat time received by the last service center.
- eureka.instance.lease-expiration-duration-in-seconds=90
- # The interval at which the instance sends a heartbeat to the service center to indicate that the service instance is available.
- eureka.instance.lease-renewal-interval-in-seconds=30
- #Instance, registration service center, the number of communication opened by default
- eureka.instance.registry.default-open-for-traffic-count=1
- #Number of renewals per minute
- eureka.instance.registry.expected-number-of-renews-per-min=1
- #Instance health check url, absolute path
- eureka.instance.health-check-url=
- #Instance health check url, relative path
- eureka.instance.health-check-url-path=/health
- #Instance's home page url, absolute path
- eureka.instance.home-page-url=
- #Instance's home page url, relative path
- eureka.instance.home-page-url-path=/
- #Instance security health check url, absolute path
- eureka.instance.secure-health-check-url=
- #https
- eureka.instance.secure-port=443
- #httpsCommunication port is enabled
- eureka.instance.secure-port-enabled=false
- #http
- eureka.instance.non-secure-port=80
- #httpCommunication port is enabled
- eureka.instance.non-secure-port-enabled=true
- #Security virtual host name (https) for this instance
- eureka.instance.secure-virtual-host-name=unknown
- #Virtual host name of this instance (http)
- eureka.instance.virtual-host-name=unknown
- #The status of the instance is rendered url, absolute path
- eureka.instance.status-page-url=
- #The status of the instance is rendered url, relative path
- eureka.instance.status-page-url-path=/status
Eureka客户端配置
- #This client is available
- eureka.client.enabled=true
- #Instance Whether to register your own information on the eureka server for other services to discover, the default is true
- eureka.client.register-with-eureka=false
- #This client gets the registration information on the eureka server registry, the default is true
- eureka.client.fetch-registry=false
- # Whether to filter out, non-UP instances. Default is true
- eureka.client.filter-only-up-instances=true
- # zone and url address with Eureka Registration Service Center
- eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
- #client is the idle waiting time after connecting to the Eureka server. The default is 30 seconds.
- eureka.client.eureka-connection-idle-timeout-seconds=30
- #client connects to eureka server connection timeout, the default is 5 seconds
- eureka.client.eureka-server-connect-timeout-seconds=5
- #clientRead timeout for the server
- eureka.client.eureka-server-read-timeout-seconds=8
- #clientConnection all eureka server total number of connections, the default 200
- eureka.client.eureka-server-total-connections=200
- #clientConnect to the number of single-machine connections on the eureka server. The default is 50.
- eureka.client.eureka-server-total-connections-per-host=50
- #Executive index rollback refresh related attribute, which is the maximum multiple of the retry delay, the default is 10
- eureka.client.cache-refresh-executor-exponential-back-off-bound=10
- #Execution program cache refresh thread pool size, the default is 5
- eureka.client.cache-refresh-executor-thread-pool-size=2
- # Execution program rollback related attributes, which is the maximum multiple of the retry delay. The default is 10
- eureka.client.heartbeat-executor-exponential-back-off-bound=10
- # Execution program thread pool size, the default is 5
- eureka.client.heartbeat-executor-thread-pool-size=5
- # Ask the frequency (s) of the Eureka service url information change, the default is 300 seconds
- eureka.client.eureka-service-url-poll-interval-seconds=300
- #The time (s) required to initially copy the instance information to the eureka server. The default is 40 seconds.
- eureka.client.initial-instance-info-replication-interval-seconds=40
- #How long does it take to copy the instance information to the eureka server again, the default is 30 seconds?
- eureka.client.instance-info-replication-interval-seconds=30
- #Time interval (s) from the eureka server registry to obtain registration information, the default is 30 seconds
- eureka.client.registry-fetch-interval-seconds=30
- # Get the region where the instance is located. The default is us-east-1
- eureka.client.region=us-east-1
- #Instance Whether to use the eureka server in the same zone, the default is true. Ideally, the eureka client and server are in the same zone.
- eureka.client.prefer-same-zone-eureka=true
- # Get a list of available areas in the region where the instance is located, separated by commas. (AWS)
- eureka.client.availability-zones.china=defaultZone,defaultZone1,defaultZone2
- The list of comma-separated regions in the #eureka service registry information. If you do not return these regions, the client will start up with errors. The default is null
- eureka.client.fetch-remote-regions-registry=
- #Server is able to redirect client requests to the backup server. If set to false, the server will process the request directly, and if set to true, it may send an HTTP redirect to the client. Default is false
- eureka.client.allow-redirects=false
- #
- eureka.client.client-data-accept=
- #Incremental information can be provided to the client, the default is false
- eureka.client.disable-delta=false
- The #eureka server serialization/deserialization information obtains the replacement string of the "_" symbol. The default is"__"
- eureka.client.escape-char-replacement=__
- The #eureka server serialization/deserialization information obtains a replacement string for the "$" symbol. The default is"_-"
- eureka.client.dollar-replacement="_-"
- #When the server supports compression, whether to support the information obtained from the server for compression. Default is true
- eureka.client.g-zip-content=true
- # Whether to record the difference between the information in the registry between the eureka server and the client, the default is false
- eureka.client.log-delta-diff=false
- # If set to true, the client's status update will be updated on-demand to the remote server. The default is true.
- eureka.client.on-demand-update-status-change=true
- #This client is only interested in information about a single VIP registry. The default is null
- eureka.client.registry-refresh-single-vip-address=
- #client is forced to register to the service center during the initialization phase, the default is false
- eureka.client.should-enforce-registration-at-init=false
- #clientWhen the shutdown is displayed, the logout service is displayed from the service center. The default is true.
- eureka.client.should-unregister-on-shutdown=true
- # Get the proxy host of the eureka service, the default is null
- eureka.client.proxy-host=
- #Get the proxy password of the eureka service, the default is null
- eureka.client.proxy-password=
- # Get the proxy port of the eureka service, the default is null
- eureka.client.proxy-port=
- # Get the proxy username of the eureka service, the default is null
- eureka.client.proxy-user-name=
- #Attribute interpreter
- eureka.client.property-resolver=
- #Get the implementation name of the fallback option when the eureka client reads the registry at the first startup.
- eureka.client.backup-registry-impl=
- # ×××Configuration, if the latest XXX is stable, it can be removed, the default is null
- eureka.client.decoder-name=
- # , if the latest encoder is stable, it can be removed, the default is null
- eureka.client.encoder-name=
- # Whether to use the DNS mechanism to get a list of services and then communicate. Default is false
- eureka.client.use-dns-for-fetching-service-urls=false
- #Get the DNS name to be queried to get the eureka server. This configuration is only used when the eureka server ip address list is in the DNS. The default is null
- eureka.client.eureka-server-d-n-s-name=
- #Get the port of the eureka server. This configuration is only used when the eureka server ip address list is in the DNS. The default is null
- eureka.client.eureka-server-port=
- # indicates the path of the eureka registration center. If it is configured as eureka, it is http://x.x.x.x:x/eureka/. Adding this configuration to the eureka configuration file indicates that eureka is registered as a client to the registration center to form an eureka cluster. This configuration is only used in the DNS address list of the eureka server. The default is null.
- eureka.client.eureka-server-u-r-l-context=
SpringCloud之Eureka详细的配置的更多相关文章
- 三(2)、springcloud之Eureka集群配置
1)原理说明** 服务启动后向Eureka注册,Eureka Server会将注册信息向其他Eureka Server进行同步,当服务消费者要调用服务提供者,则向服务注册中心获取服务提供者地址,然后会 ...
- springCloud 之 Eureka注册中心高可用配置
springCloud的eureka高可用配置方案思路是:几个服务中心之间相互注册,比如两个注册中心,A注册到B上,B注册到A上,如果是三个注册中心则是:A注册到BC上,B注册到AC上,C注册到AB上 ...
- SpringCloud中eureka配置心跳和剔除下线的服务的时间
在默认的springCloud中eureka注册中心在服务下线时表现的非常不灵敏,用惯了dubbo的zk注册中心表示很不习惯,eureka设计的本意是在服务不会频繁上下线和网络稳定的内网,这种设计在生 ...
- SpringCloud升级之路2020.0.x版-17.Eureka的实例配置
本系列代码地址:https://github.com/HashZhang/spring-cloud-scaffold/tree/master/spring-cloud-iiford 上一节我们提到过, ...
- SpringCloud Netflix Eureka(服务注册/发现)
⒈Eureka是什么? Eureka是Netflix的一个子模块,也是核心模块之一,Eureka是一个基于REST的服务,用于定位服务以实现云端中间层服务发现和故障转移,服务注册与发现对于微服务架构来 ...
- SpringCloud:Eureka服务注册与发现
1.Eureka简介 Spring Cloud 封装了 Netflix 公司开发的 Eureka 模块来实现服务注册和发现(请对比Zookeeper). Eureka 采用了 C-S 的设计架构.Eu ...
- SpringCloud创建Eureka模块集群
1.说明 本文详细介绍Spring Cloud创建Eureka模块集群的方法, 基于已经创建好的Spring Cloud Eureka Server模块, 请参考SpringCloud创建Eureka ...
- SpringCloud 组件Eureka参数配置项详解
Eureka涉及到的参数配置项数量众多,它的很多功能都是通过参数配置来实现的,了解这些参数的含义有助于我们更好的应用Eureka的各种功能,下面对Eureka的配置项做具体介绍,供大家参考. Eure ...
- 白话SpringCloud | 第八章:分布式配置中心的服务化及动态刷新
前言 上一章节,简单介绍了分布式配置中心Spring Cloud Config的使用.同时,我们也遗漏了一些问题,比如如何配置实时生效,当服务端地址变更或者集群部署时,如何指定服务端地址?回想,在服务 ...
随机推荐
- Installation request for topthink/think-captcha ^3.0 -> satisfiable by topthink/think-captcha[v3.0.0].
ThinkPHP5.1安装图形验证码的时候报错: Problem 1 - Installation request for topthink/think-captcha ^3.0 -> sati ...
- Koa 中间件的执行
Node.js 中请求的处理 讨论 Koa 中间件前,先看原生 Node.js 中是如何创建 server 和处理请求的. node_server.js const http = require(&q ...
- 适合初学者的Python爬取链家网教程
前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者: TinaLY PS:如有需要Python学习资料的小伙伴可以加点击下 ...
- 一个小事例,了解golang通道阻塞模式
在学习golang中,channel真的是让人捉摸不透的东西,本来我自以为我理解了协程阻塞的用法了,结果就下面这个小例子,我还是在打印输出后才搞明白到底怎么回事? 当然了,这也是我自身对协程这块不太熟 ...
- ASP.Net MVC 路由及路由调试工具RouteDebug
一.路由规则 1.可以创建多条路由规则,每条路由的name属性不相同 2.路由规则有优先级,最上面的路由规则优先级越高 App_Start文件下的:RouteConfig.cs public stat ...
- MySQL基础之表的管理
添加和删除字段操作 添加字段 alter table tbl_name add 字段名称 字段属性 [完整性约束条件] [first|after 字段名称之后]; 删除字段 alter table t ...
- [b0008] Windows 7 下 hadoop 2.6.4 eclipse 本地开发调试配置
目的: 基于上篇的方法介绍,开发很不方便 .[0007] windows 下 eclipse 开发 hdfs程序样例 装上插件,方便后续直接在windows下的IDE开发调试. 环境: Linux ...
- arm-linux-gcc-4.5.1安装方法
写在前面 之前写了一篇arm-linux-gcc-5.4.0的安装方法,但是后来发现5.4.0这个版本可能有些太新了,所以又找了这个4.5.1版本(低版本),由FriendlyARM(友善之臂)提供, ...
- node.js中pm2启动应用出错
在将公司的应用容器化时,遇到的问题. 之前,同事使用node.js 6版本运行,pm2启动js文件,一切正常. 但我一样将node.js 6版本安装,然后npm install pm2完成. 运行pm ...
- github配置ssh及多ssh key问题处理
一.生成ssh公私钥 用ssh-keygen生成公私钥. $ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_mult 在~/./ssh目录 ...