55# ./start_db_cluster.sh <dockerImage>
66
77# EXAMPLE:
8- # ./start_db_cluster.sh docker.io/arangodb/arangodb:3.6.2
8+ # ./start_db_cluster.sh docker.io/arangodb/arangodb:3.7.1
99
1010docker pull " $1 "
1111
@@ -20,25 +20,21 @@ AUTHORIZATION_HEADER=$(cat "$LOCATION"/jwtHeader)
2020echo " Starting containers..."
2121
2222docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.1.1 --name agent1 " $1 " arangodb --cluster.start-dbserver false --cluster.start-coordinator false --auth.jwt-secret /jwtSecret
23- sleep 1
2423docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.1.2 --name agent2 " $1 " arangodb --cluster.start-dbserver false --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret
25- sleep 1
2624docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.1.3 --name agent3 " $1 " arangodb --cluster.start-dbserver false --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret
27- sleep 1
2825
2926docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.2.1 --name dbserver1 " $1 " arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret
30- sleep 1
3127docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.2.2 --name dbserver2 " $1 " arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret
32- sleep 1
33- docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.2.3 --name dbserver3 " $1 " arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret
34- sleep 1
3528
3629docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.3.1 --name coordinator1 -p 8529:8529 " $1 " arangodb --cluster.start-dbserver false --cluster.start-coordinator true --starter.join agent1 --auth.jwt-secret /jwtSecret
37- sleep 1
3830docker run -d -v " $LOCATION " /jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY=" $ARANGO_LICENSE_KEY " --network arangodb --ip 172.28.3.2 --name coordinator2 " $1 " arangodb --cluster.start-dbserver false --cluster.start-coordinator true --starter.join agent1 --auth.jwt-secret /jwtSecret
39- sleep 1
4031
4132debug_container () {
33+ if [ ! " $( docker ps -aqf name=" $1 " ) " ]; then
34+ echo " $1 container not found!"
35+ exit 1
36+ fi
37+
4238 running=$( docker inspect -f ' {{.State.Running}}' " $1 " )
4339
4440 if [ " $running " = false ]
@@ -57,7 +53,6 @@ debug() {
5753 agent3 \
5854 dbserver1 \
5955 dbserver2 \
60- dbserver3 \
6156 coordinator1 \
6257 coordinator2 ; do
6358 debug_container $c
@@ -81,17 +76,16 @@ for a in 172.28.1.1:8531 \
8176 172.28.1.3:8531 \
8277 172.28.2.1:8530 \
8378 172.28.2.2:8530 \
84- 172.28.2.3:8530 \
8579 172.28.3.1:8529 \
8680 172.28.3.2:8529 ; do
8781 wait_server $a
8882done
8983
9084# wait for port mappings
91- wait_server 127.0.0.1 :8529
85+ wait_server localhost :8529
9286
9387docker exec coordinator1 arangosh --server.authentication=false --javascript.execute-string=' require("org/arangodb/users").update("root", "test")'
9488
95- rm " $LOCATION " /jwtHeader " $LOCATION " /jwtSecret
89+ # rm "$LOCATION"/jwtHeader "$LOCATION"/jwtSecret
9690
9791echo " Done, your cluster is ready."
0 commit comments