Is there any possible way to find all instances of eureka server from a eureka client ?
Yes. You can register Eureka server itself in the registry.
i.e. In eureka-server
eureka.client.register-with-eureka=true
Now Eureka server instance details will be available when you query the Eureka server from other clients.
Related
I have one spring boot ms app that deployed on external tomcat server. To register this ms app created one eureka server and deployed on another tomcat server.Deployment success both the server & I can see the ms app at eureka server but ms app port is not showing at eureka server- details as below -
Eureka Server configuration-
spring.application.name=MyEureka Server
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
eureka.client.fetchRegistry=false
eureka.instance.preferIpAddress=true
Eureka Client configuration-
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.serviceUrl.defaultZone = http://192.168.6.27:11005/my-service-registry/eureka
spring.application.name=MY-REST-SERVICE
management.endpoints.web.exposure.include=*
eureka.client.healthcheck.enabled=true
When both servers are up I am getting ip:MY-REST-SERVICE not getting any port info.
Please suggest and help.
Using Spring Admin + Eureka to monitor all micro-service and deploy it in Kubernetes;
Spring Admin UI and discover all micro-service instances, but can't check detail of each instance, check detail network, we can see the
service health check has show 502 error:
http://[admin server real ip]/instances/3f5afb61f59b/actuator/health >> 502 bad getway
Check Eureka register, I found all eureka client was resisted with Kubernetes virtual ip;
I already resolve it, but change the dependency from spring-boot-admin to spring-cloud-admin
Lets consider the following situation.This example will only have urls containing localhost. I have a zuul proxy setup and lets say its running on port 8080. So
Zuul proxy-
localhost:8080
I have an eureka server setup running on port 81.
Eureka server-
localhost:8081.
I have an application lets call it by name-example which is a REST web service. Its running on 3 different ports 82,83 and 84. All 3 instances are registered with eureka server. I have a filter setup in zuul for the uri /example.
So i expect consumers to call the zuul proxy at locahost:8080/example.
Now, in the application example for the request mapping /example, there is a controller setup.
So what i want to do is basically have the consumers call localhost:8080/example and route that request to localhost:8082/example, localhost:8083/example, localhost:8084/example . I know how to load balance using ribbon and eureka and have all the appropriate properties set to achieve that.
zuul.routes.example.serviceid=example
ribbon.eureka.enabled=true.
What i want to do is have ribbon look up the list of url(s) from eureka server and then call localhost:8082/example rather localhost:8082.
Is this possible?
Thank you in advance.
You need to specify the path & serviceId
zuul:
routes:
examplepath:
path: /example/**
serviceId: name-example
stripPrefix: false
The serviceId is the name registered with Eureka. Hope you are specifying Eureka server details in you Zuul gateway.
I use Eureka and Spring Cloud;
Start 2 Eureka Clients;
When closing a Eureka Clients, the Eureka client unregister from Eureka server need a little time (3-5 minutes);
the RestTemplate with #LoadBalanced will continue call the closing service, how fixed it?
I believe a Eureka client app doesn't go through the Eureka server to get metadata about another Eureka client app for every request. This means a Eureka client app keeps a cache of the registry, if another Eureka client app deregisters, its metadata might still be caches in the previous client until it syncs with the Eureka server.
This behavior might be configurable through one or a combination these settings:
eureka:
instance:
registryFetchIntervalSeconds:
leaseRenewalIntervalInSeconds:
leaseExpirationDurationInSeconds:
I hava eureka server at eureka-server.com host and application with appId facade registered at server. Facade application has /users endpoint. Can I call /users endpoint through Eureka server something like this eureka-server.com/facade/users ?
No, Eureka can't proxy your calls through it, it's pure service discovery. But you can add a separate Zuul service with reverse proxy filtering which uses Eureka client to discover routes. Spring Cloud Netflix Zuul component has this out of the box.