2016-11-02 92 views
0

我可以访问这样的成才到微服务访问微服务http://localhost:8080/ 呼叫到微服务是一样的东西:http://localhost:8761/name-service/ 难道是更多钞票? 当我打开尤里卡服务器的服务注册。通过尤里卡服务器

尤里卡/ application.properties:

server.port=8761 
eureka.client.register-with-eureka=false 
eureka.client.fetch-registry=false 
logging.level.com.netflix.eureka=OFF 
logging.level.com.netflix.discovery=OFF 

名称服务/ application.properties中

spring.application.name=name-service 
server.port=8080 

我怎样才能做到这一点?

+1

号尤里卡是一个服务注册表,而不是代理。如果我理解正确,你想要的是Zuul:https://github.com/Netflix/zuul – dunni

回答

0

我构建了zulu服务器。 当我把application.properties

zuul.routes.name-service.url=http://localhost:8888 
ribbon.eureka.enabled=true 
server.port=8080 

的作品。

如何连接以从尤里卡注册表读取数据? 我试过这样,但没有工作

zuul.routes.name-service.path=/name-service/** 
zuul.routes.name-service.serviceId=name-service 
eureka.client.serviceUrl.defaultZone=http://localhost:8761 
+0

我建议你从这里开始。 https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka。这是Josh Long的一篇很好的文章 –

相关问题