forked from OriginTrail/ot-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_arangodb.sh
executable file
·34 lines (28 loc) · 1.11 KB
/
setup_arangodb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
curl -OL https://download.arangodb.com/arangodb35/DEBIAN/Release.key
apt-key add - < Release.key
echo 'deb https://download.arangodb.com/arangodb35/DEBIAN/ /' | tee /etc/apt/sources.list.d/arangodb.list
apt-get install apt-transport-https -y
apt-get update -y
echo arangodb3 arangodb3/password password root | debconf-set-selections
echo arangodb3 arangodb3/password_again password root | debconf-set-selections
echo arangodb3 arangodb3/upgrade boolean false | debconf-set-selections
echo arangodb3 arangodb3/storage_engine select auto | debconf-set-selections
apt-get install arangodb3=3.5.3-1 -y --allow-unauthenticated
sed -i 's/authentication = true/authentication = false/g' /etc/arangodb3/arangod.conf
systemctl start arangodb3
echo "Waiting until ArangoDB is ready on port 8529"
n=0
# timeout value for startup
timeout=60
while [[ (-z `curl -H 'Authorization: Basic cm9vdDo=' -s 'http://127.0.0.1:8529/_api/version' `) && (n -lt timeout) ]] ; do
echo -n "."
sleep 1s
n=$[$n+1]
done
if [[ n -eq timeout ]];
then
echo "Could not start ArangoDB. Timeout reached."
exit 1
fi
echo "ArangoDB is up"