Skip to content

Commit

Permalink
微服务监控
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxiufeng666 committed Dec 26, 2017
1 parent 66efaa2 commit 1495e17
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
22 changes: 17 additions & 5 deletions monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,30 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
<artifactId>spring-cloud-starter-eureka</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-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;

@SpringBootApplication
@EnableDiscoveryClient
//@EnableFeignClients
@EnableHystrixDashboard
//@EnableCircuitBreaker
@EnableTurbine
public class MonitorApplication {

public static void main(String[] args) {
Expand Down
Empty file.
28 changes: 28 additions & 0 deletions monitor/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
server:
port: 9050
spring:
application:
name: micro-service-monitor
eureka:
instance:
prefer-ip-address: true #使用IP注册
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
lease-renewal-interval-in-seconds: 5 ##为了能够快速删除
lease-expiration-duration-in-seconds: 10 ##为了能够快速删除
client:
service-url:
defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/

###actuator监控点 start####
endpoints:
health:
sensitive: false
enabled: true
##默认情况下很多端点是不允许访问的,会返回401:Unauthorized
management:
security:
enabled: false
###actuator监控点 end####
turbine:
app-config-list: micro-a-service
cluster-name-expression: "'default'"

0 comments on commit 1495e17

Please sign in to comment.