forked from vespa-engine/sample-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws_bootstrap.sh
More file actions
38 lines (30 loc) · 1.02 KB
/
aws_bootstrap.sh
File metadata and controls
38 lines (30 loc) · 1.02 KB
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
35
36
37
38
#!/bin/bash -e
## Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
export VESPA_HOME=/opt/vespa
configserver_addr=$1
if [ $# -eq 0 ]; then
configserver_addr=localhost
fi
echo "Installing Vespa"
cat << 'EOF' > /etc/yum.repos.d/vespa-engine-stable.repo
[vespa-engine-stable]
name=vespa-engine-stable
baseurl=https://yahoo.bintray.com/vespa-engine/centos/$releasever/stable/$basearch
gpgcheck=0
repo_gpgcheck=0
enabled=1
EOF
yum -y install yum-utils epel-release
yum -y install vespa bind-utils git
fqdn=$(nslookup $(hostname) |grep Name |awk '{print $2}')
echo "Setting hostname to fqdn '$fqdn'"
hostnamectl set-hostname $fqdn
echo "Setting VESPA_CONFIGSERVERS=$configserver_addr"
echo "override VESPA_CONFIGSERVERS $configserver_addr" >> $VESPA_HOME/conf/vespa/default-env.txt
if [ "$configserver_addr" = "$fqdn" ]; then
echo "Starting vespa configuration server "
service vespa-configserver start
else
echo "Starting vespa services"
service vespa start
fi