Skip to content

Commit 3c09ab9

Browse files
denesbavikivity
authored andcommitted
nodetool: parse and forward -h|--host to nodetool
Our launcher script (bin/nodetool) currently silently ignores the host parameter and nodetool will use the default value (127.0.0.1). This patch parses and forwards the host parameter to nodetool, so that it is possible to start JMX on other ips than 127.0.0.1.
1 parent 9dddad2 commit 3c09ab9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bin/nodetool

+13-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fi
5757
ARGS=""
5858
JVM_ARGS=""
5959
SSL_FILE=$HOME/.cassandra/nodetool-ssl.properties
60+
JMX_HOST="127.0.0.1"
6061
while true
6162
do
6263
if [ ! $1 ]; then break; fi
@@ -72,6 +73,17 @@ do
7273
JMX_PORT=$2
7374
shift
7475
;;
76+
-h)
77+
JMX_HOST=$2
78+
shift
79+
;;
80+
--host=*)
81+
JMX_HOST=$(echo $1 | cut -d '=' -f 2)
82+
;;
83+
--host)
84+
JMX_HOST=$2
85+
shift
86+
;;
7587
--ssl)
7688
if [ -f $SSL_FILE ]
7789
then
@@ -100,6 +112,6 @@ fi
100112
-Dlogback.configurationFile=logback-tools.xml \
101113
$JVM_ARGS \
102114
$CONFIGURATION_FILE_OPT \
103-
org.apache.cassandra.tools.NodeTool -p $JMX_PORT $ARGS
115+
org.apache.cassandra.tools.NodeTool -p $JMX_PORT -h $JMX_HOST $ARGS
104116

105117
# vi:ai sw=4 ts=4 tw=0 et

0 commit comments

Comments
 (0)