微服務中重要的限流問題,這個時候就需要一個專業的限流框架來支撐。下面就是支撐天貓雙十一的框架Sentinel(官方認證很穩)
一、下載Sentinel
地址:https://github.com/alibaba/Sentinel/releases
二、直接運行
Sentinel 控制台是一個標准的 Spring Boot 應用,以 Spring Boot 的方式運行 jar 包即可。
java -Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar
三、登陸界面
直接訪問,賬號密碼都是sentinel
http://127.0.0.1:8081/

進入之后,首頁就是這樣的。

四、springboot配置sentinel
地址:https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel
官方有很詳細的教程,不再重復。不過有一些個人遇到問題說明一下。

運行項目idea的項目,刷新http://127.0.0.1:8081/#/dashboard/app/Application 就可以看到下面的信息。

五、總結
sentinel的文檔很清晰,基本上按照教程都能完成,一些細節需要注意,其他都非常順利。
