mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
various script and config file tweaks
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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 = ""
|
||||
|
||||
@@ -24,5 +24,5 @@ consul {
|
||||
|
||||
vault {
|
||||
enabled = true
|
||||
address = "http://SERVER_IP_ADDRESS:8200"
|
||||
address = "vault.service.consul"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user