Tag: 弹簧云

Springboot客户端无法使用Docker容器标识向Eureka注册

我有几个在Docker数据中心运行的微服务。 我在服务/应用程序中拥有相同的Eurekaconfiguration。 但有些应用程序正在使用它们的eth0 IP地址而不是容器ID进行注册。 我已经尝试将preferIpAddress设置为false但不是一直执行。 没有模式。 在之前的部署过程中注册到容器标识的相同服务在另一个时间被注册到IP。 我希望我的服务始终注册其容器ID。 有没有办法强制执行或我错过了什么? 注意:我也清除了registry,部署节点中的所有旧的docker镜像,并从头开始尝试。 尤里卡服务器configuration: eureka: instance: hostname: discovery client: registerWithEureka: false fetchRegistry: false serviceUrl: defaultZone: http://${eureka.instance.hostname}:8761/eureka/ 微服务客户端configuration(所有的微服务都是一样的) eureka: client: healthcheck: enabled: true serviceUrl: defaultZone: http://discovery:8761/eureka/ instance: preferIpAddress: false metadataMap: instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${random.value}}} 尤里卡仪表板快照: