Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cluster example for Swarm Mode #57

Open
alexellis opened this issue Oct 24, 2016 · 5 comments
Open

Update cluster example for Swarm Mode #57

alexellis opened this issue Oct 24, 2016 · 5 comments

Comments

@alexellis
Copy link

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

@pascalandy
Copy link

pascalandy commented Dec 6, 2016

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.

@pascalandy
Copy link

pascalandy commented Dec 6, 2016

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"

@pascalandy
Copy link

@alexellis I don't think it's docker-machine's job to create a cluster.

@chokosabe
Copy link

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.

@gardner
Copy link

gardner commented Aug 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants