[titan-gremlin] Automatically use 'itzg/cassandra' image's publish-as address

This commit is contained in:
Geoff Bourne 2015-02-16 14:50:03 +00:00
parent 78d82b334b
commit 4dff67e03b

View File

@ -9,14 +9,27 @@ fi
rm -f /tmp/titan.properties
if [ -n "$CASS_PORT_9160_TCP_ADDR" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
storage.backend=cassandra
storage.hostname=$CASS_PORT_9160_TCP_ADDR
END
elif [ -n "$CASS_ADDR" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
storage.backend=cassandra
storage.hostname=$CASS_ADDR
END
fi
if [ -n "$ES_CLUSTER" -o -n "$ES_PORT_9300_TCP_PORT" ]; then
esAddr=${ES_ENV_PUBLISH_AS:-ES_PORT_9300_TCP_ADDR}
if [ -n "$ES_CLUSTER" -o -n "$esAddr" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
index.search.backend=elasticsearch
@ -28,9 +41,11 @@ END
index.search.elasticsearch.ext.cluster.name=$ES_CLUSTER
END
fi
if [ -n "$ES_PORT_9300_TCP_PORT" ]; then
if [ -n "$esAddr" ]; then
# strip off the port spec, if present
esAddr=$(echo $esAddr | cut -d: -f1)
cat >> /tmp/titan.properties <<END
index.search.hostname=$ES_PORT_9300_TCP_ADDR
index.search.hostname=$esAddr
END
fi