【Linux】sentinel在Linux上运行配置搭建
Sentinel 提供一个轻量级的开源控制台,它提供机器发现以及健康情况管理、监控(单机和集群),规则管理和推送的功能。这里,我们将会详细讲述如何通过简单的步骤就可以使用这些功能。
在Releases · alibaba/Sentinel (github.com) 下载最新版本的控制台 jar 包
下载完成拖进虚拟机连接工具(.log是日志)
在文件的目录里输入下面指令来运行sentinel,注意:(记得在target/sentinel-dashboard.jar里面输入你的版本信息)
java -Dserver.port=8080 \
-Dcsp.sentinel.dashboard.server=localhost:8080 \
-Dproject.name=sentinel-dashboard \
-jar target/sentinel-dashboard.jar
运行成功后开始写代码配置
1.xml配置文件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
2.yml文件配置( transport:
dashboard: xxx.xxx.xxx.xxx:8080虚拟机ip地址)
server:
port: 7005
spring:
application:
name: selentinel-server
cloud:
sentinel:
transport:
dashboard: xxx.xxx.xxx.xxx:8080
还没有评论,来说两句吧...