|
|
|
@ -75,7 +75,7 @@ PRGDIR=`dirname "$PRG"`
|
|
|
|
|
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
if $cygwin; then
|
|
|
|
@ -139,21 +139,24 @@ fi
|
|
|
|
|
|
|
|
|
|
# ----- Process the input command ----------------------------------------------
|
|
|
|
|
args=""
|
|
|
|
|
NODE_PARAMS=""
|
|
|
|
|
NODE_PARAMS="-DdisableMl=false "
|
|
|
|
|
for c in $*
|
|
|
|
|
do
|
|
|
|
|
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"
|
|
|
|
|
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"
|
|
|
|
|
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"
|
|
|
|
|
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"
|
|
|
|
|
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
|
|
|
|
|
CMD="--debug"
|
|
|
|
|
continue
|
|
|
|
@ -194,19 +197,19 @@ elif [ "$CMD" = "start" ]; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
|
# using nohup sh to avoid erros in solaris OS.TODO
|
|
|
|
|
nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 &
|
|
|
|
|
exit 0
|
|
|
|
|
elif [ "$CMD" = "stop" ]; then
|
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
|
kill -term `cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
|
kill -term `cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
|
exit 0
|
|
|
|
|
elif [ "$CMD" = "restart" ]; then
|
|
|
|
|
export CARBON_HOME=$CARBON_HOME
|
|
|
|
|
kill -term `cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
|
export CARBON_HOME="$CARBON_HOME"
|
|
|
|
|
kill -term `cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
|
process_status=0
|
|
|
|
|
pid=`cat $CARBON_HOME/wso2carbon.pid`
|
|
|
|
|
pid=`cat "$CARBON_HOME"/wso2carbon.pid`
|
|
|
|
|
while [ "$process_status" -eq "0" ]
|
|
|
|
|
do
|
|
|
|
|
sleep 1;
|
|
|
|
@ -215,13 +218,13 @@ elif [ "$CMD" = "restart" ]; then
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
elif [ "$CMD" = "test" ]; then
|
|
|
|
|
JAVACMD="exec "$JAVACMD""
|
|
|
|
|
elif [ "$CMD" = "version" ]; then
|
|
|
|
|
cat $CARBON_HOME/bin/version.txt
|
|
|
|
|
cat $CARBON_HOME/bin/wso2carbon-version.txt
|
|
|
|
|
cat "$CARBON_HOME"/bin/version.txt
|
|
|
|
|
cat "$CARBON_HOME"/bin/wso2carbon-version.txt
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
@ -233,14 +236,14 @@ if [ "$jdk_17" = "" ]; then
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
CARBON_XBOOTCLASSPATH=""
|
|
|
|
|
for f in "$CARBON_HOME"/lib/xboot/*.jar
|
|
|
|
|
for f in "$CARBON_HOME"/../lib/xboot/*.jar
|
|
|
|
|
do
|
|
|
|
|
if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then
|
|
|
|
|
if [ "$f" != "$CARBON_HOME/../lib/xboot/*.jar" ];then
|
|
|
|
|
CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f
|
|
|
|
|
fi
|
|
|
|
|
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=""
|
|
|
|
|
if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
|
|
|
|
@ -252,7 +255,7 @@ do
|
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
for t in "$CARBON_HOME"/lib/commons-lang*.jar
|
|
|
|
|
for t in "$CARBON_HOME"/../lib/commons-lang*.jar
|
|
|
|
|
do
|
|
|
|
|
CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
|
|
|
|
|
done
|
|
|
|
@ -270,21 +273,45 @@ fi
|
|
|
|
|
# ----- Execute The Requested Command -----------------------------------------
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
TMP_DIR=$CARBON_HOME/tmp
|
|
|
|
|
TMP_DIR="$CARBON_HOME"/tmp
|
|
|
|
|
if [ -d "$TMP_DIR" ]; then
|
|
|
|
|
rm -rf "$TMP_DIR"
|
|
|
|
|
rm -rf "$TMP_DIR"/*
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
START_EXIT_STATUS=121
|
|
|
|
|
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
|
|
|
|
|
. $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.
|
|
|
|
|
# -Djava.rmi.server.hostname="your.IP.goes.here"
|
|
|
|
|
|
|
|
|
@ -292,7 +319,7 @@ while [ "$status" = "$START_EXIT_STATUS" ]
|
|
|
|
|
do
|
|
|
|
|
$JAVACMD \
|
|
|
|
|
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
|
|
|
|
|
-Xms256m -Xmx1024m -XX:MaxPermSize=256m \
|
|
|
|
|
$JVM_MEM_OPTS \
|
|
|
|
|
-XX:+HeapDumpOnOutOfMemoryError \
|
|
|
|
|
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
|
|
|
|
|
$JAVA_OPTS \
|
|
|
|
@ -330,12 +357,9 @@ do
|
|
|
|
|
-Dfile.encoding=UTF8 \
|
|
|
|
|
-Djava.net.preferIPv4Stack=true \
|
|
|
|
|
-Dcom.ibm.cacheLocalHost=true \
|
|
|
|
|
-Dmqtt.broker.host="localhost" \
|
|
|
|
|
-Dmqtt.broker.port="1886" \
|
|
|
|
|
-Diot.keymanager.host="localhost" \
|
|
|
|
|
-Diot.keymanager.https.port="9443" \
|
|
|
|
|
-Diot.gateway.host="localhost" \
|
|
|
|
|
-Diot.gateway.https.port="8243" \
|
|
|
|
|
-DworkerNode=false \
|
|
|
|
|
-Dorg.apache.cxf.io.CachedOutputStream.Threshold=104857600 \
|
|
|
|
|
-Dcarbon.das.c5.enabled="true" \
|
|
|
|
|
$NODE_PARAMS \
|
|
|
|
|
org.wso2.carbon.bootstrap.Bootstrap $*
|
|
|
|
|
status=$?
|
|
|
|
|