【Linux】sentinel在Linux上运行配置搭建

蔚落 2024-04-03 13:07 157阅读 0赞

Sentinel 提供一个轻量级的开源控制台,它提供机器发现以及健康情况管理、监控(单机和集群),规则管理和推送的功能。这里,我们将会详细讲述如何通过简单的步骤就可以使用这些功能。

在Releases · alibaba/Sentinel (github.com) 下载最新版本的控制台 jar 包

e29111159c994ad391b831fd9a7ad6c8.png

下载完成拖进虚拟机连接工具(.log是日志)

41e99a404060427c8a3d139c3b21f28a.png

在文件的目录里输入下面指令来运行sentinel,注意(记得在target/sentinel-dashboard.jar里面输入你的版本信息)

  1. java -Dserver.port=8080 \
  2. -Dcsp.sentinel.dashboard.server=localhost:8080 \
  3. -Dproject.name=sentinel-dashboard \
  4. -jar target/sentinel-dashboard.jar

运行成功后开始写代码配置

1.xml配置文件

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-web</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>com.alibaba.cloud</groupId>
  7. <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
  8. </dependency>

2.yml文件配置( transport:
dashboard: xxx.xxx.xxx.xxx:8080虚拟机ip地址)

  1. server:
  2. port: 7005
  3. spring:
  4. application:
  5. name: selentinel-server
  6. cloud:
  7. sentinel:
  8. transport:
  9. dashboard: xxx.xxx.xxx.xxx:8080

发表评论

表情:
评论列表 (有 0 条评论,157人围观)

还没有评论,来说两句吧...

相关阅读