zoukankan      html  css  js  c++  java
  • springcloud-Hystrix图形化Dashboard搭建

    Hystrix也能做对服务的监控,观察服务被调用的情况。下面是步骤:

      1.创建一个模块,用于监控其他服务

      2.添加依赖

        <dependencies>
    # 该依赖是hystrix核心监控的依赖
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
            </dependency>
            <dependency>
                <groupId>cn.aib.springcloud</groupId>
                <artifactId>springclud-api-common</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>
    # 该依赖是用于监控的
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <scope>runtime</scope>
                <optional>true</optional>
            </dependency>
        </dependencies>

      3.添加配置

    server:
      port: 9001

      4.主启动

    @SpringBootApplication
    @EnableHystrixDashboard #该注解是激活监控
    public class HysDashApplication {
        public static void main(String[] args) {
            SpringApplication.run(HysDashApplication.class, args);
        }
    }

      接下来只需要启动本模块,访问:http://locahost:9001/hystrix,如果出现界面则代表成功

  • 相关阅读:
    在vue项目中使用element-ui的Upload上传组件
    express使用ejs模板引擎渲染html文件
    nodejs服务端实现post请求
    anroid学习笔记(1)
    水平遍历和嵌套递归
    写代码的风格
    简易版本vue的实现和注解
    JavaScript下的new操作符做了什么?
    node下的跨域传递cookie
    用node研究axios前后端交互状态码规则
  • 原文地址:https://www.cnblogs.com/ibcdwx/p/14440468.html
Copyright © 2011-2022 走看看