various script and config file tweaks

This commit is contained in:
Rob Genova
2017-06-25 10:09:54 -07:00
parent 989963ca36
commit 6a6f9ca5da
4 changed files with 16 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
"server": true,
"data_dir": "/opt/consul/data",
"bind_addr": "0.0.0.0",
"client_addr": "IP_ADDRESS",
"client_addr": "0.0.0.0",
"advertise_addr": "IP_ADDRESS",
"bootstrap_expect": SERVER_COUNT,
"service": {

View File

@@ -15,7 +15,7 @@ consul {
vault {
enabled = false
address = "http://IP_ADDRESS:8200"
address = "vault.service.consul"
task_token_ttl = "1h"
create_from_role = "nomad-cluster"
token = ""

View File

@@ -24,5 +24,5 @@ consul {
vault {
enabled = true
address = "http://SERVER_IP_ADDRESS:8200"
address = "vault.service.consul"
}

View File

@@ -8,7 +8,10 @@ HADOOP_VERSION=hadoop-2.7.3
HADOOPCONFIGDIR=/usr/local/$HADOOP_VERSION/etc/hadoop
HOME_DIR=ubuntu
sleep 15
IP_ADDRESS=$(curl http://instance-data/latest/meta-data/local-ipv4)
DOCKER_BRIDGE_IP_ADDRESS=(`ifconfig docker0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'`)
SERVER_COUNT=$1
REGION=$2
CLUSTER_TAG_VALUE=$3
@@ -43,6 +46,16 @@ sudo service nomad start
sleep 10
export NOMAD_ADDR=http://$IP_ADDRESS:4646
# Add hostname to /etc/hosts
echo "127.0.0.1 $(hostname)" | sudo tee --append /etc/hosts
# Add Docker bridge network IP to /etc/resolv.conf (at the top)
echo "nameserver $DOCKER_BRIDGE_IP_ADDRESS" | sudo tee /etc/resolv.conf.new
cat /etc/resolv.conf | sudo tee --append /etc/resolv.conf.new
sudo mv /etc/resolv.conf.new /etc/resolv.conf
# Hadoop
sudo cp $CONFIGDIR/core-site.xml $HADOOPCONFIGDIR