#!/bin/sh # # Copyright (C) 2015 Cloudius Systems, Ltd. JMX_PORT="7199" API_ADDR="" API_PORT="" CONF_FILE="" DEBUG="" PARAM_HELP="-h" PARAM_JMX_PORT="-jp" PARAM_API_PORT="-p" PARAM_ADDR="-a" PARAM_LOCATION="-l" LOCATION="target" PARAM_FILE="-cf" ALLOW_REMOTE="-r" ALLOW_DEBUG="-d" REMOTE=0 print_help() { cat < - The jmx port to open $PARAM_API_PORT - The API port to connect to $PARAM_ADDR
- The API address to connect to $PARAM_FILE - A configuration file to use $PARAM_LOCATION - The location of the jmx proxy jar file $ALLOW_REMOTE - When set allow remote jmx connectivity $ALLOW_DEBUG - When set open debug ports for remote debugger HLPEND } while test "$#" -ne 0 do case "$1" in "$PARAM_API_PORT") API_PORT="-Dapiport="$2 shift 2 ;; "$PARAM_ADDR") API_ADDR="-Dapiaddress="$2 shift 2 ;; "$PARAM_PORT") API_ADDR=$2 shift 2 ;; "$PARAM_JMX_PORT") JMX_PORT=$2 shift 2 ;; "$PARAM_LOCATION") LOCATION=$2 shift 2 ;; "$PARAM_FILE") CONF_FILE="-Dapiconfig="$2 shift 2 ;; "$ALLOW_REMOTE") REMOTE=1 shift 1 ;; "$PARAM_HELP") print_help exit 0 ;; "$ALLOW_DEBUG") DEBUG="-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:7690,server=y,suspend=n" shift 1 ;; *) esac done if [ $REMOTE -eq 1 ]; then REMOTE="-Djavax.management.builder.initial=com.scylladb.jmx.utils.APIBuilder -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT -Dcom.sun.management.jmxremote.local.only=false" else REMOTE="-Dcassandra.jmx.local.port=$JMX_PORT" fi exec java $API_ADDR $API_PORT $DEBUG $CONF_FILE $REMOTE -Xmx256m -XX:+UseSerialGC -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/scylla-jmx-1.0.jar