|
|
@ -75,7 +75,7 @@ PRGDIR=`dirname "$PRG"`
|
|
|
|
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
|
|
|
|
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
|
|
|
|
|
|
|
|
|
|
|
|
# Set AXIS2_HOME. Needed for One Click JAR Download
|
|
|
|
# Set AXIS2_HOME. Needed for One Click JAR Download
|
|
|
|
AXIS2_HOME=$CARBON_HOME
|
|
|
|
AXIS2_HOME="$CARBON_HOME"
|
|
|
|
|
|
|
|
|
|
|
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
|
|
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
|
|
|
if $cygwin; then
|
|
|
|
if $cygwin; then
|
|
|
@ -139,21 +139,24 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
# ----- Process the input command ----------------------------------------------
|
|
|
|
# ----- Process the input command ----------------------------------------------
|
|
|
|
args=""
|
|
|
|
args=""
|
|
|
|
NODE_PARAMS=""
|
|
|
|
NODE_PARAMS="-DdisableMl=false "
|
|
|
|
for c in $*
|
|
|
|
for c in $*
|
|
|
|
do
|
|
|
|
do
|
|
|
|
if [ "$c" = "-receiverNode" ]; then
|
|
|
|
if [ "$c" = "-receiverNode" ]; then
|
|
|
|
NODE_PARAMS="-DdisableAnalyticsEngine=true -DdisableAnalyticsExecution=true -DdisableIndexing=true -DdisableDataPurging=false -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true"
|
|
|
|
NODE_PARAMS="-DdisableAnalyticsEngine=true -DdisableAnalyticsExecution=true -DdisableIndexing=true -DdisableDataPurging=false -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableMl=true "
|
|
|
|
echo "Starting Data Analytics Server node as a Receiver Node"
|
|
|
|
echo "Starting Data Analytics Server node as a Receiver Node"
|
|
|
|
elif [ "$c" = "-indexerNode" ]; then
|
|
|
|
elif [ "$c" = "-indexerNode" ]; then
|
|
|
|
NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableEventSink=true -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableDataPurging=true"
|
|
|
|
NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableEventSink=true -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableDataPurging=true -DdisableMl=true "
|
|
|
|
echo "Starting Data Analytics Server node as an Indexer Node"
|
|
|
|
echo "Starting Data Analytics Server node as an Indexer Node"
|
|
|
|
elif [ "$c" = "-analyzerNode" ]; then
|
|
|
|
elif [ "$c" = "-analyzerNode" ]; then
|
|
|
|
NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true"
|
|
|
|
NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableMl=true "
|
|
|
|
echo "Starting Data Analytics Server node as an Analyzer Node"
|
|
|
|
echo "Starting Data Analytics Server node as an Analyzer Node"
|
|
|
|
elif [ "$c" = "-dashboardNode" ]; then
|
|
|
|
elif [ "$c" = "-dashboardNode" ]; then
|
|
|
|
NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableAnalyticsSparkCtx=true "
|
|
|
|
NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableAnalyticsSparkCtx=true -DdisableMl=true "
|
|
|
|
echo "Starting Data Analytics Server node as an Analyzer Node"
|
|
|
|
echo "Starting Data Analytics Server node as an Analyzer Node"
|
|
|
|
|
|
|
|
elif [ "$c" = "-mlNode" ]; then
|
|
|
|
|
|
|
|
NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableEventSink=true -DdisableIndexing=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableMl=false "
|
|
|
|
|
|
|
|
echo "Starting Data Analytics Server node as a Machine Learner Node"
|
|
|
|
elif [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
|
|
|
|
elif [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
|
|
|
|
CMD="--debug"
|
|
|
|
CMD="--debug"
|
|
|
|
continue
|
|
|
|
continue
|
|
|
@ -194,19 +197,19 @@ elif [ "$CMD" = "start" ]; then
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
# using nohup sh to avoid erros in solaris OS.TODO
|
|
|
|
# using nohup sh to avoid erros in solaris OS.TODO
|
|
|
|
nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 &
|
|
|
|
nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 &
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
elif [ "$CMD" = "stop" ]; then
|
|
|
|
elif [ "$CMD" = "stop" ]; then
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
kill -term `cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
kill -term `cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
elif [ "$CMD" = "restart" ]; then
|
|
|
|
elif [ "$CMD" = "restart" ]; then
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
kill -term `cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
kill -term `cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
process_status=0
|
|
|
|
process_status=0
|
|
|
|
pid=`cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
pid=`cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
while [ "$process_status" -eq "0" ]
|
|
|
|
while [ "$process_status" -eq "0" ]
|
|
|
|
do
|
|
|
|
do
|
|
|
|
sleep 1;
|
|
|
|
sleep 1;
|
|
|
@ -215,13 +218,13 @@ elif [ "$CMD" = "restart" ]; then
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# using nohup sh to avoid erros in solaris OS.TODO
|
|
|
|
# using nohup sh to avoid erros in solaris OS.TODO
|
|
|
|
nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 &
|
|
|
|
nohup sh "$CARBON_HOME"/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 &
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
elif [ "$CMD" = "test" ]; then
|
|
|
|
elif [ "$CMD" = "test" ]; then
|
|
|
|
JAVACMD="exec "$JAVACMD""
|
|
|
|
JAVACMD="exec "$JAVACMD""
|
|
|
|
elif [ "$CMD" = "version" ]; then
|
|
|
|
elif [ "$CMD" = "version" ]; then
|
|
|
|
cat $CARBON_HOME/bin/version.txt
|
|
|
|
cat "$CARBON_HOME"/bin/version.txt
|
|
|
|
cat $CARBON_HOME/bin/wso2carbon-version.txt
|
|
|
|
cat "$CARBON_HOME"/bin/wso2carbon-version.txt
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
@ -233,14 +236,14 @@ if [ "$jdk_17" = "" ]; then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
CARBON_XBOOTCLASSPATH=""
|
|
|
|
CARBON_XBOOTCLASSPATH=""
|
|
|
|
for f in "$CARBON_HOME"/lib/xboot/*.jar
|
|
|
|
for f in "$CARBON_HOME"/../lib/xboot/*.jar
|
|
|
|
do
|
|
|
|
do
|
|
|
|
if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then
|
|
|
|
if [ "$f" != "$CARBON_HOME/../lib/xboot/*.jar" ];then
|
|
|
|
CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f
|
|
|
|
CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
|
|
|
|
JAVA_ENDORSED_DIRS="$CARBON_HOME/../lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
|
|
|
|
|
|
|
|
|
|
|
|
CARBON_CLASSPATH=""
|
|
|
|
CARBON_CLASSPATH=""
|
|
|
|
if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
|
|
|
|
if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
|
|
|
@ -252,7 +255,7 @@ do
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
for t in "$CARBON_HOME"/lib/commons-lang*.jar
|
|
|
|
for t in "$CARBON_HOME"/../lib/commons-lang*.jar
|
|
|
|
do
|
|
|
|
do
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
|
|
|
|
done
|
|
|
|
done
|
|
|
@ -270,21 +273,45 @@ fi
|
|
|
|
# ----- Execute The Requested Command -----------------------------------------
|
|
|
|
# ----- Execute The Requested Command -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
echo JAVA_HOME environment variable is set to $JAVA_HOME
|
|
|
|
echo JAVA_HOME environment variable is set to $JAVA_HOME
|
|
|
|
echo CARBON_HOME environment variable is set to $CARBON_HOME
|
|
|
|
echo CARBON_HOME environment variable is set to "$CARBON_HOME"
|
|
|
|
|
|
|
|
|
|
|
|
cd "$CARBON_HOME"
|
|
|
|
cd "$CARBON_HOME"
|
|
|
|
|
|
|
|
|
|
|
|
TMP_DIR=$CARBON_HOME/tmp
|
|
|
|
TMP_DIR="$CARBON_HOME"/tmp
|
|
|
|
if [ -d "$TMP_DIR" ]; then
|
|
|
|
if [ -d "$TMP_DIR" ]; then
|
|
|
|
rm -rf "$TMP_DIR"
|
|
|
|
rm -rf "$TMP_DIR"/*
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
START_EXIT_STATUS=121
|
|
|
|
START_EXIT_STATUS=121
|
|
|
|
status=$START_EXIT_STATUS
|
|
|
|
status=$START_EXIT_STATUS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$JVM_MEM_OPTS" ]; then
|
|
|
|
|
|
|
|
java_version=$("$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}')
|
|
|
|
|
|
|
|
JVM_MEM_OPTS="-Xms256m -Xmx2048m"
|
|
|
|
|
|
|
|
if [ "$java_version" \< "1.8" ]; then
|
|
|
|
|
|
|
|
JVM_MEM_OPTS="$JVM_MEM_OPTS -XX:MaxPermSize=256m"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using Java memory options: $JVM_MEM_OPTS"
|
|
|
|
|
|
|
|
|
|
|
|
#load spark environment variables
|
|
|
|
#load spark environment variables
|
|
|
|
. $CARBON_HOME/bin/load-spark-env-vars.sh
|
|
|
|
. $CARBON_HOME/bin/load-spark-env-vars.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#setting up profile parameter for runtime in EI
|
|
|
|
|
|
|
|
PROFILE_SELECTED="false"
|
|
|
|
|
|
|
|
for i in "$@"; do
|
|
|
|
|
|
|
|
if echo "$i" | grep -q "Dprofile"; then
|
|
|
|
|
|
|
|
PROFILE_SELECTED="true"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$PROFILE_SELECTED" = false ] ; then
|
|
|
|
|
|
|
|
NODE_PARAMS="$NODE_PARAMS -Dprofile=analytics-default"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#adding ei specific class path to wso2/components
|
|
|
|
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":"$CARBON_HOME/../components/plugins/"
|
|
|
|
|
|
|
|
|
|
|
|
#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
|
|
|
|
#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
|
|
|
|
# -Djava.rmi.server.hostname="your.IP.goes.here"
|
|
|
|
# -Djava.rmi.server.hostname="your.IP.goes.here"
|
|
|
|
|
|
|
|
|
|
|
@ -292,7 +319,7 @@ while [ "$status" = "$START_EXIT_STATUS" ]
|
|
|
|
do
|
|
|
|
do
|
|
|
|
$JAVACMD \
|
|
|
|
$JAVACMD \
|
|
|
|
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
|
|
|
|
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
|
|
|
|
-Xms256m -Xmx1024m -XX:MaxPermSize=256m \
|
|
|
|
$JVM_MEM_OPTS \
|
|
|
|
-XX:+HeapDumpOnOutOfMemoryError \
|
|
|
|
-XX:+HeapDumpOnOutOfMemoryError \
|
|
|
|
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
|
|
|
|
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
|
|
|
|
$JAVA_OPTS \
|
|
|
|
$JAVA_OPTS \
|
|
|
@ -330,12 +357,9 @@ do
|
|
|
|
-Dfile.encoding=UTF8 \
|
|
|
|
-Dfile.encoding=UTF8 \
|
|
|
|
-Djava.net.preferIPv4Stack=true \
|
|
|
|
-Djava.net.preferIPv4Stack=true \
|
|
|
|
-Dcom.ibm.cacheLocalHost=true \
|
|
|
|
-Dcom.ibm.cacheLocalHost=true \
|
|
|
|
-Dmqtt.broker.host="localhost" \
|
|
|
|
-DworkerNode=false \
|
|
|
|
-Dmqtt.broker.port="1886" \
|
|
|
|
-Dorg.apache.cxf.io.CachedOutputStream.Threshold=104857600 \
|
|
|
|
-Diot.keymanager.host="localhost" \
|
|
|
|
-Dcarbon.das.c5.enabled="true" \
|
|
|
|
-Diot.keymanager.https.port="9443" \
|
|
|
|
|
|
|
|
-Diot.gateway.host="localhost" \
|
|
|
|
|
|
|
|
-Diot.gateway.https.port="8243" \
|
|
|
|
|
|
|
|
$NODE_PARAMS \
|
|
|
|
$NODE_PARAMS \
|
|
|
|
org.wso2.carbon.bootstrap.Bootstrap $*
|
|
|
|
org.wso2.carbon.bootstrap.Bootstrap $*
|
|
|
|
status=$?
|
|
|
|
status=$?
|
|
|
|