You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/01/04 11:12:51 UTC
[incubator-inlong] branch master updated: [INLONG-2098] optimize the script and template (#2100)
This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new aa6b8eb [INLONG-2098] optimize the script and template (#2100)
aa6b8eb is described below
commit aa6b8eb16bc13232e22b920e2ef61879b6c59e9b
Author: dockerzhang <do...@apache.org>
AuthorDate: Tue Jan 4 19:12:45 2022 +0800
[INLONG-2098] optimize the script and template (#2100)
Co-authored-by: dockerzhang <do...@tencent.com>
---
.github/ISSUE_TEMPLATE/bug-report.yml | 5 +++--
.github/ISSUE_TEMPLATE/improve-request.yml | 1 +
inlong-agent/bin/agent-env.sh | 16 ++++++++++++----
inlong-agent/bin/agent.sh | 2 +-
inlong-agent/conf/agent.properties | 2 +-
5 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index a57d378..a2edd3d 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -75,8 +75,8 @@ body:
Which version of Apache InLong are you using?
multiple: false
options:
- - '0.9.0'
- - '0.10.0 RC1'
+ - '0.11.0'
+ - '0.12.0'
- 'master'
validations:
required: true
@@ -95,6 +95,7 @@ body:
- 'InLong DataProxy-SDK'
- 'InLong TubeMQ'
- 'InLong Sort'
+ - 'InLong Audit'
- 'Other for not specified component'
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/improve-request.yml b/.github/ISSUE_TEMPLATE/improve-request.yml
index 13e0bad..f1e459f 100644
--- a/.github/ISSUE_TEMPLATE/improve-request.yml
+++ b/.github/ISSUE_TEMPLATE/improve-request.yml
@@ -46,6 +46,7 @@ body:
- 'InLong DataProxy-SDK'
- 'InLong TubeMQ'
- 'InLong Sort'
+ - 'InLong Audit'
- 'Other for not specified component'
validations:
required: true
diff --git a/inlong-agent/bin/agent-env.sh b/inlong-agent/bin/agent-env.sh
index e19fa35..2a29b9e 100755
--- a/inlong-agent/bin/agent-env.sh
+++ b/inlong-agent/bin/agent-env.sh
@@ -29,9 +29,11 @@ chown -R $AS_USER $LOG_DIR
# find java home
if [ -z "$JAVA_HOME" ]; then
- export JAVA=`which java`
+ export JAVA=$(which java)
+ export JPS=$(which jps)
else
export JAVA="$JAVA_HOME/bin/java"
+ export JPS="$JAVA_HOME/bin/jps"
fi
HEAP_OPTS="-Xmx1024m -Xms512m"
@@ -39,7 +41,13 @@ GC_OPTS="-XX:SurvivorRatio=6 -XX:+UseMembar -XX:+UseConcMarkSweepGC -XX:+CMSPara
AGENT_JVM_ARGS="$HEAP_OPTS $GC_OPTS"
# Add Agent Rmi Args when necessary
-# AGENT_RMI_ARGS="-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
-
+AGENT_RMI_ARGS="-Dcom.sun.management.jmxremote \
+-Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
export CLASSPATH=$CLASSPATH:$BASE_DIR/conf:$(ls $BASE_DIR/lib/*.jar | tr '\n' :)
-export AGENT_ARGS="$AGENT_JVM_ARGS -cp $CLASSPATH -Dagent.home=$BASE_DIR -Dlog4j.configuration=file:$BASE_DIR/conf/log4j.properties"
+
+JMX_ENABLED=$(grep -c "agent.prometheus.enable=false" $BASE_DIR/conf/agent.properties)
+if [[ $JMX_ENABLED == 1 ]]; then
+ export AGENT_ARGS="$AGENT_JVM_ARGS $AGENT_RMI_ARGS -cp $CLASSPATH -Dagent.home=$BASE_DIR -Dlog4j.configuration=file:$BASE_DIR/conf/log4j.properties"
+else
+ export AGENT_ARGS="$AGENT_JVM_ARGS -cp $CLASSPATH -Dagent.home=$BASE_DIR -Dlog4j.configuration=file:$BASE_DIR/conf/log4j.properties"
+fi
\ No newline at end of file
diff --git a/inlong-agent/bin/agent.sh b/inlong-agent/bin/agent.sh
index b8b2ebc..efb6e23 100755
--- a/inlong-agent/bin/agent.sh
+++ b/inlong-agent/bin/agent.sh
@@ -34,7 +34,7 @@ function help() {
function running(){
if [ -f "$PID_FILE" ]; then
pid=$(cat "$PID_FILE")
- process=`ps aux | grep "$pid" | grep -v grep`;
+ process=$("$JPS" | grep "$pid" | grep -v grep)
if [ "$process" == "" ]; then
return 1;
else
diff --git a/inlong-agent/conf/agent.properties b/inlong-agent/conf/agent.properties
index 15635da..8fa9b64 100755
--- a/inlong-agent/conf/agent.properties
+++ b/inlong-agent/conf/agent.properties
@@ -107,6 +107,6 @@ agent.manager.vip.http.port=
# prometheus config
############################
# whether to enable prometheus
-agent.prometheus.enable=false
+agent.prometheus.enable=true
# prometheus exporter server default port
agent.prometheus.exporter.port=8080