forked from vespa-engine/sample-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_bootstrap.sh
29 lines (22 loc) · 934 Bytes
/
aws_bootstrap.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
#!/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"
yum -y install yum-utils epel-release
yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/vespa/vespa/repo/epel-7/group_vespa-vespa-epel-7.repo
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
fi
echo "Starting vespa services"
service vespa start;