Giter Site home page Giter Site logo

yidongnan / spring-cloud-consul-example Goto Github PK

View Code? Open in Web Editor NEW
178.0 19.0 95.0 1017 KB

spring-cloud-consul-example is an example for microservices system

License: MIT License

Java 97.52% Shell 2.48%
spring-cloud-consul spring-cloud-sleuth spring-boot-admin zipkin swagger microservice docker

spring-cloud-consul-example's People

Contributors

yidongnan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-cloud-consul-example's Issues

Making the Consul Instance ID Unique

默认的instanceId是${spring.application.name}-${server.port},则向consul注册服务时的serviceId是service:${spring.application.name}-${server.port}
当 service 部署多个实例在某些容器平台时(port往往一致),会导致serviceId重复而只能注册最后一个服务。

可以通过添加以下配置避免这个问题:

spring.cloud.consul.discovery.instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}

consul 集群时,yml文件如何配置?

如题,

spring:
  cloud:
    consul:
      discovery:
        prefer-ip-address: true
      host: 127.0.0.1
      port: 8500

当consul 为集群时,yml文件如何配置?看目前这个配置文件,只支持单点的

求教,谢谢

微服务启动后向docker部署的consul注册时,注册没有成功

查看服务的启动日志:
Registering service with consul: NewService{ "id":"dashboard-hystrix-docker-8050", "name":"dashboard-hystrix", "tags":[], "address":"10.42.208.133", "port":8050, "check":{ "script":"null", "interval":10, "ttl":null, "http":"http://10.42.208.133:8050/health", "tcp":null, "timeout":null } }
没有报异常,但是在consul上没有发现该服务。。。

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.