docker-machine-driver-scaleway
docker-machine-driver-scaleway copied to clipboard
Update cluster example for Swarm Mode
The Swarm example doesn't seem to support "Swarm Mode":
https://github.com/scaleway/docker-machine-driver-scaleway/blob/master/examples/start-swarm-cluster.sh
Would you be able to update it? Does the driver already support the new mode?
Alex
I could not create a cluster with public adresses but it's working using private adresses.
Using the CLI and docker-machine for scw it's solid. Here is how I do it:
docker-machine create -d scaleway \
--scaleway-region="par1" \
--scaleway-image="3803a8a7" \
--scaleway-token="123123123" \
--scaleway-organization="123123123" \
--scaleway-commercial-type="VC1S" \
--swarm \
--scaleway-name="N01-PAR1" N01-PAR1
3803a8a7 is the docker image
It's good to know the second name is used by the docker-machine driver.
Actually, more I'm thinking about it ...
We don't need --swarm as it makes more sense to go with the Docker Swarm Mode.
Create your nodes and then run this on your manager:
# scaleway (private address)
IP_N01=$(ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
echo "On the manager run: docker swarm init --advertise-addr=$IP_N01"
@alexellis I don't think it's docker-machine's job to create a cluster.
The script above no longer seems to work; quite a few fails throughout:
sh start-swarm-cluster.sh
- docker-machine create -d scaleway --swarm --swarm-master --scaleway-name=swarm-manager --swarm-discovery=token://my-token swarm-manager
- docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-1 --swarm-discovery=token://my-token swarm-node-1
- docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-2 --swarm-discovery=token://my-token swarm-node-2
- docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-3 --swarm-discovery=token://my-token swarm-node-3 Running pre-create checks... Running pre-create checks... Creating machine... Creating machine... (swarm-manager) Creating SSH key... (swarm-node-1) Creating SSH key... Running pre-create checks... Creating machine... (swarm-node-2) Creating SSH key... Running pre-create checks... Creating machine... (swarm-node-3) Creating SSH key... (swarm-node-2) Creating server... (swarm-node-1) Creating server... (swarm-node-3) Creating server... (swarm-manager) Creating server... Error creating machine: Error in driver during machine creation: {"message": "Internal error", "type": "server_error"} Error creating machine: Error in driver during machine creation: {"message": "Internal error", "type": "server_error"} (swarm-node-2) Starting server... Waiting for machine to be running, this may take a few minutes... (swarm-manager) Starting server... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(systemd)... Installing Docker... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(systemd)... Installing Docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Copying certs to the local machine directory... Error creating machine: Error running provisioning: ssh command error: command : sudo systemctl -f start docker err : exit status 1 output : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Error creating machine: Error running provisioning: ssh command error: command : sudo systemctl -f start docker err : exit status 1 output : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
The docs are for pre docker engine 1.12. As of 1.12 docker swarm behaves differently and does not appear to require an external service like consul or etcd to manage distributed configurations.