最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Eureka配置

网站源码admin0浏览0评论

Eureka配置

介绍

SpringCloud是一个完整的微服务治理框架,包括服务发现和注册,服务网关,熔断,限流,负载均衡和链路跟踪等组件。

SpringCloud-Eureka主要提供服务注册和发现功能。本文提供了该组件配置的全面说明。

术语和概念

  • Eureka服务端:负责服务注册、发现并管理每项服务的中心
  • Eureka实例:服务(如订单系统)部署多个服务器,每个服务器上提供的服务都是实例。
  • Eureka服务:指提供特定服务功能的服务,例如:订单系统,同一服务可以提供多个实例;
  • Eureka客户端:主要向服务中心注册自己成为服务。但它既可以是服务提供者,也可以是消费者。它与Eureka实例感觉相似,但实际上意义不同。

配置说明

Eureka服务器配置

  1. ################server Configuration associated with client####################33
  2. # 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.
  3. eureka.server.enable-self-preservation=true
  4. # Enable the timed task to clear invalid services. Default 1 minute
  5. eureka.server.eviction-interval-timer-in-ms= 60000
  6. # How long, clear expired delta data
  7. eureka.server.delta-retention-timer-interval-in-ms=0
  8. # , is it also available to the client?
  9. eureka.server.disable-delta=false
  10. #eureka Whether the server records the identity of the client header
  11. eureka.server.log-identity-headers=true
  12. #Request frequency limiter
  13. eureka.server.rate-limiter-burst-size=10
  14. # Whether to enable the request frequency limiter
  15. eureka.server.rate-limiter-enabled=false
  16. #Request frequency average
  17. eureka.server.rate-limiter-full-fetch-average-rate=100
  18. # Whether to limit the frequency request to the standard client. If false, only limit non-standard clients
  19. eureka.server.rate-limiter-throttle-standard-clients=false
  20. #Register service, average value of request frequency for pulling service list data
  21. eureka.server.rate-limiter-registry-fetch-average-rate=500
  22. #Set the trusted client list
  23. eureka.server.rate-limiter-privileged-clients=
  24. # In the set time range class, the percentage expected to be renewed with the client.
  25. eureka.server.renewal-percent-threshold=0.85
  26. #How long to update the renewal threshold
  27. eureka.server.renewal-threshold-update-interval-ms=0
  28. #How long does it take for cached registration data to expire?
  29. eureka.server.response-cache-auto-expiration-in-seconds=180
  30. #How long to update the service registration data in the cache
  31. eureka.server.response-cache-update-interval-ms=0
  32. #Cache the time of the incremental data so that no information is lost when searching
  33. eureka.server.retention-time-in-m-s-in-delta-queue=0
  34. #When the timestamps are inconsistent, whether to synchronize
  35. eureka.server.sync-when-timestamp-differs=true
  36. # Whether to adopt a read-only cache policy, the read-only policy does not expire for cached data.
  37. eureka.server.use-read-only-response-cache=true
  38. ################server Customized Implementation Configuration####################33
  39. #json's implementation class name for conversion
  40. eureka.server.json-codec-name=
  41. #PropertyResolver
  42. eureka.server.property-resolver=
  43. #eureka server xml codec implementation name
  44. eureka.server.xml-codec-name=
  45. ################Association between server node and node####################33
  46. # replication data is in the request, always compressed
  47. eureka.server.enable-replicated-request-compression=false
  48. # Indicates whether replication between cluster nodes should be batched to improve network efficiency.
  49. eureka.server.batch-replication=false
  50. #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.
  51. eureka.server.max-elements-in-peer-replication-pool=10000
  52. #Allow the maximum number of replication events that are backed up to the stateful backup pool
  53. eureka.server.max-elements-in-status-replication-pool=10000
  54. #Multiple service centers synchronize the maximum idle time of information threads with each other
  55. eureka.server.max-idle-thread-age-in-minutes-for-peer-replication=15
  56. #Status synchronization thread maximum idle time
  57. eureka.server.max-idle-thread-in-minutes-age-for-status-replication=15
  58. #Service registry each instance of the maximum number of threads to copy data to each other
  59. eureka.server.max-threads-for-peer-replication=20
  60. #Service registry each instance of the maximum number of threads copying state data
  61. eureka.server.max-threads-for-status-replication=1
  62. Communication time between #instance and data replication
  63. eureka.server.max-time-for-replication=30000
  64. # The minimum number of normal peer-to-peer services. -1 indicates that the service center is a single node.
  65. eureka.server.min-available-instances-for-peer-replication=-1
  66. The minimum number of threads opened between #instance and mutual replication
  67. eureka.server.min-threads-for-peer-replication=5
  68. Between #instance for state replication, the minimum number of threads opened
  69. eureka.server.min-threads-for-status-replication=1
  70. Number of times that can be retried when copying data between #instance
  71. eureka.server.number-of-replication-retries=5
  72. #eureka How often to update data between nodes. The default is 10 minutes.
  73. eureka.server.peer-eureka-nodes-update-interval-ms=600000
  74. #eureka The time interval between service status updates.
  75. eureka.server.peer-eureka-status-refresh-time-interval-ms=0
  76. #eureka Peer-to-peer connection timeout
  77. eureka.server.peer-node-connect-timeout-ms=200
  78. #eureka idle time after peer node connection
  79. eureka.server.peer-node-connection-idle-timeout-seconds=30
  80. #Read data connection timeout between nodes
  81. eureka.server.peer-node-read-timeout-ms=200
  82. #eureka server Total number of connections between nodes
  83. eureka.server.peer-node-total-connections=1000
  84. #eureka server Maximum number of single machines connected between nodes
  85. eureka.server.peer-node-total-connections-per-host=10
  86. #The number of times eureka tried to obtain registration information when the service node was started
  87. eureka.server.registry-sync-retries=
  88. # When eureka tries to obtain registration information multiple times when the service node starts up
  89. eureka.server.registry-sync-retry-wait-ms=
  90. # When the eureka server is started, you cannot wait for the instance registration information from the peer node. How long should it wait?
  91. eureka.server.wait-time-in-ms-when-sync-empty=0
  92. ################server Configuration associated with remote####################33
  93. # , is it also provided to the remote region?
  94. eureka.server.disable-delta-for-remote-regions=false
  95. #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.
  96. eureka.server.disable-transparent-fallback-to-other-region=false
  97. # Indicates whether the content obtained from the Eureka server must be compressed for the remote zone if the server supports it.
  98. eureka.server.g-zip-content-from-remote-region=true
  99. #Connection eureka remote note connection timeout
  100. eureka.server.remote-region-connect-timeout-ms=1000
  101. #remote region Application whitelist
  102. eureka.server.remote-region-app-whitelist.
  103. #Connect eureka remote note connection idle time
  104. eureka.server.remote-region-connection-idle-timeout-seconds=30
  105. #Executing remote region The request thread pool size for obtaining registration information
  106. eureka.server.remote-region-fetch-thread-pool-size=20
  107. #remote region Timeout from reading data from peer eureka
  108. eureka.server.remote-region-read-timeout-ms=1000
  109. #Time interval for obtaining registration information from remote region
  110. eureka.server.remote-region-registry-fetch-interval=30
  111. #remote region The total number of connections connecting eureka nodes
  112. eureka.server.remote-region-total-connections=1000
  113. #remote region The number of stand-alone connections connecting eureka nodes
  114. eureka.server.remote-region-total-connections-per-host=50
  115. #remote region fetches the storage file of the registration information, and this reliable storage file needs a fully qualified name to specify
  116. eureka.server.remote-region-trust-store=
  117. #remote region Password of the stored file
  118. eureka.server.remote-region-trust-store-password=
  119. #remote region url. separated by multiple commas
  120. eureka.server.remote-region-urls=
  121. #remote region url. separated by multiple commas
  122. eureka.server.remote-region-urls-with-name.
  123. ################server Configuration associated with ASG/AWS/EIP/route52################### #33
  124. #Cache the expiration time of ASG information.
  125. eureka.server.a-s-g-cache-expiry-timeout-ms=0
  126. #Query the timeout time of ASG information.
  127. eureka.server.a-s-g-query-timeout-ms=300
  128. #Service update ASG information frequency
  129. eureka.server.a-s-g-update-interval-ms=0
  130. #AWSAccess ID
  131. eureka.server.a-w-s-access-id=
  132. #AWSSecurity Key
  133. eureka.server.a-w-s-secret-key=
  134. #AWSbinding strategy
  135. eureka.server.binding-strategy=eip
  136. #Use the name of the role that automatically extends the grouping from a third-party AWS account description.
  137. eureka.server.list-auto-scaling-groups-role-name=
  138. #Whether should establish a connection guide
  139. eureka.server.prime-aws-replica-connections=true
  140. #Number of times the server tries to bind candidate EIPs
  141. eureka.server.e-i-p-bind-rebind-retries=3
  142. # 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
  143. eureka.server.e-i-p-binding-retry-interval-ms=10
  144. #Time interval at which the server binds EIP. If and only if the service is bound
  145. eureka.server.e-i-p-binding-retry-interval-ms-when-unbound=
  146. #The number of times the server tries to bind route53
  147. eureka.server.route53-bind-rebind-retries=3
  148. #Servlet interval how long to try to bind route53
  149. eureka.server.route53-binding-retry-interval-ms=30
  150. #
  151. eureka.server.route53-domain-t-t-l=10

