Spring Cloud Early recognition

Source: Internet
Author: User
Tags failover

Spring Cloud is an open, easy-to-deploy, easy-to-maintain distributed development toolkit that leverages the convenience of Springboot development to implement distributed service capabilities, and is a well-established community with a high level of community activity. Spring cloud has taken into account the features of most Internet company architectures since its inception, such as service discovery registration, Configuration center, message bus, load balancing, circuit breakers, data monitoring, and more.

Spring Cloud Related components:

Eureak
Eureka is a product of Netflix's open source offering service registration and discovery, which provides complete services registry and service discovery implementations. is one of the most important and core components of the spring cloud system.
With plain English, Eureka is a service center, all the services can be provided to register it here to manage, the other callers need to go to the registry to obtain, and then make the call, avoid the direct call between services, easy to follow the level of expansion, failover and so on.

As a service center such an important component one but hangs up will affect the entire service, therefore needs to build Eureka cluster to maintain high availability, at least two units are recommended in production.
As the flow of the system continues to increase, a service needs to be scaled according to the situation, and the Eureka internally has the capability of balancing the load, and only needs to add the corresponding server instance.
What if an instance hangs during the run of the system? Eureka Content has a heartbeat detection mechanism, if an instance does not communicate within the specified time, it will automatically be eliminated, to avoid an instance hanging off and affect the service.
Therefore, the use of Eureka automatically has a registry, load balancing, failover functions.

Hystrix  

Hystrix will immediately notify the caller of the call failure and prevent the caller from continuing to wait for the whole service to be affected if a service calls N-times without response. The Hystrix interval will check again for this service if service recovery will continue to serve.
Hystrix Dashboard and turbine
When the fuse occurs, it is necessary to respond quickly to solve the problem and avoid further spread of the fault, so the monitoring of the fuse becomes very important.
Fuse monitoring now has two tools: Hystrix-dashboard and turbine
Hystrix-dashboard is a real-time monitoring tool for Hystrix, through Hystrix dashboard we can visually see the request response time of each hystrix command, the request success rate and other data.
But using only Hystrix dashboard, you can only see the service information in a single app, which is obviously not enough.
We need a tool that allows us to summarize data from multiple services within the system and display it on Hystrix Dashboard, a tool that is turbine

Spring Cloud Config

Spring Cloud Config is a configuration management solution for distributed systems. It contains the client and server two parts, the server provides the configuration file storage, in the form of an interface to provide the contents of the configuration file, the client through the interface to obtain data, and based on this data to initialize their own applications.
In fact, the server side will all the configuration file service, need to configure the service instance of the file to the config server to obtain the corresponding data. All configuration files are consolidated to avoid configuration file fragmentation.

If the configuration file is changed during service run time, the service will not get the latest configuration information and need to solve this problem to introduce refresh. It can reload the configuration file during the run of the service.
When all the configuration files are stored in the configuration center, the configuration center becomes a very important component.

If a problem with the configuration center can result in catastrophic consequences, it is recommended that you cluster the configuration center in production to support high availability of the configuration center.

Spring Cloud Bus

Spring Cloud Bus connects the nodes of each distribution through a lightweight message broker. This is used for changes in broadcast status (such as configuration changes) or other message directives.
One of the core ideas of spring Cloud Bus is to extend the spring boot application through a distributed launcher, or to establish communication channels between one or more applications. The only way to implement this is to use the AMQP message agent as a channel.
Spring Cloud Bus is a lightweight communication component that can also be used in other similar scenarios.

Spring Cloud Zuul

Zuul is a load balancer based on the JVM Routing and service side of Netflix.

Spring Cloud Zuul Routing is an integral part of the microservices architecture, providing dynamic routing, monitoring, resiliency, security, and other edge services.
Its specific role is service forwarding, receiving and forwarding all internal and external client calls. The use of Zuul can be used as a unified access portal for resources, but also can be done in the gateway to do some similar functions such as permission checking.

Spring Cloud Sleuth

Spring Cloud Sleuth provides link tracking for calls between services. With sleuth, you can clearly understand what services a service request has gone through, and how long each service has taken to process. So that we can easily clarify the relationship between micro-service calls.

The Spring cloud components work together:

Eureka is responsible for the registration and discovery of services, very good to connect the services together
The hystrix is responsible for monitoring the call situation between services, successive failures for fuse protection.
Hystrix Dashboard,turbine is responsible for monitoring the hystrix of the fuse and giving a graphical display
Spring Cloud Config provides a unified configuration center service
When the configuration file changes, Spring Cloud Bus is responsible for notifying the services to get the latest configuration information
All external requests and services, we are through the Zuul to carry forward, play the role of the API Gateway
Finally, we use Sleuth+zipkin to record all the request data, so that we could perform the subsequent analysis.

Spring Cloud Early recognition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.