Last active
July 15, 2018 18:22
-
-
Save Darkflib/3e1567ac154a6e9ec2c94db1251743ff to your computer and use it in GitHub Desktop.
consul in docker
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
| docker run -d --restart unless-stopped --name consul --net=host -v consul:/consul/data \ | |
| -e CONSUL_BIND_INTERFACE=wg0 -e 'CONSUL_LOCAL_CONFIG={"datacenter":"nbg", "leave_on_terminate": true}' \ | |
| consul agent -retry-join=10.88.88.3 -retry-join=10.88.88.5 -retry-join=10.88.88.7 |
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
| root@nbg03:~# docker exec -t consul consul members | |
| Node Address Status Type Build Protocol DC Segment | |
| nbg03 10.88.88.3:8301 alive server 1.2.1 2 nbg <all> | |
| nbg05 10.88.88.5:8301 alive server 1.2.1 2 nbg <all> | |
| nbg07 10.88.88.7:8301 alive server 1.2.1 2 nbg <all> |
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
| docker volume create consul | |
| docker run -d --restart unless-stopped --name=consul \ | |
| --network host -e CONSUL_LOCAL_CONFIG='{ "datacenter":"nbg", "server":true, "enable_debug":true }' \ | |
| -v consul:/consul/data -e CONSUL_BIND_INTERFACE=wg0 -e CONSUL_CLIENT_INTERFACE=docker0 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
| docker volume create consul | |
| docker run -d --restart unless-stopped --name=consul \ | |
| --network host -e CONSUL_LOCAL_CONFIG='{ "datacenter":"nbg", "server":true, "enable_debug":true }' \ | |
| -v consul:/consul/data -e CONSUL_BIND_INTERFACE=wg0 -e CONSUL_CLIENT_INTERFACE=docker0 consul agent -join 10.88.88.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment