-
-
Save funkytaco/d0a3eae3551ee3b87793 to your computer and use it in GitHub Desktop.
Install Consul on CentOS 7 AMD64
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
{ | |
"server": true, | |
"rejoin_after_leave": true, | |
"enable_syslog": false, | |
"syslog_facility": "local5", | |
"data_dir": "/var/consul/data", | |
"ui_dir": "/var/consul/ui", | |
"datacenter": "dc1", | |
"statsd_addr": "<some IP>:8125", | |
"recursor": "<some IP>" | |
} |
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
#consul history | |
[root@doc8app1 ~]# history|grep consul | |
105 rpm -ivh https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip | |
107 wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip | |
111 consul | |
112 ./consul | |
113 mv consul /usr/bin | |
114 mv /usr/bin/consul /usr/local/bin/ | |
115 mkdir -p /var/lib/consul | |
116 mkdir -p /usr/share/consul | |
117 mkdir -p /etc/consul/conf.d | |
118 curl -OL https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip | |
120 mv dist /usr/share/consul/ui | |
123 yum search consul | |
124 consul agent | |
125 consul agent /var/lib/consul | |
126 consul agent --data-dir=/var/lib/consul | |
127 consul agent --ui-dir=/usr/share/consul/ui & | |
128 consul agent --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui & | |
129 consul agent --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -bind=0.0.0.0 & | |
132 consul agent --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -bind=0.0.0.0 & | |
134 consul agent --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -bind=10.165.41.47 & | |
136 consul agent -h | grep client | |
137 consul agent --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -client=10.165.41.47 & | |
140 consul agent -server --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -client=10.165.41.47 & | |
142 consul agent -server --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -client=10.165.41.47 & | |
144 consul agent -server -bootstrap-expect 1 --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -client=10.165.41.47 & | |
146 ps -ef|grep consul | |
149 consul_members.sh | |
150 consul members | |
160 dig @127.0.0.1 -p 8600 web.service.consul SRV |
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
#!/bin/bash | |
yum install -y curl unzip | |
mkdir -p /var/lib/consul | |
mkdir -p /usr/share/consul | |
mkdir -p /etc/consul/conf.d | |
curl -OL https://dl.bintray.com/mitchellh/consul/0.3.1_linux_amd64.zip | |
unzip 0.3.1_linux_amd64.zip | |
mv consul /usr/local/bin/consul | |
curl -OL https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip | |
unzip 0.3.1_web_ui.zip | |
mv dist /usr/share/consul/ui |
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-machine create -d virtualbox consul-1 | |
docker-machine create -d virtualbox consul-2 | |
HOSTA=$(docker-machine ip consul-1) | |
HOSTB=$(docker-machine ip consul-2) | |
eval $(docker-machine env consul-1) | |
docker run -d --name consul -h consul-1 \ | |
-p 8300:8300 -p 8301:8301 -p 8301:8301/udp \ | |
-p 8302:8302/udp -p 8400:8400 -p 8500:8500 \ | |
-p 172.17.42.1:53:8600/udp \ | |
gliderlabs/consul agent -data-dir /data -server \ | |
-client 0.0.0.0 \ | |
-advertise $HOSTA -bootstrap-expect 2 | |
eval $(docker-machine env consul-2) | |
docker run -d --name consul -h consul-2 \ | |
-p 8300:8300 -p 8301:8301 -p 8301:8301/udp \ | |
-p 8302:8302/udp -p 8400:8400 -p 8500:8500 \ | |
-p 172.17.42.1:53:8600/udp \ | |
gliderlabs/consul agent -data-dir /data -server \ | |
-client 0.0.0.0 \ | |
-advertise $HOSTB -join $HOSTA | |
#check for members | |
docker exec consul consul members | |
Node Address Status Type Build Protocol DC | |
consul-1 192.168.99.101:8301 alive server 0.5.2 2 dc1 | |
consul-2 192.168.99.102:8301 alive server 0.5.2 2 dc1 |
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
consul members |
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
#http://www.maori.geek.nz/docker_web_services_with_consul/ | |
docker run -it -h node -p 8500:8500 -p 8600:53/udp progrium/consul -server -bootstrap -advertise $(docker-machine ip default) |
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
consul agent --data-dir=/var/lib/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
#For a single Consul server - bootstrap expect | |
consul agent -server -bootstrap-expect 1 --data-dir=/var/lib/consul --ui-dir=/usr/share/consul/ui -client=10.165.41.47 & |
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
#Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto | |
https://www.youtube.com/watch?v=zi89DZiWfqg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment