Unverified Commit 2ba13475 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Feature] Add gc startup parameters and Support configuration DINKY_HOME (#3423)

parent 29a11a5c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!--status用于设置log4j2框架内部的日志信息输出,设置成OFF将禁止log4j2内部日志输出,毕竟这个日志对我们没有什么作用,如果设置成trace,你会看到log4j2内部各种详细输出;monitorInterval是监控间隔,例如下面的设置是指:log4j2每隔600秒自动监控该配置文件是否有变化,如果有变化,则根据文件内容新的配置生成日志--> <!--status用于设置log4j2框架内部的日志信息输出,设置成OFF将禁止log4j2内部日志输出,毕竟这个日志对我们没有什么作用,如果设置成trace,你会看到log4j2内部各种详细输出;monitorInterval是监控间隔,例如下面的设置是指:log4j2每隔600秒自动监控该配置文件是否有变化,如果有变化,则根据文件内容新的配置生成日志-->
<configuration status="OFF" monitorInterval="600"> <configuration status="OFF" monitorInterval="600">
<Properties> <Properties>
<property name="LOG_PATH">./logs/</property> <property name="LOG_PATH" >${sys:dinky.logs.path:-./logs/}</property>
<property name="LOG_FILE">dinky</property> <property name="LOG_FILE">dinky</property>
</Properties> </Properties>
<!--定义添加器--> <!--定义添加器-->
......
...@@ -24,7 +24,6 @@ export const transformPushDolphinParams = ( ...@@ -24,7 +24,6 @@ export const transformPushDolphinParams = (
pushDolphinParams: PushDolphinParams, pushDolphinParams: PushDolphinParams,
toFormValues: boolean toFormValues: boolean
) => { ) => {
if (toFormValues && dolphinTaskDefinition) { if (toFormValues && dolphinTaskDefinition) {
const transformValue: PushDolphinParams = { const transformValue: PushDolphinParams = {
...pushDolphinParams, ...pushDolphinParams,
......
...@@ -323,7 +323,7 @@ export interface PushDolphinParams { ...@@ -323,7 +323,7 @@ export interface PushDolphinParams {
isCache: boolean | string; isCache: boolean | string;
timeoutNotifyStrategy: string[] | string; timeoutNotifyStrategy: string[] | string;
description: string; description: string;
taskGroupPriority:number taskGroupPriority: number;
} }
export type ButtonRoute = { export type ButtonRoute = {
......
...@@ -2,8 +2,19 @@ ...@@ -2,8 +2,19 @@
FLINK_VERSION=${2} FLINK_VERSION=${2}
DINKY_HOME=${DINKY_HOME:-$(cd `dirname $0`; pwd)}
APP_HOME="$(cd `dirname $0`; pwd)" APP_HOME="${DINKY_HOME}"
DINKY_LOG_PATH="${APP_HOME}/logs/"
if [ ! -d "${DINKY_LOG_PATH}" ]; then
mkdir -p "${DINKY_LOG_PATH}"
fi
CUSTOMER_JAR_PATH="${APP_HOME}/customJar"
if [ ! -d "${CUSTOMER_JAR_PATH}" ]; then
mkdir -p "${CUSTOMER_JAR_PATH}"
fi
EXTENDS_HOME="${APP_HOME}/extends" EXTENDS_HOME="${APP_HOME}/extends"
...@@ -29,14 +40,26 @@ assertIsInputVersion() { ...@@ -29,14 +40,26 @@ assertIsInputVersion() {
} }
# Use FLINK_HOME: # Use FLINK_HOME:
CLASS_PATH="${APP_HOME}:${APP_HOME}/lib/*:${APP_HOME}/config:${EXTENDS_HOME}/*:${APP_HOME}/customJar/*:${EXTENDS_HOME}/flink${FLINK_VERSION}/dinky/*:${EXTENDS_HOME}/flink${FLINK_VERSION}/*" CLASS_PATH="${APP_HOME}:${APP_HOME}/lib/*:${APP_HOME}/config:${EXTENDS_HOME}/*:${CUSTOMER_JAR_PATH}/*:${EXTENDS_HOME}/flink${FLINK_VERSION}/dinky/*:${EXTENDS_HOME}/flink${FLINK_VERSION}/*"
PID_FILE="dinky.pid" PID_FILE="dinky.pid"
# Log configuration file path
LOG_CONFIG=${APP_HOME}/config/log4j2.xml
# JVM options G1GC and OOM dump ; Note: Do not set the DisableExplicitGC parameter. Because there is a call to System. gc() in the code.
GC_OPT="-XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintGCCause -Xloggc:${APP_HOME}/logs/gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"
# OOM dump path
OOM_OPT="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${APP_HOME}/logs/heapdump.hprof"
# JVM parameters and log path
PARAMS_OPT="-Ddinky.logs.path=${DINKY_LOG_PATH} -Ddruid.mysql.usePingMethod=false -Dlog4j2.isThreadContextMapInheritable=true"
# JAR parameters
JAR_PARAMS_OPT="--logging.config=${LOG_CONFIG}"
# JMX path # JMX path
JMX="-javaagent:$APP_HOME/lib/jmx_prometheus_javaagent-0.20.0.jar=10087:$APP_HOME/config/jmx/jmx_exporter_config.yaml" JMX="-javaagent:$APP_HOME/lib/jmx_prometheus_javaagent-0.20.0.jar=10087:$APP_HOME/config/jmx/jmx_exporter_config.yaml"
#JVM OPTS
JVM_OPTS="-Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M"
# Check whether the pid path exists # Check whether the pid path exists
PID_PATH="$(cd "$(dirname "$0")";pwd)/run" PID_PATH="${APP_HOME}/run"
if [ -d "${PID_PATH}" ];then if [ -d "${PID_PATH}" ];then
echo "${PID_PATH} is already exist." >> /dev/null echo "${PID_PATH} is already exist." >> /dev/null
...@@ -67,7 +90,7 @@ start() { ...@@ -67,7 +90,7 @@ start() {
assertIsInputVersion assertIsInputVersion
updatePid updatePid
if [ -z "$pid" ]; then if [ -z "$pid" ]; then
nohup java -Ddruid.mysql.usePingMethod=false -Dlog4j2.isThreadContextMapInheritable=true -Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -cp "${CLASS_PATH}" org.dinky.Dinky > /dev/null 2>&1 & nohup java ${PARAMS_OPT} ${JVM_OPTS} ${OOM_OPT} ${GC_OPT} ${PARAMS_OPT} -Xverify:none -cp "${CLASS_PATH}" org.dinky.Dinky ${JAR_PARAMS_OPT} > /dev/null 2>&1 &
echo $! >"${PID_PATH}"/${PID_FILE} echo $! >"${PID_PATH}"/${PID_FILE}
echo "FLINK VERSION : $FLINK_VERSION" echo "FLINK VERSION : $FLINK_VERSION"
echo "........................................Start Dinky Successfully........................................" echo "........................................Start Dinky Successfully........................................"
...@@ -80,7 +103,7 @@ startOnPending() { ...@@ -80,7 +103,7 @@ startOnPending() {
assertIsInputVersion assertIsInputVersion
updatePid updatePid
if [ -z "$pid" ]; then if [ -z "$pid" ]; then
java -Ddruid.mysql.usePingMethod=false -Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -cp "${CLASS_PATH}" org.dinky.Dinky java ${PARAMS_OPT} ${JVM_OPTS} ${OOM_OPT} ${GC_OPT} ${PARAMS_OPT} -Xverify:none -cp "${CLASS_PATH}" org.dinky.Dinky ${JAR_PARAMS_OPT}
echo "........................................Start Dinky Successfully........................................" echo "........................................Start Dinky Successfully........................................"
else else
echo "Dinky pid $pid is in ${PID_PATH}/${PID_FILE}, Please stop first !!!" echo "Dinky pid $pid is in ${PID_PATH}/${PID_FILE}, Please stop first !!!"
...@@ -91,7 +114,7 @@ startWithJmx() { ...@@ -91,7 +114,7 @@ startWithJmx() {
assertIsInputVersion assertIsInputVersion
updatePid updatePid
if [ -z "$pid" ]; then if [ -z "$pid" ]; then
nohup java -Ddruid.mysql.usePingMethod=false -Xms512M -Xmx2048M -XX:PermSize=512M -XX:MaxPermSize=1024M -XX:+HeapDumpOnOutOfMemoryError -Xverify:none "${JMX}" -cp "${CLASS_PATH}" org.dinky.Dinky > /dev/null 2>&1 & nohup java ${PARAMS_OPT} ${JVM_OPTS} ${OOM_OPT} ${GC_OPT} ${PARAMS_OPT} -Xverify:none "${JMX}" -cp "${CLASS_PATH}" org.dinky.Dinky ${JAR_PARAMS_OPT} > /dev/null 2>&1 &
# echo $! >"${PID_PATH}"/${PID_FILE} # echo $! >"${PID_PATH}"/${PID_FILE}
updatePid updatePid
echo "........................................Start Dinky with Jmx Successfully..................................... echo "........................................Start Dinky with Jmx Successfully.....................................
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment