2014-12-19 34 views
3

我已经在端口8761上运行的服务器尤里卡(本地主机:8761 /尤里卡),我有一个Zuul应用程序,我想与尤里卡注册,但我不断收到同样的错误:尤里卡 - 无法得到回应 - 无法联系任何尤里卡节点

Can't get a response from http://localhost:8761/eurekaapps/ZUULSERVER 
Can't contact any eureka nodes - possibly a security group issue? 

java.lang.RuntimeException: Bad status: 404 
     at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155) 
     at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060) 
     at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606) 
     at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:745) 

这里是我的zuul应用application.yml:

info: 
    component: Zuul Server 

eureka: 
    server: 
    enabled: true 
    client: 
    serviceUrl: 
     defaultZone: http://localhost:8761/eureka 
    registerWithEureka: true 
    fetchRegistry: false 

endpoints: 
    restart: 
    enabled: true 
    shutdown: 
    enabled: true 
    health: 
    sensitive: false 

zuul: 
    route: 
    discovery: 
     url: http://localhost:9000/polaris/discovery 
     path: /polaris/discovery/** 
    sla: 
     url: http://localhost:9000/polaris/sla 
     path: /polaris/sla/** 
    stores: /stores/** 
    customers: /customers/** 

#remove when spring-boot 1.2.1 is out 
security: 
    basic: 
    enabled: false 
management: 
    security: 
    enabled: 
     false 

server: 
    port: 8765 

logging: 
    level: 
    ROOT: INFO 
    org.springframework.web: DEBUG 

我刚才弄乱这些值之一,因此zuul是无法看到的尤里卡服务器?它似乎没有正确注册。也许我错过了application.yml文件中的一个关键参数?

回答

8

错误中的线索是“eurekaapps”。您需要在服务网址中追踪“/”:

eureka: 
    client: 
    serviceUrl: 
     defaultZone: http://localhost:8761/eureka/ 

(这是我认为的默认值)。

+0

我正在读出定时例外。虽然在首次得到与尤里卡服务器注册,但那么它无法发送心跳服务器说法超时。 – agpt

+0

远程eureka客户端抛出读取超时异常,指出无法从“http://192.168.1.12:8761/eureka/apps/USERSERVICE/dev39.local:userservice:8181”获取响应。但是当我在浏览器中点击这个网址,我得到该主机的响应。可能的问题是什么? – agpt

+0

@agpt你有没有发现这方面的任何决议案? –