Eureka Instacen配置

  1. #Hostname of the service registry instance
  2. eureka.instance.hostname=localhost
  3. #Register the application group name in the Eureka service
  4. eureka.instance.app-group-name=
  5. #Register the application name in the Eureka service
  6. eureka.instance.appname=
  7. # Unique ID of the instance registered to the service center
  8. eureka.instance.instance-id=
  9. #IP address of the instance
  10. eureka.instance.ip-address=
  11. #Instance, whether IP is preferred over hostname
  12. eureka.instance.prefer-ip-address=false
  13. #Group name associated with this instance for automatic extension of the AWS platform,
  14. eureka.instance.a-s-g-name=
  15. #Deploy the data center for this instance
  16. eureka.instance.data-center-info=
  17. #Default address resolution order
  18. eureka.instance.default-address-resolution-order=
  19. #Instance environment configuration
  20. eureka.instance.environment=
  21. #Initialize the instance and register to the initial state of the service center
  22. eureka.instance.initial-status=up
  23. # Indicate whether as long as this instance is registered to the service center, immediately communicate
  24. eureka.instance.instance-enabled-onit=false
  25. #The namespace of the service instance for finding attributes
  26. eureka.instance.namespace=eureka
  27. #The child definition metadata of the service instance can be accepted by the service center.
  28. eureka.instance.metadata-map.test = test
  29. #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.
  30. eureka.instance.lease-expiration-duration-in-seconds=90
  31. # The interval at which the instance sends a heartbeat to the service center to indicate that the service instance is available.
  32. eureka.instance.lease-renewal-interval-in-seconds=30
  33. #Instance, registration service center, the number of communication opened by default
  34. eureka.instance.registry.default-open-for-traffic-count=1
  35. #Number of renewals per minute
  36. eureka.instance.registry.expected-number-of-renews-per-min=1
  37. #Instance health check url, absolute path
  38. eureka.instance.health-check-url=
  39. #Instance health check url, relative path
  40. eureka.instance.health-check-url-path=/health
  41. #Instance's home page url, absolute path
  42. eureka.instance.home-page-url=
  43. #Instance's home page url, relative path
  44. eureka.instance.home-page-url-path=/
  45. #Instance security health check url, absolute path
  46. eureka.instance.secure-health-check-url=
  47. #https
  48. eureka.instance.secure-port=443
  49. #httpsCommunication port is enabled
  50. eureka.instance.secure-port-enabled=false
  51. #http
  52. eureka.instance.non-secure-port=80
  53. #httpCommunication port is enabled
  54. eureka.instance.non-secure-port-enabled=true
  55. #Security virtual host name (https) for this instance
  56. eureka.instance.secure-virtual-host-name=unknown
  57. #Virtual host name of this instance (http)
  58. eureka.instance.virtual-host-name=unknown
  59. #The status of the instance is rendered url, absolute path
  60. eureka.instance.status-page-url=
  61. #The status of the instance is rendered url, relative path
  62. eureka.instance.status-page-url-path=/status

