first-fix
This commit is contained in:
1 parent
6d87c1edc8
commit
565d9d673a
6284 files changed
+820267
-76
No files matched your search
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016-2023 The Thingsboard Authors
|
||||
#
|
||||
# Licensed 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.
|
||||
#
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
--loadDemo)
|
||||
LOAD_DEMO=true
|
||||
shift # past argument
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift # past argument or value
|
||||
done
|
||||
|
||||
if [ "$LOAD_DEMO" == "true" ]; then
|
||||
loadDemo=true
|
||||
else
|
||||
loadDemo=false
|
||||
fi
|
||||
|
||||
CONF_FOLDER="${pkg.installFolder}/conf"
|
||||
jarfile=${pkg.installFolder}/bin/${pkg.name}.jar
|
||||
configfile=${pkg.name}.conf
|
||||
upgradeversion=${DATA_FOLDER}/.upgradeversion
|
||||
|
||||
source "${CONF_FOLDER}/${configfile}"
|
||||
|
||||
echo "Starting ThingsBoard installation ..."
|
||||
|
||||
set -e
|
||||
|
||||
java -cp ${jarfile} $JAVA_OPTS -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication \
|
||||
-Dinstall.load_demo=${loadDemo} \
|
||||
-Dspring.jpa.hibernate.ddl-auto=none \
|
||||
-Dinstall.upgrade=false \
|
||||
-Dlogging.config=/usr/share/thingsboard/bin/install/logback.xml \
|
||||
org.springframework.boot.loader.PropertiesLauncher
|
||||
|
||||
echo "${pkg.upgradeVersion}" > ${upgradeversion}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
|
||||
Copyright © 2016-2023 The Thingsboard Authors
|
||||
|
||||
Licensed 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.
|
||||
|
||||
-->
|
||||
<!DOCTYPE configuration>
|
||||
<configuration scan="true" scanPeriod="10 seconds">
|
||||
|
||||
<appender name="fileLogAppender"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>/var/log/thingsboard/thingsboard.log</file>
|
||||
<rollingPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>/var/log/thingsboard/thingsboard.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
<totalSizeCap>3GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="org.thingsboard.server" level="INFO" />
|
||||
<logger name="com.microsoft.azure.servicebus.primitives.CoreMessageReceiver" level="OFF" />
|
||||
<logger name="org.apache.kafka.common.utils.AppInfoParser" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients" level="WARN"/>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="fileLogAppender"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016-2023 The Thingsboard Authors
|
||||
#
|
||||
# Licensed 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.
|
||||
#
|
||||
|
||||
start-db.sh
|
||||
|
||||
CONF_FOLDER="${pkg.installFolder}/conf"
|
||||
jarfile=${pkg.installFolder}/bin/${pkg.name}.jar
|
||||
configfile=${pkg.name}.conf
|
||||
firstlaunch=${DATA_FOLDER}/.firstlaunch
|
||||
|
||||
source "${CONF_FOLDER}/${configfile}"
|
||||
|
||||
if [ ! -f ${firstlaunch} ]; then
|
||||
install-tb.sh --loadDemo && touch ${firstlaunch}
|
||||
fi
|
||||
|
||||
if [ -f ${firstlaunch} ]; then
|
||||
echo "Starting ThingsBoard ..."
|
||||
|
||||
java -cp ${jarfile} $JAVA_OPTS -Dloader.main=org.thingsboard.server.ThingsboardServerApplication \
|
||||
-Dspring.jpa.hibernate.ddl-auto=none \
|
||||
-Dlogging.config=${CONF_FOLDER}/logback.xml \
|
||||
org.springframework.boot.loader.PropertiesLauncher
|
||||
else
|
||||
echo "ERROR: ThingsBoard is not installed"
|
||||
fi
|
||||
|
||||
stop-db.sh
|
||||
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright © 2016-2023 The Thingsboard Authors
|
||||
#
|
||||
# Licensed 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.
|
||||
#
|
||||
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dplatform=deb -Dinstall.data_dir=/usr/share/thingsboard/data"
|
||||
export JAVA_OPTS="$JAVA_OPTS -Xlog:gc*,heap*,age*,safepoint=debug:file=/var/log/thingsboard/gc.log:time,uptime,level,tags:filecount=10,filesize=10M"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+IgnoreUnrecognizedVMOptions -XX:+HeapDumpOnOutOfMemoryError"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+ResizeTLAB -XX:+PerfDisableSharedMem -XX:+UseCondCardMark"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled -XX:MaxTenuringThreshold=10"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+ExitOnOutOfMemoryError"
|
||||
export LOG_FILENAME=thingsboard.out
|
||||
export LOADER_PATH=/usr/share/thingsboard/conf,/usr/share/thingsboard/extensions
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016-2023 The Thingsboard Authors
|
||||
#
|
||||
# Licensed 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.
|
||||
#
|
||||
|
||||
start-db.sh
|
||||
|
||||
CONF_FOLDER="${pkg.installFolder}/conf"
|
||||
jarfile=${pkg.installFolder}/bin/${pkg.name}.jar
|
||||
configfile=${pkg.name}.conf
|
||||
upgradeversion=${DATA_FOLDER}/.upgradeversion
|
||||
|
||||
source "${CONF_FOLDER}/${configfile}"
|
||||
|
||||
FROM_VERSION=`cat ${upgradeversion}`
|
||||
|
||||
echo "Starting ThingsBoard upgrade ..."
|
||||
|
||||
if [[ -z "${FROM_VERSION// }" ]]; then
|
||||
echo "FROM_VERSION variable is invalid or unspecified!"
|
||||
exit 1
|
||||
else
|
||||
fromVersion="${FROM_VERSION// }"
|
||||
fi
|
||||
|
||||
java -cp ${jarfile} $JAVA_OPTS -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication \
|
||||
-Dspring.jpa.hibernate.ddl-auto=none \
|
||||
-Dinstall.upgrade=true \
|
||||
-Dinstall.upgrade.from_version=${fromVersion} \
|
||||
-Dlogging.config=/usr/share/thingsboard/bin/install/logback.xml \
|
||||
org.springframework.boot.loader.PropertiesLauncher
|
||||
|
||||
echo "${pkg.upgradeVersion}" > ${upgradeversion}
|
||||
|
||||
stop-db.sh
|
||||
Reference in new issue
Block a user