1、POM配置
和普通Spring Boot工程相比,仅仅添加了Turbine和Spring Boot Starter Actuator依赖
org.springframework.cloud spring-cloud-starter-turbine org.springframework.cloud spring-cloud-netflix-turbine org.springframework.boot spring-boot-starter-actuator org.springframework.cloud spring-cloud-dependencies Dalston.SR2 pom import
02、使能Eureka Server
@SpringBootApplication@EnableTurbine//使能Turbinepublic class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
03、src/main/resources工程配置文件application.yml内容如下
spring: application.name: turbine-service-monitoring server: port: 4001 #security.basic.enabled: false turbine: aggregator: clusterConfig: default # 指定聚合哪些集群,多个使用","分割,默认为default。 appConfig: ribbon-hello-service-consumer, feign-hello-service-consumer ### 配置Eureka中的serviceId列表,表明监控哪些服务 clusterNameExpression: new String("default") eureka: client: serviceUrl: defaultZone: http://discovery:1000/eureka/