How can I get specific diagnostic information on an IP address from Zuul?

别说谁变了你拦得住时间么 提交于 2019-12-12 04:54:34

问题


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.

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


回答1:


You can try to list all your endpoints with the routes endpoint

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

EDIT:

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.



来源:https://stackoverflow.com/questions/45922561/how-can-i-get-specific-diagnostic-information-on-an-ip-address-from-zuul

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!