-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making the Consul Instance ID Unique #4
Comments
@conanca 感谢。但这个示例中不影响。
启动多台 service-a 时,每个服务对应的 ip 是不一样的。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
默认的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}}
The text was updated successfully, but these errors were encountered: