-
Notifications
You must be signed in to change notification settings - Fork 0
Swarm Setup
Swarm Cluster setup includes client side docker-machine, swarm cluster launching. The following steps illustrate how to deploy them.
Prepare:
- Download Openstack RC file and name is locally as spectrum-openrc.sh. You can find the file on your own openstack web at Project/Compute/Access & Security.
Steps:
-
Install docker machine client
Follow docker-machine link.
-
Create a swarm token and record it(say $swarm_id)
docker run swarm create
-
Launch VM's to swarm cluster(replace ${TOKEN} with
$swarm_id above and $ {USER} and ${passwd} with your own login credentials to the private docker registry)./add_new_agent.sh
It might ask for arguments like master/agent, agent names etc.
-
Set up environment to talk to the swarm master
append the following line in .bashrc
eval $(docker-machine env --swarm swarm-master)
FAQ
-
swarm master doesn't discover new nodes even if the remote discover server list it.
Check if the remote server has the new node config(replace $swarm_id with your own)
sudo docker run --rm swarm list token://$swarm_id
restart swarm master(replace $swarm_id with your own)
sudo docker kill swarm-agent-master
docker run -t -p 3376:3376 -v /etc/docker:/etc/docker --name="swarm-agent-master" -t swarm manage --tlsverify --tlscacert=/etc/docker/ca.pem --tlscert=/etc/docker/server.pem --tlskey=/etc/docker/server-key.pem -H tcp://0.0.0.0:3376 --strategy spread token://$swarm_id