vmware-archive / vsphere-storage-for-docker

vSphere Storage for Docker
https://vmware.github.io/vsphere-storage-for-docker
Apache License 2.0
251 stars 95 forks source link

Script to setup swarm cluster for vFile [SKIP CI] #2028

Closed lipingxue closed 6 years ago

lipingxue commented 6 years ago

Fixed #1989

This change includes:

  1. scripts to setup swarm cluster
  2. sample configuration file
  3. corresponding document update

Test: Setup a Swarm cluster with the following configuration (5 node cluster, and 3 manager node)

5
3
10.161.101.247
10.161.98.108
10.161.121.202
10.161.103.9
10.161.120.96
~$ ./vfile-swarm-setup.sh vfile-swarm-config.txt
NODE_COUNT  5
MGR_COUNT 3
IP_COUNT 5
Swarm Cluster Setup Start
======> Initializing first swarm manager ...
Swarm initialized: current node (uxjj0pyj4ihgh0pholgbxyl0x) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-5ns9eimyctvqrygj5vc3jc4ly6vlxeefabnr9awl6eq70vy1he-7qf0y4gs60eoxyghzm1omyrdx 10.161.101.247:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

Manager Token:     docker swarm join --token SWMTKN-1-5ns9eimyctvqrygj5vc3jc4ly6vlxeefabnr9awl6eq70vy1he-2woxasvp9o78hchikjmc3h4hx 10.161.101.247:2377
Workder Token:     docker swarm join --token SWMTKN-1-5ns9eimyctvqrygj5vc3jc4ly6vlxeefabnr9awl6eq70vy1he-7qf0y4gs60eoxyghzm1omyrdx 10.161.101.247:2377
======> Add other manager nodes
node with IP 10.161.98.108 joins swarm as a Manager
This node joined a swarm as a manager.
node with IP 10.161.121.202 joins swarm as a Manager
This node joined a swarm as a manager.
======> Add worker nodes
node with IP 10.161.103.9 joins swarm as a Worker
This node joined a swarm as a worker.
node with IP 10.161.120.96 joins swarm as a Worker
This node joined a swarm as a worker.
ID                            HOSTNAME                   STATUS              AVAILABILITY        MANAGER STATUS
3a287srqd2as2rgpjf8798chi     sc-rdops-vm18-dhcp-57-89   Ready               Active
nblusvsz8nhpxmgw6ivnp8r3l     sc-rdops-vm18-dhcp-57-89   Ready               Active              Reachable
uxjj0pyj4ihgh0pholgbxyl0x *   sc-rdops-vm18-dhcp-57-89   Ready               Active              Leader
wnfbki9toif22wto62m1yn36q     sc-rdops-vm18-dhcp-57-89   Ready               Active              Reachable
zmzw1fh6b8ma2vphvsk9i4uzp     sc-rdops-vm18-dhcp-57-89   Ready               Active
Swarm Cluster Setup Complete
shuklanirdesh82 commented 6 years ago

adding [SKIP CI] kw, no need to invoke CI.

@lipingxue can you please make sure to have [SKIP CI] while merging this PR to master.

lipingxue commented 6 years ago

@luomiao @shuklanirdesh82 Please review this PR, thanks!

luomiao commented 6 years ago

Seems the sample config file need to be updated. Also L16 in vfile-swarm-setup.sh should be removed. Otherwise looks good to me.

lipingxue commented 6 years ago

@luomiao @shuklanirdesh82 I have addressed your comments, please review it.