Skip to content

Instantly share code, notes, and snippets.

@holms
Last active April 26, 2017 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holms/4f73f35f326e4e725a989d3df2e90606 to your computer and use it in GitHub Desktop.
Save holms/4f73f35f326e4e725a989d3df2e90606 to your computer and use it in GitHub Desktop.

Creating scaleway vms from Makefile

scaleway:
        -docker-machine create -d scaleway \
                --scaleway-token= \
                --scaleway-organization= \
                --scaleway-name="swarm-primary" \
                --scaleway-region=ams1 \
                --scaleway-commercial-type=C2S \
                scale-primary
        -docker-machine create -d scaleway \
                --scaleway-token=\
                --scaleway-organization= \
                --scaleway-name="swarm-master01" \
                --scaleway-region=par1 \
                --scaleway-commercial-type=C2S \
                scale-master01
        -docker-machine create -d scaleway \
                --scaleway-token= \
                --scaleway-organization= \
                --scaleway-name="swarm-master02" \
                --scaleway-region=ams1 \
                --scaleway-commercial-type=C2S \
                scale-master02

Joining swarm

$ docker-machine ssh scale-primary docker swarm init
Swarm initialized: current node (m6vxnw4je8ke9wd2mduaz372e) is now a manager.

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

    docker swarm join \
    --token SWMTKN-1-11r0uo4bie0ehx4zid4j8hojrlm3gphf72tw4ajaueajqq77ew-f3ps5g3zt9rcl0ssz73hso4ps \
    10.6.29.97:2377

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

$ docker-machine ssh scale-master01 docker swarm join --token $(docker-machine ssh scale-primary docker swarm join-token manager -q) $(docker-machine ip scale-primary):2377
This node joined a swarm as a manager.
$ docker-machine ssh scale-master02 docker swarm join --token $(docker-machine ssh scale-primary docker swarm join-token manager -q) $(docker-machine ip scale-primary):2377
Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the "docker info" command to see the current swarm status of your node.
exit status 1

Public ip's

$ docker-machine ip scale-primary
51.15.52.36
$ docker-machine ip scale-master01
163.172.191.123
$ docker-machine ip scale-master02
51.15.37.201

Private ip's

$ docker-machine ssh scale-primary ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:07:cb:0b:2a:e5  
          inet addr:10.6.29.97  Bcast:10.255.255.255  Mask:255.255.255.254
          inet6 addr: fe80::207:cbff:fe0b:2ae5/64 Scope:Link
$ docker-machine ssh scale-master01 ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:07:cb:0b:45:7d  
          inet addr:10.5.70.33  Bcast:10.255.255.255  Mask:255.255.255.254
          inet6 addr: fe80::207:cbff:fe0b:457d/64 Scope:Link

$ docker-machine ssh scale-master02 ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:07:cb:0b:29:25  
          inet addr:10.6.28.237  Bcast:10.255.255.255  Mask:255.255.255.254
          inet6 addr: fe80::207:cbff:fe0b:2925/64 Scope:Link

