Skip to content

Commit

Permalink
Merge pull request #1217 from WeBankPartners/add_tz_to_plugin
Browse files Browse the repository at this point in the history
#tz add tomcat exporter config
  • Loading branch information
gavin2lee authored Jan 28, 2021
2 parents 7ff9e91 + 9436fb3 commit 086e4b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmdb-plugin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from platten/alpine-oracle-jre8-docker
LABEL maintainer = "Webank CTB Team"
ADD target/wecube-plugins-wecmdb-1.5.0.jar /application/wecube-plugins-wecmdb.jar
ADD scripts/start-tomcat-exporter.sh /scripts/start-tomcat-exporter.sh
ADD scripts/start.sh /scripts/start.sh
RUN chmod +x /scripts/start-tomcat-exporter.sh
RUN chmod +x /scripts/start.sh
ADD scripts/tomcat_exporter.tar /scripts/
CMD ["/bin/sh","-c","/scripts/start.sh $DB_HOST $DB_PORT $DB_SCHEMA $DB_USER $DB_PWD"]
6 changes: 6 additions & 0 deletions cmdb-plugin/scripts/start-tomcat-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

sleep 3m
echo "About to start tomcat exporter..."
/bin/sh /scripts/tomcat_exporter/start.sh

6 changes: 5 additions & 1 deletion cmdb-plugin/scripts/start.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ JAVA_OPT="-Xmx3G -Xms512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:MaxTenuring
JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/data/wecmdb/log/wecmdb_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy"
JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"

/bin/sh /scripts/tomcat_exporter/start.sh
nohup /scripts/start-tomcat-exporter.sh > /tmp/jmx.log 2>&1 &

echo "About to start wecmdb..."

mkdir -p /data/wecmdb/log

java ${JAVA_OPT} -Duser.timezone=Asia/Shanghai \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=18082 \
Expand Down

0 comments on commit 086e4b7

Please sign in to comment.