一、简介
在大量的服务状态下,哪些服务挂了、哪些服务流量小、哪些服务流量大,这些数据我们如何得知呢?如果没有一个可以实时监控服务的组件,那么这将多么可怕。hystrix dashboard就是为此而生。
二、pom文件
<dependencies>
<dependency>
<groupId>com.sustly</groupId>
<artifactId>blog_api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!--负载均衡-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
</dependencies>
三、application.properties
server.port=10010
spring.application.name=blog_consumer_hystrix_dashboard
eureka.client.register-with-eureka=true
eureka.client.service-url.defaultZone=http://localhost:7001/eureka/
eureka.instance.instance-id=blog_consumer_hystrix_dashboard
eureka.instance.prefer-ip-address=true
info.app.name=blog_consumer_hystrix_dashboard
info.company.name=www.sustly.xyz
info.build.artifactId=${project.artifactId}
info.build.version=${project.version}
四、配置类
@SpringBootApplication
@EnableHystrixDashboard
public class BlogConsumerHystrixDashboard {
public static void main(String[] args) {
SpringApplication.run(BlogConsumerHystrixDashboard.class, args);
}
}
五、效果
这些数据的含义是什么呢?
看官网的介绍哦!
看不懂就对了,下面是中文版的!
六、github地址
https://github.com/sustly/blog_vue_server
注意:master分支才是springcloud版本