We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaae438 commit 6f80c1eCopy full SHA for 6f80c1e
shell/start_consul_by_docker.sh
@@ -0,0 +1,19 @@
1
+#!/bin/sh
2
+
3
+function start_consul(){
4
+ docker run --name consul1 -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600 consul:latest agent -server -bootstrap-expect 2 -ui -bind=0.0.0.0 -client=0.0.0.0
5
+ consul1_addr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' consul1)
6
+ for((i=1;i<=10;i++));
7
+ do
8
+ port=$((8500+$i))
9
+ docker run --name consul${i} -d -p ${port}:8500 consul agent -server -ui -bind=0.0.0.0 -client=0.0.0.0 -join ${consul1_addr}
10
+ done
11
+}
12
13
+function check_consul(){
14
+ docker ps | grep "consul" | grep -v grep
15
+ docker exec -it consul1 "consul members"
16
17
18
+start_consul
19
+check_consul
0 commit comments