Eureka客户端配置

  1. #This client is available
  2. eureka.client.enabled=true
  3. #Instance Whether to register your own information on the eureka server for other services to discover, the default is true
  4. eureka.client.register-with-eureka=false
  5. #This client gets the registration information on the eureka server registry, the default is true
  6. eureka.client.fetch-registry=false
  7. # Whether to filter out, non-UP instances. Default is true
  8. eureka.client.filter-only-up-instances=true
  9. # zone and url address with Eureka Registration Service Center
  10.   eureka.client.serviceUrl.defaultZone=http://{eureka.instance.hostname}:{server.port}/eureka/
  11. #client is the idle waiting time after connecting to the Eureka server. The default is 30 seconds.
  12. eureka.client.eureka-connection-idle-timeout-seconds=30
  13. #client connects to eureka server connection timeout, the default is 5 seconds
  14. eureka.client.eureka-server-connect-timeout-seconds=5
  15. #clientRead timeout for the server
  16. eureka.client.eureka-server-read-timeout-seconds=8
  17. #clientConnection all eureka server total number of connections, the default 200
  18. eureka.client.eureka-server-total-connections=200
  19. #clientConnect to the number of single-machine connections on the eureka server. The default is 50.
  20. eureka.client.eureka-server-total-connections-per-host=50
  21. #Executive index rollback refresh related attribute, which is the maximum multiple of the retry delay, the default is 10
  22. eureka.client.cache-refresh-executor-exponential-back-off-bound=10
  23. #Execution program cache refresh thread pool size, the default is 5
  24. eureka.client.cache-refresh-executor-thread-pool-size=2
  25. # Execution program rollback related attributes, which is the maximum multiple of the retry delay. The default is 10
  26. eureka.client.heartbeat-executor-exponential-back-off-bound=10
  27. # Execution program thread pool size, the default is 5
  28. eureka.client.heartbeat-executor-thread-pool-size=5
  29. # Ask the frequency (s) of the Eureka service url information change, the default is 300 seconds
  30. eureka.client.eureka-service-url-poll-interval-seconds=300
  31. #The time (s) required to initially copy the instance information to the eureka server. The default is 40 seconds.
  32. eureka.client.initial-instance-info-replication-interval-seconds=40
  33. #How long does it take to copy the instance information to the eureka server again, the default is 30 seconds?
  34. eureka.client.instance-info-replication-interval-seconds=30
  35. #Time interval (s) from the eureka server registry to obtain registration information, the default is 30 seconds
  36. eureka.client.registry-fetch-interval-seconds=30
  37. # Get the region where the instance is located. The default is us-east-1
  38. eureka.client.region=us-east-1
  39. #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.
  40. eureka.client.prefer-same-zone-eureka=true
  41. # Get a list of available areas in the region where the instance is located, separated by commas. (AWS)
  42. eureka.client.availability-zones.china=defaultZone,defaultZone1,defaultZone2
  43. 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
  44. eureka.client.fetch-remote-regions-registry=
  45. #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
  46. eureka.client.allow-redirects=false
  47. eureka.client.client-data-accept=
  48. #Incremental information can be provided to the client, the default is false
  49. eureka.client.disable-delta=false
  50. The #eureka server serialization/deserialization information obtains the replacement string of the "_" symbol. The default is"__" 
  51. eureka.client.escape-char-replacement=__
  52. The #eureka server serialization/deserialization information obtains a replacement string for the "$" symbol. The default is"_-"
  53. eureka.client.dollar-replacement="_-"
  54. #When the server supports compression, whether to support the information obtained from the server for compression. Default is true
  55. eureka.client.g-zip-content=true
  56. # Whether to record the difference between the information in the registry between the eureka server and the client, the default is false
  57. eureka.client.log-delta-diff=false
  58. # If set to true, the client's status update will be updated on-demand to the remote server. The default is true.
  59. eureka.client.on-demand-update-status-change=true
  60. #This client is only interested in information about a single VIP registry. The default is null
  61. eureka.client.registry-refresh-single-vip-address=
  62. #client is forced to register to the service center during the initialization phase, the default is false
  63. eureka.client.should-enforce-registration-at-init=false
  64. #clientWhen the shutdown is displayed, the logout service is displayed from the service center. The default is true.
  65. eureka.client.should-unregister-on-shutdown=true
  66. # Get the proxy host of the eureka service, the default is null
  67. eureka.client.proxy-host=
  68. #Get the proxy password of the eureka service, the default is null
  69. eureka.client.proxy-password=
  70. # Get the proxy port of the eureka service, the default is null
  71. eureka.client.proxy-port=
  72. # Get the proxy username of the eureka service, the default is null
  73. eureka.client.proxy-user-name=
  74. #Attribute interpreter
  75. eureka.client.property-resolver=
  76. #Get the implementation name of the fallback option when the eureka client reads the registry at the first startup.
  77. eureka.client.backup-registry-impl=
  78. # ×××Configuration, if the latest XXX is stable, it can be removed, the default is null
  79. eureka.client.decoder-name=
  80. # , if the latest encoder is stable, it can be removed, the default is null
  81. eureka.client.encoder-name=
  82. # Whether to use the DNS mechanism to get a list of services and then communicate. Default is false
  83. eureka.client.use-dns-for-fetching-service-urls=false
  84. #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
  85. eureka.client.eureka-server-d-n-s-name=
  86. #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
  87. eureka.client.eureka-server-port=
  88. # 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.
  89. eureka.client.eureka-server-u-r-l-context=
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:2019-10-18,如有侵权请联系 cloudcommunity@tencent 删除服务配置clientinstanceserver

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论