spring-boot和jboss应用添加pinpiont方式

一、jboss应用

添加方式,添加方式,在run.conf文件配置pinpoint相关信息,如下:

if [ "x$JAVA_OPTS" = "x" ]; then
      JAVA_OPTS="-Xmx4096m -Xms4096m -Xss512K -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./java_dump$$.hprof -Xloggc:/app/jboss/jboss-as/gc_logs/EDMS_JBOSS_WEB_R2S_02/gc$$.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+DisableExplicitGC -XX:+ExplicitGCInvokesConcurrent -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 -XX:GCLogFileSize=5M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"

fi

# Sample JPDA settings for remote socket debuging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging 
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

JAVA_OPTS="$JAVA_OPTS \
     -Djava.rmi.server.hostname=10.204.53.73 \
     -Dcom.sun.management.jmxremote.port=18053 \
     -Dcom.sun.management.jmxremote.ssl=false \
     -Dcom.sun.management.jmxremote.password.file=/app/jboss/jboss-as/server/EDMS_JBOSS_WEB_R2S_02/conf/jmx/jmxremote.password \
     -Dcom.sun.management.jmxremote.access.file=/app/jboss/jboss-as/server/EDMS_JBOSS_WEB_R2S_02/conf/jmx/jmxremote.access \
     -Djboss.platform.mbeanserver \
     -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl \
     -javaagent:/app/pinpoint-agent/pinpoint-bootstrap-1.7.3.jar \
     -Dpinpoint.agentId=EDMS_**_02 \
     -Dpinpoint.applicationName=EDMS_**_02"

  

 

二、spring-boot应用

添加方式,在启动脚本配置pinpoint相关信息,如下:

#! /bin/sh  
JMX_PORT="1026"
INSTANCE="gateway_web_01"
LISTEN_IP="10.204.53.62"
SPRING_HOME="/app/spring-boot"
JAVA_OPTS="-server -Xms4096m -Xmx4096m -Xmn2g -Xss256K \
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:CMSInitiatingOccupancyFraction=75 \
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseCMSInitiatingOccupancyOnly \
-javaagent:/app/pinpoint-agent/pinpoint-bootstrap-1.7.3.jar \
-Dpinpoint.agentId=gateway_web_pet_01 \
-Dpinpoint.applicationName=gateway_web_pet"
JAR_NAME="gateway-web.jar"

start(){
        export LD_PRELOAD=/usr/lib64/connect_hack.so
        export DEFAULT_BIND_RULE_IPV4=$LISTEN_IP
        sudo $SPRING_HOME/bin/start.sh $INSTANCE $LISTEN_IP $SPRING_HOME "$JMX_PORT" "$JAVA_OPTS" "$JAR_NAME"
}

stop(){
        sudo $SPRING_HOME/bin/stop.sh $INSTANCE $SPRING_HOME
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        *)
        printf 'Usage: %s {start|stop|restart}\n' "$prog"
        exit 1
        ;;
esac

 

转载于:https://www.cnblogs.com/dayiran1222/p/10973265.html

你可能感兴趣的:(java)