Spring Cloud Alibaba 2 sentinel搭建
安装启动sentinel
启动
java -Dserver.port=8180 -Dcsp.sentinel.dashboard.server=localhost:8180 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard-1.8.3.jar
控制台
http://localhost:8180
账户密码都是sentinel
编码
- 在搞定nacos注册中心后进行编码
- 子项目添加依赖
<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency>
- 子项目修改配置文件
spring: application: # 服务名 name: pped-sentinel cloud: sentinel: transport: dashboard: 127.0.0.1:8180 port: 8101
- Sentinel是懒加载模式,需要访问某个接口后才能在控制台显示。
- 打开控制台:http://localhost:8180/
- 可以在簇点链路查看接口,进行流控,熔断…