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,如果出现界面则代表成功

  • 相关阅读:
    python学习:字符编码与转码
    python学习:文件操作
    python学习:基本运算符
    python学习:列表、元组、字典、集合
    python学习:基础知识
    linux常用命令
    hadoop手动安全模式
    System.getProperty("user.dir")的理解
    如何获取SpringBoot项目的applicationContext对象
    spring无法注入bean
  • 原文地址:https://www.cnblogs.com/ibcdwx/p/14440468.html
Copyright © 2011-2022 走看看