如何从Zuul获得有关IP地址的特定诊断信息? [英] How can I get specific diagnostic information on an IP address from Zuul?

查看:683
本文介绍了如何从Zuul获得有关IP地址的特定诊断信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Zuul和Eureka,还有很多较小的服务.使用Eureka,我可以看到所有服务及其关联的主机/IP地址.通常,我可以启动另一个服务的多个实例,Eureka会把它们接起来供Zuul路由.我目前遇到一个问题,我在尤里卡(Eureka)注册了一个服务的三个实例,但是Zuul仅路由到其中一个.我不知道该去哪里从Zuul获取诊断信息,以了解为什么它没有路由到其他两个实例.我尝试了一些简单的操作,例如将请求从Zuul框手动发送到服务框,以确保它们可以通信.

I have Zuul and Eureka running, with a bunch of smaller services. Using Eureka, I can see all of the services and their associated host/IP address. Usually, I can boot up multiple instances of another service and Eureka will pick them up for Zuul to route to. I'm currently having an issue where I have three instances of a service registered in Eureka, but Zuul only routes to one of them. I don't know where to go to get diagnostic information from Zuul to understand why it isn't routing to the other two instances. I've tried simple things, like manually sending requests from the Zuul box to the service boxes to make sure they can communicate.

Zuul是否公开端点以列出主机/IP地址及其状态?我有哪些诊断选项?

Does Zuul expose an endpoint to list hosts/IP addresses and their status? What are my diagnostic options?

推荐答案

您可以尝试使用因此,如果您在本地主机上的端口8080上运行zuul,则可以对http://localhost:8080/routes进行GET调用,您将获得类似

So, if you running zuul on your localhost on port 8080 you can do a GET call to http://localhost:8080/routes and you will get something like

{
   /stores/**: "http://localhost:8081"
}

根据您使用的版本,还需要设置

Depending on the version you are using, you also need to set

management.security.enabled = false

中的

in the application.properties

您还可以使用日志记录机制.
将LoadBalancerContext的日志级别设置为仅在application.properties

You can also use the logging mechanism.
Set the loglevel just of the LoadBalancerContext to debug in application.properties

 #logging
 logging.level.com.netflix.loadbalancer.LoadBalancerContext=DEBUG

它将记录路由的每个呼叫.

It will log each call that is routed.

这篇关于如何从Zuul获得有关IP地址的特定诊断信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