DOCKER OVERLAY NETWORK consul 註冊

下載 consul 二進制包並啓動linux

wget https://releases.hashicorp.com/consul/0.9.2/consul_0.9.2_linux_amd64.zip
unzip consul_0.9.2_linux_amd64.zip
mv consul /usr/bin/consul && chmod +x /usr/bin/consul
nohup consul agent -server -bootstrap -ui -data-dir /var/lib/consul -client=192.168.1.198 -bind=192.168.1.198
&>/var/log/consul.log &docker

節點配置 docker 守護進程鏈接 consulbootstrap

vim /etc/default/dockervim

DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-store consul://172.16.120.34:8500 --cluster-advertise 172.16.120.34:2375"網絡

systemctl restart docker

建立overlay網絡tcp

docker network create -d overlay multi_host

測試互通ide

docker run -itd --net=multi_host busybox

相關文章
相關標籤/搜索