netflix-eureka

Heroku load balancer vs Netflix zuul

感情迁移 提交于 2019-12-04 06:23:09
According to this answer https://stackoverflow.com/a/41811770/2849613 I would like to get a little bit more information about best practices with microservices on Heroku. The question is which approach is better? Install every services as independent app, and use one of them as REST "proxy" (for example Netflix Eureka)? Or Create docker based approach with, for example Netflix Zuul as a load balancer? On my own I see already some pros and cons of both approaches: Pros : better scalability (easy to create new machines for bigger load). Cons : communication between services goes "outside of

Register multiple Instances of a Spring Boot Eureka Client from a single host

痞子三分冷 提交于 2019-12-04 04:16:25
UPDATE The README in this repo has been updated to demonstrate the solution in the accepted answer. I'm working with a simple example of a Spring Boot Eureka service registration and discovery based on this guide . If I start up one client instance, it registers properly, and it can see itself through the DiscoveryClient . If I start up a second instance with a different name, it works as well. But if I start up two instances with the same name, the dashboard only shows 1 instance running, and the DiscoveryClient only shows the second instance. When I kill the 2nd instance, the 1st one is

How to mock Eureka when doing Integration Tests in Spring?

妖精的绣舞 提交于 2019-12-04 03:46:56
I am running a simple Junit Testing a Controller in Spring Boot. The test code looks like this: @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = {FrontControllerApplication.class}) @WebAppConfiguration @ComponentScan @IntegrationTest({"server.port:0", "eureka.client.registerWithEureka:false", "eureka.client.fetchRegistry:false"}) @ActiveProfiles("integrationTest") public class MyControllerIT { In the application-integrationTest.properties I have the following Eureka Settings: ####### Eureka eureka.serviceUrl.default=http://localhost:8767/eureka/ eureka

Ribbon with Spring Cloud and Eureka: java.lang.IllegalStateException: No instances available for Samarths-MacBook-Pro.local

馋奶兔 提交于 2019-12-04 01:18:29
I am working on Spring Boot Eureka Client Application with Ribbon Load Balancer. I have two instances of the server registered with Eureka with the name "TEST". On the client side, I have the following code to fetch the server from Eureka. @Configuration @ComponentScan @EnableAutoConfiguration @EnableEurekaClient @RestController public class EurekaConsumerApplication { @Autowired DiscoveryClient discoveryClient; @Autowired RestTemplate restTemplate; @RequestMapping(value = "/",method = RequestMethod.GET) String consumer(){ InstanceInfo instance = discoveryClient.getNextServerFromEureka("TEST",

Netflix Eureka and 2 instances of application on local environment

余生颓废 提交于 2019-12-03 20:37:12
I'm getting started with Netflix Eureka and using its 1.1.145 ( https://github.com/Netflix/eureka/tree/1.1.145 ) version. I want to start locally 2 instances of the same application on different ports and have them both registered with Eureka. I'm using sample service ( https://github.com/Netflix/eureka/blob/1.1.145/eureka-server/conf/sampleservice/sample-eureka-service.properties ) So I start Eureka itself and 2 instances using above config - one app on 8001 port and another on 8002. For some reason I'm getting only one instance registered with Eureka at any given time. Both of them start

Can Zuul Edge Server be used without Eureka / Ribbon

有些话、适合烂在心里 提交于 2019-12-03 12:27:40
问题 We have an infrastructure with service discovery and load balancing (i.e. server side with STM and weblogic cluster). Now we are in the process of refactoring into micro-services. We would need an API gateway which does basic routing to other microservices. Netflix Zuul looks a good candidate however I could not get Zuul working without Eureka - but we do not need Eureka since we already have service discovery and load balancing in place. Is it possible to use Zuul without Eureka and Ribbon?

How to route in between microservices using Spring Cloud & Netflix OSS

强颜欢笑 提交于 2019-12-03 03:13:32
问题 During our development of microservices using Spring Cloud, we started out using Zuul as a proxy for any connection from the outside to microservices, and for any microservice needing to contact another microservice. After some time we made the conclusion that Zuul was designed to be an edge service (only proxying traffic from the outside to the microservices), and shouldn't be used for intermicroservices communication. Especially the way Spring Cloud recommends the use of eureka to make a

Eureka Server: How to achieve high availability

会有一股神秘感。 提交于 2019-12-03 02:42:56
问题 I'm new to spring cloud. I've read this doc and it says the client application must specify a service url: eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ But what if localhost:8761 goes down? 回答1: Eureka Discovery Server should be used in the Peer-Aware config mode in production setups. Check: http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_peer_awareness For instance your first eureka server instance will have config like this: server: port: 1111 eureka:

Can Zuul Edge Server be used without Eureka / Ribbon

北慕城南 提交于 2019-12-03 01:57:49
We have an infrastructure with service discovery and load balancing (i.e. server side with STM and weblogic cluster). Now we are in the process of refactoring into micro-services. We would need an API gateway which does basic routing to other microservices. Netflix Zuul looks a good candidate however I could not get Zuul working without Eureka - but we do not need Eureka since we already have service discovery and load balancing in place. Is it possible to use Zuul without Eureka and Ribbon? If yes please provide some guild-lines since the there's no mention about in the wiki. Thanks. Yes, it

Use Eureka despite having random external port of docker containers

懵懂的女人 提交于 2019-12-02 22:42:21
I am writing an application that is composed of a few spring boot based microservices with a zuul based reverse proxy in the front- It works when I start the services on my machine, but for server rollout I'd like to use docker for the services, but this seems not to be possible right now. Normally you would have a fixed "internal" port and randomized ports at the outside of the container. But the app in the container doesn't know the outside port (and IP). The Netflix tools match what I would want to write an efficient microservice architecture and conceptually I really like docker. As far as