From 154d84c2e3f19e21bfe4166dd7339aec1c85f4c8 Mon Sep 17 00:00:00 2001 From: cburroughs Date: Fri, 25 Mar 2016 11:05:30 -0400 Subject: [PATCH] allow listen address to be configured alongside port This is useful if cases where collins runs on a node with multiple interfaces, or behind a proxy. --- contrib/upstart/collins_env.sh | 3 ++- scripts/collins.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/upstart/collins_env.sh b/contrib/upstart/collins_env.sh index 265b5b349..b17c0b55f 100644 --- a/contrib/upstart/collins_env.sh +++ b/contrib/upstart/collins_env.sh @@ -1,7 +1,8 @@ APP_NAME="collins" APP_HOME="/usr/local/$APP_NAME/current" +LISTEN_ADDRESS="0.0.0.0" LISTEN_PORT=9000 -APP_OPTS="-Dconfig.file=$APP_HOME/conf/production.conf -Dhttp.port=${LISTEN_PORT} -Dlogger.file=$APP_HOME/conf/logger.xml" +APP_OPTS="-Dconfig.file=$APP_HOME/conf/production.conf -Dhttp.address=${LISTEN_ADDRESS} -Dhttp.port=${LISTEN_PORT} -Dlogger.file=$APP_HOME/conf/logger.xml" DNS_OPTS="-Dnetworkaddress.cache.ttl=1 -Dnetworkaddress.cache.negative.ttl=1" JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" GC_OPTS="-XX:+CMSClassUnloadingEnabled" diff --git a/scripts/collins.sh b/scripts/collins.sh index 7fd6c1fd3..bc7d5910a 100755 --- a/scripts/collins.sh +++ b/scripts/collins.sh @@ -13,6 +13,7 @@ APP_NAME="collins" APP_HOME="/usr/local/$APP_NAME/current" LOG_HOME='/var/log' +LISTEN_ADDRESS="0.0.0.0" LISTEN_PORT=8080 FILE_LIMIT=8192 COLLINS_USER="collins" @@ -34,7 +35,7 @@ DEBUG_OPTS="-XX:ErrorFile=${LOG_HOME}/$APP_NAME/java_error%p.log -XX:+HeapDumpOn # Check for config overrides [ -f /etc/sysconfig/collins ] && . /etc/sysconfig/collins -APP_OPTS="-Dconfig.file=$APP_HOME/conf/production.conf -Dhttp.port=${LISTEN_PORT} -Dlogger.file=$APP_HOME/conf/logger.xml" +APP_OPTS="-Dconfig.file=$APP_HOME/conf/production.conf -Dhttp.address=${LISTEN_ADDRESS} -Dhttp.port=${LISTEN_PORT} -Dlogger.file=$APP_HOME/conf/logger.xml" DNS_OPTS="-Dnetworkaddress.cache.ttl=1 -Dnetworkaddress.cache.negative.ttl=1" JAVA_OPTS="-server $APP_OPTS $DNS_OPTS $JMX_OPTS $PERMGEN_OPTS $GC_LOGGING_OPTS $GC_LOG $HEAP_OPTS $DEBUG_OPTS"