Distributed current-limiting framework Sentinel
Sentinel is a lightweight flow control component oriented to distributed service architecture. It mainly focuses on traffic and maintains the stability of microservices from multiple directions such as traffic limiting, network traffic shaping and service degradation.
Service circuit breaker and downgrade
In the microservice architecture, services are split in fine granularity and request links are long, so a user initiates a request and needs to invoke multiple microservices to complete the response.
If a service is unavailable due to network delay or request timeout, the current request is blocked. If the dependent service on a link is unavailable, the request is piled up, which may cause an avalanche effect. So the service circuit breaker is a solution to this problem.
Service circuit breaker: A service provider to provide service for the caller, such as service exceptions, request timeout, and so on, in order to prevent system from avalanche effect, a temporary failure of the interface segregation, disconnect and external interface, when the trigger fuse, a period of time the service call request will directly failure or return to good data, Turn off the circuit breaker state directly to the normal service invocation.
The characteristics of the Sentinel
- This application applies to service scenarios such as seckill, message peak load shifting, and cluster traffic control
- Real-time monitoring, in the console can view access application machine second level data
- Open source ecological support: Sentinel provides integration with other open source frameworks out of the box. Sentinel integration requires only the introduction of relevant dependencies and configuration
- SPI extension support: Flow limiting rules, dynamic data source adaptation, and other requirements can be customized through extension points
Sentinel of
Sentinel consists of two parts
- Console: Developed based on SpringBoot, it can be run directly after being packaged without Tomcat application container deployment
- Core libraries: are not dependent on any framework and can run in any Java runtime environment
Deployment of the Sentinel Dashboard
Sentinel provides a lightweight open source console that supports machine discovery, as well as health management, monitoring, rule management, and push.
Sentinel source address: github.com/alibaba/Sen…
Start console command
java -Dserver.port=9999 -Dcsp.sentinel.dashboard.server=localhost:9999 -Dproject.name=
sentinel-dashboard -jar sentinel-dashboard.jar
Copy the code
The parameter meanings are as follows:
- -dserver. port: specifies the access port of the Sentinel console. The default is 8080
- – Dcsp. Sentinel. Dashboard. Server: specify the sentinel bashboard console the IP address and port, setting aims to expose their own current limit data to the monitoring platform
- – dproject. name: sets the project name
The Sentinel console has introduced basic login function since 1.6.0. The default user name and password are Sentinel