Skip to content

Commit 9090847

Browse files
committed
dbg single container startup
1 parent dfcb20d commit 9090847

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

docker/start_db_cluster.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ docker run -d -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO
2626
docker 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
2727
docker 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
2828

29-
docker 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
29+
docker run -d -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.3.1 --name coordinator1 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator true --starter.join agent1 --auth.jwt-secret /jwtSecret
3030
docker 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
3131

3232
debug_container() {
@@ -81,9 +81,6 @@ for a in 172.28.1.1:8531 \
8181
wait_server $a
8282
done
8383

84-
# wait for port mappings
85-
wait_server localhost:8529
86-
8784
docker exec coordinator1 arangosh --server.authentication=false --javascript.execute-string='require("org/arangodb/users").update("root", "test")'
8885

8986
#rm "$LOCATION"/jwtHeader "$LOCATION"/jwtSecret

docker/start_db_single.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,32 @@ docker pull "$1"
1111

1212
docker network create arangodb --subnet 172.28.0.0/16
1313

14-
docker run -d -p 8529:8529 -e ARANGO_ROOT_PASSWORD=test -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.3.1 --name arangodb "$1"
14+
docker run -d -e ARANGO_ROOT_PASSWORD=test -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.3.1 --name arangodb "$1"
15+
16+
debug_container() {
17+
if [ ! "$(docker ps -aqf name="$1")" ]; then
18+
echo "$1 container not found!"
19+
exit 1
20+
fi
21+
22+
running=$(docker inspect -f '{{.State.Running}}' "$1")
23+
24+
if [ "$running" = false ]
25+
then
26+
echo "$1 is not running!"
27+
echo "---"
28+
docker logs "$1"
29+
echo "---"
30+
exit 1
31+
fi
32+
}
1533

1634
echo "waiting for arangodb ..."
1735

1836
# shellcheck disable=SC2091
19-
until $(curl --output /dev/null --silent --head --fail -i -u root:test 'http://localhost:8529/_api/version'); do
37+
until $(curl --output /dev/null --silent --head --fail -i -u root:test 'http://172.28.3.1:8529/_api/version'); do
2038
printf '.'
39+
debug_container arangodb
2140
sleep 1
2241
done
2342
echo "READY!"

0 commit comments

Comments
 (0)