2016-11-02 94 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的一篇很好的文章 –

相關問題