Git Product home page Git Product logo

Comments (5)

javafreek avatar javafreek commented on September 26, 2024

If I understand your problem correct, it has to do with the containerID which is used as hostname which is not known?

I had something similar: DiscoveryClient registered my Service at Consul (Eureka would probably do the same) and gave the container id of the service to register itself with. The healthcheck then failed because both Consul as my service ran in different containers and they didn't know eachother through container ID's. I could not find a way to configure the discovery client to use the IP address instead of the host name (container id?).

from spring-cloud-microservice-example.

kbastani avatar kbastani commented on September 26, 2024

See spring-cloud/spring-cloud-netflix#432

Also try using this configuration for your services that are registering with Eureka:

eureka.instance.preferIpAddress=true

This is documented here: https://github.com/spring-cloud/spring-cloud-netflix/blob/a7398842078319dcaa353a708c12bb7b9fa85a4e/docs/src/main/asciidoc/spring-cloud-netflix.adoc#prefer-ip-address

from spring-cloud-microservice-example.

Dreampie avatar Dreampie commented on September 26, 2024

Oh,I config it https://github.com/Dreampie/cloud-config-repo/blob/master/application.yml,always not work

eureka:
  password: eureka
  client:
    serviceUrl:
      defaultZone: ${EUREKA_SERVER_URL:http://user:${eureka.password}@192.168.60.41:8761/eureka/}
  instance:
    preferIpAddress: true
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${EUREKA_INSTANCE_ID:${spring.application.name}:${spring.application.instance_id:${server.port:8080}}}

from spring-cloud-microservice-example.

kbastani avatar kbastani commented on September 26, 2024

@Dreampie You may want to consider adding a health indicator for your configuration service to make sure that the right config is being retrieved for your applications at startup: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_health_indicator

from spring-cloud-microservice-example.

Dreampie avatar Dreampie commented on September 26, 2024

thank you!

from spring-cloud-microservice-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.