简体   繁体   English

如何在春季配置领事集群?

[英]How to config consul cluster in spring?

If there is only one consul node, it can config consul like following: 如果只有一个领事节点,则可以像下面这样配置领事:

spring: 弹簧:

cloud: consul: host: localhost port: 8500 云:领事:主机:本地主机端口:8500

But if there is consul cluster, for example there are three concul nodes. 但是,如果有领事群集,例如,有三个concul节点。 in this case, how to config the consul? 在这种情况下,如何配置领事? Do it need DNS to route the host name to multi IP address? 是否需要DNS才能将主机名路由到多IP地址?

you should run a consul agent in client mode on a node and join consul cluster. 您应该在节点上以客户端模式运行领事代理,并加入领事群集。 then run your spring boot instance on this node and connect to this consul agent. 然后在该节点上运行spring boot实例并连接到该领事代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM