springcloud2.0 -- dashboard

pom依赖

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
            <version>2.0.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

启动类加上注解

@SpringBootApplication
@EnableHystrixDashboard
public class ExampleDashboardApplication {

    public static void main(String[] args) {
        SpringApplication.run(ExampleDashboardApplication.class, args);
    }

}

配置文件

server:
  port: 8753

这个章节没有太多需要说明的,简单配置后就可以启动了,打开是一个页面,同时dashboard可以不需要加入到eureka,因为他挂掉不会影响整体业务。他的唯一功能就是查看一下其他模块的流量。
访问地址: http://localhost:port/hystrix 这个是页面的地址。
在这里插入图片描述
注意下红线框中中的内容,第一条指的是聚合流量的地址组成方式,这个组成的地方放到哪个输入框就可以监控到内容了。
第二条指的是可以单一的监控某个模块,cluster=实例名称,后面加上你实例注册到eureka的名称就可以了。
最后一条是单一模块的访问方式,注意地址中间有 actuator。这个actuator需要你的采集的端点 (在本例中是actuator) 引入一个依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

最后

以上是初步对sprngcloud2.0的探索,很多内容是自己的理解,并不代表就是正确的使用。
很多地方还有一些困惑,同时还有一些模块没有加入进来,比如config和zipkin,后续有时间将会继续完善已经改正。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值