mirror of
https://repository.entgra.net/community/product-iots.git
synced 2025-09-16 23:32:19 +00:00
Fixing the JVM startup issue in the analytics profile.
This commit is contained in:
parent
08bc742c4d
commit
3326165513
@ -766,24 +766,6 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>1-pre-dist</id>
|
||||
<phase>test</phase>
|
||||
<!--we are creating a temporary carbon distribution for document extracting purposes during the test phase-->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<encoding>UTF-8</encoding>
|
||||
<filters>
|
||||
<filter>${basedir}/src/assembly/filter.properties</filter>
|
||||
</filters>
|
||||
<descriptors>
|
||||
<descriptor>${basedir}/src/assembly/dist.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>2-dist</id>
|
||||
<phase>package</phase>
|
||||
@ -796,10 +778,15 @@
|
||||
<filters>
|
||||
<filter>${basedir}/src/assembly/filter.properties</filter>
|
||||
</filters>
|
||||
<escapeString>\</escapeString>
|
||||
<descriptors>
|
||||
<descriptor>${basedir}/src/assembly/bin.xml</descriptor>
|
||||
</descriptors>
|
||||
<archiverConfig>
|
||||
<defaultDirectoryMode>0775</defaultDirectoryMode>
|
||||
<directoryMode>0775</directoryMode>
|
||||
<defaultFileMode>0644</defaultFileMode>
|
||||
<fileMode>0644</fileMode>
|
||||
</archiverConfig>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
echo 'Loading spark environment variables '
|
||||
export CARBON_SPARK_HOME=$CARBON_HOME
|
||||
export _SPARK_ASSEMBLY=$CARBON_SPARK_HOME/components/plugins/spark-core_2.10_*.wso2*.jar
|
||||
export _SPARK_ASSEMBLY=$CARBON_SPARK_HOME/../components/plugins/spark-core_2.10_*.wso2*.jar
|
||||
export SPARK_SCALA_VERSION=2.10
|
||||
# *** jars will be added to the spark classpath in the code itself. check DAS-105
|
||||
# export SPARK_CLASSPATH=`java -cp $CARBON_SPARK_HOME/repository/components/plugins/org.wso2.carbon.analytics.spark.utils*.jar org.wso2.carbon.analytics.spark.utils.ComputeClasspath $CARBON_HOME`
|
||||
|
||||
@ -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=$?
|
||||
|
||||
@ -595,6 +595,19 @@
|
||||
<exclude>**/wso2server.bat</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../p2-profile/iot-core-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/components
|
||||
</directory>
|
||||
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/components</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/eclipse.ini</exclude>
|
||||
<exclude>**/*.lock</exclude>
|
||||
<exclude>**/.data</exclude>
|
||||
<exclude>**/.settings</exclude>
|
||||
<exclude>features/**</exclude>
|
||||
<exclude>**/org.wso2.carbon.feature.mgt.ui*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
<!-- ********************************* End of IoT Core Profile ********************************* -->
|
||||
|
||||
<!-- ********************************* Start of Analytics Profile ********************************* -->
|
||||
@ -627,6 +640,12 @@
|
||||
../p2-profile/analytics-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/conf
|
||||
</directory>
|
||||
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/analytics/conf</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/carbon.xml</exclude>
|
||||
<exclude>**/log4j.properties</exclude>
|
||||
<exclude>**/jndi.properties</exclude>
|
||||
<exclude>**/registry.xml</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
@ -788,6 +807,20 @@
|
||||
</fileSet>
|
||||
<!--TODO: Check on using styles-->
|
||||
|
||||
<fileSet>
|
||||
<directory>../p2-profile/analytics-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/components
|
||||
</directory>
|
||||
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/components</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/eclipse.ini</exclude>
|
||||
<exclude>**/*.lock</exclude>
|
||||
<exclude>**/.data</exclude>
|
||||
<exclude>**/.settings</exclude>
|
||||
<exclude>features/**</exclude>
|
||||
<!--<exclude>**/org.wso2.carbon.feature.mgt.ui*</exclude>-->
|
||||
</excludes>
|
||||
</fileSet>
|
||||
|
||||
<!-- ********************************* End of Analytics Profile ********************************* -->
|
||||
</fileSets>
|
||||
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
<assembly>
|
||||
<id>wso2-iot-dist</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<!-- Copying p2 profile and osgi bundles-->
|
||||
<fileSet>
|
||||
<directory>../p2-profile/iot-core-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/components
|
||||
</directory>
|
||||
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/components</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/eclipse.ini</exclude>
|
||||
<exclude>**/*.lock</exclude>
|
||||
<exclude>**/.data</exclude>
|
||||
<exclude>**/.settings</exclude>
|
||||
<exclude>features/**</exclude>
|
||||
<exclude>**/org.wso2.carbon.feature.mgt.ui*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>../p2-profile/analytics-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/components
|
||||
</directory>
|
||||
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/components</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/eclipse.ini</exclude>
|
||||
<exclude>**/*.lock</exclude>
|
||||
<exclude>**/.data</exclude>
|
||||
<exclude>**/.settings</exclude>
|
||||
<exclude>features/**</exclude>
|
||||
<exclude>**/org.wso2.carbon.feature.mgt.ui*</exclude>
|
||||
</excludes>
|
||||
<includes>
|
||||
<include>plugins/**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
||||
Loading…
Reference in New Issue
Block a user