【发布时间】:2016-09-16 00:25:45
【问题描述】:
我将 Netflix Zuul 与 Spring Boot 一起用于路由/代理目的。它侦听application.yml 中定义的端口:
server:
port: ${port:8080}
我还想使用 Hystrix 进行断路以及拥有 Hystrix 仪表板。我通过以下注释实现了这一点:
@EnableHystrixDashboard
@SpringBootApplication
public class Main {
public static void main(String[] args) {
new SpringApplication(Main.class).run(args);
}
}
现在我可以访问localhost:8080/hystrix 下的仪表板。
另外,我在端口8181 下设置了Spring Actuator,并在application.yml 中设置了management.port: 8181 属性。
我的问题是:
- 是否可以将 hystrix 仪表板放在其他端口下,例如8181还是其他?所以我可以确定端口
8080仅用于路由/代理目的?
【问题讨论】:
-
只需在 hystrix 仪表板的 application.yml 中添加 server.port 属性。它将在其他端口启动,实际问题是什么。
-
Hystirx Dashboard 与我的 Zuul 在同一个应用程序中启用,因此更改端口会使 Zuul 监听不同的端口,而不仅仅是 Hystirx Dashboard
-
你为什么要这样做......如果你需要差异端口,我认为 hystrix 仪表板必须是一个单独的应用程序......在同一个项目中使用它可能会使事情复杂化......跨度>
-
其实我现在是这样做的,我很好奇是否可以作为一个应用程序。不过,谢谢:)
标签: spring-boot netflix-zuul hystrix spring-boot-actuator spring-cloud-netflix