Eureka - cannot receive an answer - cannot contact eureka nodes

I have an Eureka server running on port 8761 (localhost: 8761 / eureka) and I have a Zuul application that I would like to register with eureka, but I keep getting the same error:

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)

      

Here is my application.yml for zuul application:

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

      

I just messed up one of these values โ€‹โ€‹and that's why zuul couldn't see the eureka server? It looks like it is not registering properly. Perhaps I missed a key parameter in the application.yml file?

+3


source to share


1 answer


The error means "eurekaapps". You need a trailing "/" in the service url:

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

      



(the default is the default).

+8


source







All Articles