Incoming scale-primary.

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
21:56:19.647686 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [S], seq 1653631549, win 29200, options [mss 1460,sackOK,TS val 2736722664 ecr 0,nop,wscale 7], length 0
21:56:19.647748 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [S.], seq 2990431002, ack 1653631550, win 28960, options [mss 1460,sackOK,TS val 3082746900 ecr 2736722664,nop,wscale 7], length 0
21:56:19.647927 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 1, win 229, options [nop,nop,TS val 2736722664 ecr 3082746900], length 0
21:56:19.648193 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 1:146, ack 1, win 229, options [nop,nop,TS val 2736722664 ecr 3082746900], length 145
21:56:19.648216 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [.], ack 146, win 235, options [nop,nop,TS val 3082746900 ecr 2736722664], length 0
21:56:19.648736 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 1:853, ack 146, win 235, options [nop,nop,TS val 3082746900 ecr 2736722664], length 852
21:56:19.648861 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 853, win 242, options [nop,nop,TS val 2736722664 ecr 3082746900], length 0
21:56:19.650276 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 146:284, ack 853, win 242, options [nop,nop,TS val 2736722664 ecr 3082746900], length 138
21:56:19.650813 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 853:904, ack 284, win 243, options [nop,nop,TS val 3082746901 ecr 2736722664], length 51
21:56:19.650894 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 904:942, ack 284, win 243, options [nop,nop,TS val 3082746901 ecr 2736722664], length 38
21:56:19.650916 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 942:984, ack 284, win 243, options [nop,nop,TS val 3082746901 ecr 2736722664], length 42
21:56:19.651063 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 284:337, ack 904, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 53
21:56:19.651091 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 337:375, ack 904, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 38
21:56:19.651102 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 375:417, ack 904, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 42
21:56:19.651323 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 984, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 0
21:56:19.651546 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 417:604, ack 984, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 187
21:56:19.651916 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 1022:1074, ack 604, win 252, options [nop,nop,TS val 3082746901 ecr 2736722664], length 52
21:56:19.651961 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 1074:1674, ack 604, win 252, options [nop,nop,TS val 3082746901 ecr 2736722664], length 600
21:56:19.652062 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 1674:1736, ack 604, win 252, options [nop,nop,TS val 3082746901 ecr 2736722664], length 62
21:56:19.652066 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 1074, win 242, options [nop,nop,TS val 2736722664 ecr 3082746901], length 0
21:56:19.652328 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 1736, win 255, options [nop,nop,TS val 2736722664 ecr 3082746901], length 0
21:56:19.653165 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [P.], seq 604:635, ack 1736, win 255, options [nop,nop,TS val 2736722664 ecr 3082746901], length 31
21:56:19.653236 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [P.], seq 1736:1767, ack 635, win 252, options [nop,nop,TS val 3082746901 ecr 2736722664], length 31
21:56:19.653266 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [F.], seq 1767, ack 635, win 252, options [nop,nop,TS val 3082746901 ecr 2736722664], length 0
21:56:19.653498 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [F.], seq 635, ack 1767, win 255, options [nop,nop,TS val 2736722665 ecr 3082746901], length 0
21:56:19.653520 IP 10.6.29.97.2377 > 51.15.37.201.55922: Flags [.], ack 636, win 252, options [nop,nop,TS val 3082746901 ecr 2736722665], length 0
21:56:19.653767 IP 51.15.37.201.55922 > 10.6.29.97.2377: Flags [.], ack 1768, win 255, options [nop,nop,TS val 2736722665 ecr 3082746901], length 0
21:56:19.656488 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [S], seq 1489306133, win 29200, options [mss 1460,sackOK,TS val 4103305270 ecr 0,nop,wscale 7], length 0
21:56:19.656536 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [S.], seq 1521313327, ack 1489306134, win 28960, options [mss 1460,sackOK,TS val 2647343114 ecr 4103305270,nop,wscale 7], length 0
21:56:19.656746 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [.], ack 1, win 229, options [nop,nop,TS val 4103305270 ecr 2647343114], length 0
21:56:19.656773 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 1:163, ack 1, win 229, options [nop,nop,TS val 4103305270 ecr 2647343114], length 162
21:56:19.656789 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [.], ack 163, win 235, options [nop,nop,TS val 2647343114 ecr 4103305270], length 0
21:56:19.657375 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 1:852, ack 163, win 235, options [nop,nop,TS val 2647343114 ecr 4103305270], length 851
21:56:19.657471 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [.], ack 852, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 0
21:56:19.659240 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 163:301, ack 852, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 138
21:56:19.659768 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 852:903, ack 301, win 243, options [nop,nop,TS val 2647343114 ecr 4103305270], length 51
21:56:19.659887 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 903:941, ack 301, win 243, options [nop,nop,TS val 2647343114 ecr 4103305270], length 38
21:56:19.659944 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 941:983, ack 301, win 243, options [nop,nop,TS val 2647343114 ecr 4103305270], length 42
21:56:19.660027 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 301:354, ack 903, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 53
21:56:19.660055 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 354:392, ack 903, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 38
21:56:19.660092 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [.], ack 392, win 243, options [nop,nop,TS val 2647343114 ecr 4103305270], length 0
21:56:19.660196 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 983:1021, ack 392, win 243, options [nop,nop,TS val 2647343114 ecr 4103305270], length 38
21:56:19.660267 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 392:434, ack 903, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 42
21:56:19.660284 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [.], ack 983, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 0
21:56:19.660297 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 434:1042, ack 983, win 242, options [nop,nop,TS val 4103305270 ecr 2647343114], length 608
21:56:19.660312 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [.], ack 1042, win 253, options [nop,nop,TS val 2647343114 ecr 4103305270], length 0
21:56:19.703495 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [.], ack 1021, win 242, options [nop,nop,TS val 4103305275 ecr 2647343114], length 0
21:56:24.656519 IP 51.15.37.201.55924 > 10.6.29.97.2377: Flags [P.], seq 1042:1073, ack 1021, win 242, options [nop,nop,TS val 4103305770 ecr 2647343114], length 31
21:56:24.656678 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [P.], seq 1021:1052, ack 1073, win 253, options [nop,nop,TS val 2647343614 ecr 4103305770], length 31
21:56:24.656724 IP 10.6.29.97.2377 > 51.15.37.201.55924: Flags [F.], seq 1052, ack 1073, win 253, options [nop,nop,TS val 2647343614 ecr 4103305770], length 0

Outgoing scale-master02

$ tcpdump -i eth0 -n dst host 51.15.52.36
21:47:25.944896 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [.], ack 852, win 242, options [nop,nop,TS val 3044267606 ecr 515207232], length 0
21:47:25.946801 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 162:300, ack 852, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 138
21:47:25.947695 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 300:353, ack 983, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 53
21:47:25.947745 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 353:391, ack 983, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 38
21:47:25.947767 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 391:433, ack 983, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 42
21:47:25.948020 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 433:471, ack 983, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 38
21:47:25.949258 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 471:1037, ack 1021, win 242, options [nop,nop,TS val 3044267607 ecr 515207232], length 566
21:47:30.943870 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [P.], seq 1037:1068, ack 1021, win 242, options [nop,nop,TS val 3044268106 ecr 515207232], length 31
21:47:30.944043 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [F.], seq 1068, ack 1021, win 242, options [nop,nop,TS val 3044268106 ecr 515207232], length 0
21:47:30.944132 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [R], seq 1318330270, win 0, length 0
21:47:30.944161 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [R], seq 1318330270, win 0, length 0
21:47:30.944327 IP 10.6.28.237.55920 > 51.15.52.36.2377: Flags [R], seq 1318330271, win 0, length 0

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