Created
October 22, 2017 05:57
-
-
Save BlinkyStitt/920f058c831478ac66cc8ff14f63f226 to your computer and use it in GitHub Desktop.
zerotier 6PLANE, docker, and consul
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you need to set ZT6PLANE to match your network | |
version: '2.3' | |
networks: | |
zerotier: | |
driver: bridge | |
enable_ipv6: true | |
internal: false | |
ipam: | |
config: | |
- subnet: $ZT6PLANE::/80 | |
volumes: | |
zerotier_var: | |
consul_data_a: | |
consul_data_b: | |
consul_data_c: | |
services: | |
zerotier: | |
image: zerotier/zerotier-containerized | |
devices: | |
- /dev/net/tun | |
network_mode: host | |
cap_add: | |
- NET_ADMIN | |
- SYS_ADMIN | |
volumes: | |
- zerotier_var:/var/lib/zerotier-one/ | |
consul_a: | |
image: consul:1.0.0 | |
hostname: consul-a | |
command: | |
agent | |
-bind=$ZT6PLANE::1234:a | |
-bootstrap-expect=3 | |
-recursor=127.0.0.11 | |
-server | |
-ui | |
networks: | |
zerotier: | |
ipv6_address: $ZT6PLANE::1234:a | |
expose: # https://www.consul.io/docs/agent/options.html#ports-used | |
- "8300/tcp" # server RPC | |
- "8301/tcp" # serf LAN | |
- "8301/udp" # serf LAN | |
- "8302/tcp" # serf WAN | |
- "8302/udp" # serf WAN | |
- "8500/tcp" # http | |
volumes: | |
- consul_data_a:/consul/data | |
consul_b: | |
image: consul:1.0.0 | |
hostname: consul-b | |
command: | |
agent | |
-bind=$ZT6PLANE::1234:b | |
-bootstrap-expect=3 | |
-recursor=127.0.0.11 | |
-retry-join [$ZT6PLANE::1234:a] -retry-join [$ZT6PLANE::1234:c] | |
-server | |
networks: | |
zerotier: | |
ipv6_address: $ZT6PLANE::1234:b | |
expose: # https://www.consul.io/docs/agent/options.html#ports-used | |
- "8300/tcp" # server RPC | |
- "8301/tcp" # serf LAN | |
- "8301/udp" # serf LAN | |
- "8302/tcp" # serf WAN | |
- "8302/udp" # serf WAN | |
volumes: | |
- consul_data_b:/consul/data | |
consul_c: | |
image: consul:1.0.0 | |
hostname: consul-c | |
command: | |
agent | |
-bind=$ZT6PLANE::1234:c | |
-bootstrap-expect=3 | |
-recursor=127.0.0.11 | |
-retry-join [$ZT6PLANE::1234:a] -retry-join [$ZT6PLANE::1234:b] | |
-server | |
networks: | |
zerotier: | |
ipv6_address: $ZT6PLANE::1234:c | |
expose: # https://www.consul.io/docs/agent/options.html#ports-used | |
- "8300/tcp" # server RPC | |
- "8301/tcp" # serf LAN | |
- "8301/udp" # serf LAN | |
- "8302/tcp" # serf WAN | |
- "8302/udp" # serf WAN | |
volumes: | |
- consul_data_c:/consul/data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On my docker-for-mac install, this works as expected.
On my Fedora install with Firewalld and a similar docker-compose file (but with vault and a few other things), I get these errors with
docker logs -f shared_consul-a_1
:If I run
consul members
the other nodes flap between alive and failed. It must be something with firewalld. From my laptop nmap shows 8300 open on all these hosts, but between each other it shows as stealth.A google search for
getsockopt: permission denied
doesn't even return a full page of results. I might just ditch Fedora but I'd like to figure this out.