[1] Swarm discovery - Docker Documentation ( 版) <>

Using the hosted discovery service

# create a cluster

$ swarm create

6856663cdefdec325839a4b7e1de38e8 # <- this is your unique <cluster_id>

# on each of your nodes, start the swarm agent

# <node_ip> doesn't have to be public (eg. 192.168.0.X),

# as long as the swarm manager can access it.

$ swarm join --addr=<node_ip:2375> token://<cluster_id>

# start the manager on any machine or your laptop

$ swarm manage -H tcp://<swarm_ip:swarm_port> token://<cluster_id>