{"id":577,"title":"docker\u4e2d\u90e8\u7f72consul\u96c6\u7fa4","good":0,"bad":0,"hit":2288,"created_at":"2023-01-24 08:17:19","content":"
\u8fd9\u662f\u5728window\u4e0b\u90e8\u7f72consul\u96c6\u7fa4\u7684yaml\u6587\u4ef6<\/p>
\u52a0\u7ea2\u90e8\u5206\uff1a<\/p>
\u76ee\u5f55\u5148\u5efa\u597d\uff0c\u7f51\u7edc\u540d\u6539\u4e3a\u81ea\u5df1\u7684\u5373\u53ef<\/p>
\u4e3b\u8981\u53c2\u6570\u8bf4\u660e\uff1a<\/p>
<\/p>
\u53c2\u6570\u540d\t<\/span>\u89e3\u91ca<\/p> -server\t<\/span>\u8bbe\u7f6e\u4e3a Server \u7c7b\u578b\u8282\u70b9\uff0c\u4e0d\u52a0\u5219\u4e3a Client \u7c7b\u578b\u8282\u70b9<\/p> -client\t<\/span>\u6ce8\u518c\u6216\u8005\u67e5\u8be2\u7b49\u4e00\u7cfb\u5217\u5ba2\u6237\u7aef\u5bf9\u5b83\u64cd\u4f5c\u7684IP\uff0c\u9ed8\u8ba4\u662f127.0.0.1<\/p> -bootstrap-expect\t<\/span>\u96c6\u7fa4\u671f\u671b\u7684 Server \u8282\u70b9\u6570\uff0c\u53ea\u6709\u8fbe\u5230\u8fd9\u4e2a\u503c\u624d\u4f1a\u9009\u4e3e Leader<\/p> -node\t<\/span>\u6307\u5b9a\u8282\u70b9\u540d\u79f0<\/p> -data-dir\t<\/span>\u6570\u636e\u5b58\u653e\u4f4d\u7f6e<\/p> -retry-join\t<\/span>\u6307\u5b9a\u8981\u52a0\u5165\u7684\u8282\u70b9\u5730\u5740\uff08\u7ec4\u5efa\u96c6\u7fa4\uff09<\/p> -ui\t<\/span>\u542f\u7528 UI \u754c\u9762<\/p> \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p> version: '3.4'<\/p> services:<\/p> consul-server1: image: consul<\/p> command: agent -server -client=0.0.0.0 -bootstrap-expect=3 -node=consul-server1 -data-dir=\/data<\/p> volumes:<\/p> - F:\/consul\/data\/server1<\/span>:\/data<\/p> consul-server2:<\/p> image: consul<\/p> command: agent -server -client=0.0.0.0 -retry-join=consul-server1 -node=consul-server2 -data-dir=\/data<\/p> volumes:<\/p> - F:\/consul\/data\/server2<\/span>:\/data<\/p> depends_on:<\/p> - consul-server1<\/p> consul-server3:<\/p> image: consul<\/p> command: agent -server -client=0.0.0.0 -retry-join=consul-server1 -node=consul-server3 -data-dir=\/data<\/p> volumes:<\/p> - F:\/consul\/data\/server3<\/span>:\/data<\/p> depends_on:<\/p> - consul-server1<\/p> consul-clicent1:<\/p> image: consul<\/p> command: agent -client=0.0.0.0 -retry-join=consul-server1 -ui -node=consul-client1 -data-dir=\/data<\/p> ports:<\/p> - 8500:8500<\/p> volumes:<\/p> - F:\/consul\/data\/client1<\/span>:\/data<\/p> depends_on:<\/p> - consul-server2<\/p> - consul-server3<\/p> networks:<\/p> default:<\/p> name: hurong_www_gitee_127.0.0.1<\/span> #\u4f7f\u7528laravel\u9879\u76ee\u4e2d\u751f\u6210\u7684\u7f51\u7edc<\/p> external: true #\u4f7f\u7528\u5df2\u5b58\u5728\u7684\u7f51\u7edc<\/p> #driver: bridge<\/p>
<\/p>
<\/p>
<\/p>
<\/p>"}