I have created eureka service registry and registered services into that. Currently only one instance of a service is running. How to add multiple instances of a same service? I am developing standalone application. And I am accessing services through Rest Template.I am following https://spring.io/guides/gs/service-registration-and-discovery/
相关问题
- spring boot cloud eurka windows 10 eurkea returns
- spring boot application failed to autowired feign
- How to enable Hystrix DEBUG level logging
- How to implement Sleuth Tracing With Feign.Builder
- Microservices - Connection Pooling when connecting
相关文章
- Spring Cloud Sleuth + log4j2
- Setting the route programmatically in Spring Cloud
- Unable to get /hystrix.stream in Spring Cloud
- how to create multiple instances of eureka service
- Spring MVC web app behind zuul redirect issue
- How to make Zuul dynamic routing based on HTTP met
- How to fine-tune the Spring Cloud Feign client?
- Define different Feign client implementations base
You will definitely need another instance of eureka once you have that here is the official spring-cloud documentation on eureka peer awareness.
In short all you need to do is make them aware of each other by adding the info about each other in their respective application.yml. Hope this helps. Read the doc to learn in detail.
Couple of other links to learn about Eureka github Issue, Understanding Spring Cloud Eureka Server self preservation and renew threshold. Hope this helps.
If you aim to run multiple instances of one service on a same host, you must:
These two must be configured individually, e.g.
and
Each instance would need to have a unique
instanceId
, normally configured inapplication.yml
using:Adding the port to the
instanceId
allows to run multiple instances in the same host.I have also seen adding a random number instead of the port the instance listens on.
I blogged about service registration and discovery using
Jersey
,Spring
,Eureka
,Ribbon
andFeign
with accompanying source code at http://tech.asimio.net/2016/11/14/Microservices-Registration-and-Discovery-using-Spring-Cloud-Eureka-Ribbon-and-Feign.htmlAnd more recently blogged about how to register and discover multiple versions of a service using
Eureka
andRibbon
at http://tech.asimio.net/2017/03/06/Multi-version-Service-Discovery-using-Spring-Cloud-Netflix-Eureka-and-Ribbon.html.