docker run -d -p 8500:8500 --name=consul progrium/consul -server -bootstrap
#Create Swarm cluster
#debug
docker run -d -p 4000:4000 swarm --debug manage -H :4000 --replication --advertise 192.168.13.159:4000 consul://192.168.13.159:8500docker run -d -p 5000:4000 swarm manage -H :5000 --replication --advertise 192.168.13.159:5000 consul://192.168.13.159:8500
docker run -d -p 6000:4000 swarm manage -H :6000 --replication --advertise 192.168.13.159:6000 consul://172.30.0.161:8500
#add a node
docker run -d swarm --debug join --advertise=192.168.13.159:2375 consul://192.168.13.159:8500
# use the regular docker cli
$ docker -H tcp://<swarm_ip:swarm_port> info
$ docker -H tcp://<swarm_ip:swarm_port> run ...
$ docker -H tcp://<swarm_ip:swarm_port> ps
$ docker -H tcp://<swarm_ip:swarm_port> logs ...
$ docker -H tcp://<swarm_ip:swarm_port> network ls
...
# list nodes in your cluster
$ docker run --rm swarm list token://<cluster_id>
No comments:
Post a Comment