Spring cloud 未在Spring Cloud Microservice中加载用于聚合的Turbine Dashboard
我正在尝试使用SpringMVC和SpringBoot框架开发SpringCloud微服务。以及用于spring cloud的Eureka服务器、Zuul、Ribbon、hystrix和Turbine。我已经开发了一个微服务,并且只实现了hystrix仪表板。我能带着希思特里克斯仪表盘。现在我正在实施更多的服务。所以我选择了涡轮机作为监控的聚集。但它没有得到仪表板。我在单独的spring boot项目中实现了turbine 我的pom.xml包含Spring cloud 未在Spring Cloud Microservice中加载用于聚合的Turbine Dashboard,spring-cloud,turbine,Spring Cloud,Turbine,我正在尝试使用SpringMVC和SpringBoot框架开发SpringCloud微服务。以及用于spring cloud的Eureka服务器、Zuul、Ribbon、hystrix和Turbine。我已经开发了一个微服务,并且只实现了hystrix仪表板。我能带着希思特里克斯仪表盘。现在我正在实施更多的服务。所以我选择了涡轮机作为监控的聚集。但它没有得到仪表板。我在单独的spring boot项目中实现了turbine 我的pom.xml包含 <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>
@SpringBootApplication
@EnableHystrixDashboard
@EnableCircuitBreaker
@EnableTurbine
public class ZTurbineClientApplication {
public static void main(String[] args) {
SpringApplication.run(ZTurbineClientApplication.class, args);
}
}
server.port=8085
spring.application.name=espace-Turbine
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
turbine:
aggregator:
clusterConfig: APPCLUSTER
app-config: espaceService1,espaceService2
instanceUrlSuffix.APPCLUSTER: /hystrix.stream
和my Turbine project application.properties文件,其中包含
<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>
@SpringBootApplication
@EnableHystrixDashboard
@EnableCircuitBreaker
@EnableTurbine
public class ZTurbineClientApplication {
public static void main(String[] args) {
SpringApplication.run(ZTurbineClientApplication.class, args);
}
}
server.port=8085
spring.application.name=espace-Turbine
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
turbine:
aggregator:
clusterConfig: APPCLUSTER
app-config: espaceService1,espaceService2
instanceUrlSuffix.APPCLUSTER: /hystrix.stream
我以前的first services的application.properties文件如下
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
spring.application.name=espaceService1
server.port=8080
eureka:
instance:
prefer-ip-address: true
leaseRenewalIntervalInSeconds: 3
leaseExpirationDurationInSeconds: 3
metadata-map:
cluster: APPCLUSTER
第二个服务的应用程序属性文件包含
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
spring.application.name=espaceService2
server.port=8081
eureka:
instance:
prefer-ip-address: true
leaseRenewalIntervalInSeconds: 3
leaseExpirationDurationInSeconds: 3
metadata-map:
cluster: APPCLUSTER
这些是我的实现细节
在我使用URL“”之后。并贴上“。但出现“无法连接到命令流”之类的错误。在下面添加屏幕截图
您需要从逗号分隔的服务名称中删除空格
turbine.aggregator.cluster-config=espace-Second_Microservice,espaceFirst_Microservice
您无法聚合来自不同群集名称的流,或者在espace-Second_Microservice和espace-First_Microservice中使用一个群集名称,或者根本不使用群集
To define one cluster name use below config
eureka:
instance:
prefer-ip-address: true
leaseRenewalIntervalInSeconds: 3
leaseExpirationDurationInSeconds: 3
metadata-map:
cluster: APPCLUSTER
使用下面提到的涡轮机配置
turbine:
aggregator:
clusterConfig: APPCLUSTER
app-config: espace-Second_Microservice,espace-First_Microservice
instanceUrlSuffix.APPCLUSTER: /hystrix.stream
在Hystrix仪表板中使用http://{turbine host}:{turbine Port}/turbine.stream?cluster=APPCLUSTER是否将turbine指向Hystrix.stream?断路器的代码路径是否已执行?我已经使用hystrix实现了我的服务。之后,我尝试使用turbine聚合监控。因此,在hystrix仪表板页面中,我尝试获取turbine.stream..服务和turbine项目是分开的。在服务中,我实现了断路器。我根据上面的修改。但屏幕上仍然出现“无法连接到命令度量流”的错误。另外,很抱歉回复晚了。我正在修改代码。请看上面的内容。您正在混合yaml文件和属性文件的配置。如果使用的是.properties文件eureka.instance.preferIpAddress=true eureka.instance.leaseRenewalIntervalInSeconds=3 eureka.instance.leaseExpirationDurationInSeconds=3 eureka.instance.metadataMap.cluster,则需要以属性文件格式定义配置=APPCLUSTER@PrateekShrivastava-你能带我到这里吗?