I have a Spring Boot (2.4) app (a generic service) and a Eureka discovery server running. The server doesn't register itself as an instance. I am able to navigate to the Eureka dashboard at the default location of localhost:8761 to get an overview of all the registered instances. I successfully see the service is registered in Eureka. However, this dashboard doesn't give any details about the instance except the name and the port number. I want to be able to see the instance meta data. Is this possible using the dashboard? O maybe there is some exposed URL by the Eureka server that I can call in a browser or postman? Or is there an URL available in the Eureka client (the service) that gives details about its Eureka metadata?
I read thet feign clients access something to be able to query the registry. Can I mimic this as human in a browser?
Go to localhost:8761/eureka/apps
Related
I am trying setting up an websphere application server cluster and deploy an web application on it. I have successfully access the application with a web server. but i have some question, if i would access the application bypassing the web server by using 9080 to the single server, i get error when sign in servlet respond.redirect to jsp page. the session was lost, are we not suppose to access the application in cluster environment with out the web server ?
As long as you target an individual server in the cluster, you should not lose your session or suffer any other ill effects for not using/having a proxy server between you and the cluster. You should look closely at the Cookies issued through that flow and make sure they don't have a bad domain or path and that you don't get redirected back through the webserver or otherwise to another JVM.
Also verify there is no DNS-based load balancing. If you don't have session persistence/distribution/replication it won't work.
I'm config an application using spring cloud eureka. I start my discovery app in the 8761 port and reaching the console in "http://localhost:8761".
So, I start my client application and it's appear in the "Application" page of eureka console.
First question:
My client is using "server.port=0" in properties config so the tomcat port is starting in random. How can I reaching my services in client? Example: I have a get request in "/api/stuff", is that possible to access this not using the random port? Suppose I don't know the port!
Second Question:
I can start any clients I want, they will start, assuming a random port and register in the cloud server discovery, I can see the log:
"Registering application FLY-CLIENT with eureka with status UP"
But they don't appear in "Application" page of eureka console, why they don't appear?
Thanks!
If you are using Spring RestTemplate to request the services registered in Eureka you need to make it #LoadBalanced, something like this should do the try:
#LoadBalanced
#Bean
RestTemplate restTemplate() {
return new RestTemplate();
}
// usage
restTemplate.getForObject("http://your-service-name/api/stuff", StuffResponse.class);
As for the 2nd question, I'm a little confused, as you mentioned earlier in the question that your application appears on Eureka's dashboard. Is this behavior only happening for the "fly-client"?
I have a spring-boot client app deployed in a customer network and I want to use SBA as a GUI for its actuator endpoints. I cannot use register-client-applications to register the app, mainly because the client app has no connectivity to SBA (its behind a firewall).
Is there a way how to add a client to SBA manually?
You can add use a static configuration for spring cloud's discovery client. So there is no need that the client reach the sba server. See http://codecentric.github.io/spring-boot-admin/current/#spring-cloud-discovery-static-config
we have a eureka server deployed on server and developers for development purpose register their microservices with it. but when some developers that work on same microservice, register own microservice's instance on eureka [sure with their local ip address] get wrong instance. developer can't change instance name because other services call their service with service name. what's best pattern for our problem?
Another approach to make the developers register their microservices as OUT_OF_SERVICE so then the services will not be called by the rest of services registered in Eureka but they can interact with the rest of services registered.
You can set it as out fo service by adding this to the application.yml:
eureka:
instance:
initialStatus: OUT_OF_SERVICE
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?
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.