In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "What are the common problems of Spring Cloud". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
I. Eureka Frequently Asked Questions
Eureka registration service slow
By default, registration of services to Eureka Server is slow. During development or testing, it is often desirable to speed up the process to increase productivity.
Causes of the problem and solutions:
Registration of services involves periodic heartbeats, by default every 30 seconds (via client-configured serviceUrl). Only if instance, server, and client local caches
The service is only discovered by other clients when all metadata in is the same (so it may take 3 heartbeats). can use parameters
eureka.instance.leaseRenewalInSeconds modifies the time interval to speed up client connections to other services. Best in a production environment
Stick with the defaults because there are calculations inside the server that make assumptions about renewal.
In summary, to solve the problem of slow service registration, simply set eureka.instance.leaseRenewalInSeconds to a smaller value. this configuration
Used to set the time interval for Eureka Client to send heartbeats to Eureka Server. Default is 30 seconds. In the production environment, it is recommended to adhere to the use of
Default value.
Stopped microservice node logout slow or not logout
In development environments, you often want Eureka Server to quickly and efficiently unregister stopped microservice instances. However, due to Eureka Server cleanup invalid nodes
For reasons such as long dot cycle (default 90 seconds) and self-protection mode, you may encounter the problem of slow or even no logout of microservices. The solution is as follows:
Eureka Server:
Configure turning off self-protection and configuring the interval at which Eureka Server cleans up invalid nodes as needed.
eureka.server.enable-self-preservation#is set to false, turning off self-protection, thus ensuring that microservices will be logged out eureka.server.eviction-interval-timer-in-ms#cleanup interval (in milliseconds, default 60 * 1000)
Eureka Client:
Configure health checks to be turned on and renewal update and expiration times as needed.
eureka.client.healthcheck.enabled#set to true to enable health check (requires spring-boot-starter-actuator dependency) eureka.instance.lease-renewal-interval-in-seconds#renewal interval (default is 30 seconds) eureka.instance.lease-expiration-duration-in-seconds#renewal expiration time (default 90 seconds)
It is worth noting that these configurations are recommended for development or testing only, and sticking to the defaults is recommended for production environments.
Eureka's UNKNOWN Problem Summary and Solution
Registration information UNKNOWN is a problem that beginners often encounter. But often a lot of novices, and do not know that there are two kinds of UNKNOWN situation, one is
The application name is UNKNOWN, and the other is the application state UNKNOWN.
Application Name UNKNOWN
The application name UNKNOWN is obviously inappropriate. First, the name of the microservice is not semantic enough to intuitively see which microservice this is; more importantly,
We often consume interfaces for microservices using application names.
Generally speaking, there are two situations that can cause this problem:
The spring.application.name or eureka.instance.appname properties are not configured. If neither of these attributes is configured, it results in the app name
Unkown's problem.
Some older versions of SpringFox cause this problem, such as SpringFox 2.6.0. SpringFox 2.6.1 or later is recommended.
Microservice instance status UNKNOWN
The microservice instance state UNKNOWN is also troublesome. In general, only microservices with UP status will be requested. This problem is usually caused by a health check.
eureka.client.healthcheck.enabled=true must be set in application.yml, not bootstrap.yml,
Otherwise, some scenarios will cause problems with the application state UNKNOWN.
"What are the common problems of Spring Cloud" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 296
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.