DBILITY

tomcat jmx connection 본문

was

tomcat jmx connection

DBILITY 2023. 11. 22. 11:56
반응형

CATALINA_OPS에
옵션
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=PORT \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Djava.rmi.server.hostname=REAL_IP_ADDRESS
을 추가 후 재시작, 원격서버일 경우 localhost나 127.0.0.1을 입력하면 접근 안되더라는

socket오류 등이 발생한다면 서버측 방화벽 확인이 필요하다. 

#!/bin/sh

export CATALINA_HOME=/opt/tomcat
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=PORT \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Djava.rmi.server.hostname=REAL_IP_ADDRESS"


/bin/su -p -s /bin/sh root $CATALINA_HOME/bin/shutdown.sh

sleep 10

if [ -z "`ps -eaf | grep java | grep /opt/tomcat/bin`" ]; then
        echo "Tomcat was terminated successfully."
else
        ps -eaf | grep java | grep /opt/tomcat/bin/ | awk '{print $2}' |
        while read PID
        do
         echo "Killing $PID.."
         kill -9 $PID
         echo "Tomcat is being shutdowned"
         done

fi

sleep 10

/bin/su -p -s /bin/sh root $CATALINA_HOME/bin/startup.sh

if [ -z "`ps -eaf | grep java | grep /opt/tomcat/bin`" ]; then
        echo "Error!! Tomcat Cannot start."
else
        echo "Tomcat start successfully."
fi

jconsole -debug 실행

반응형

'was' 카테고리의 다른 글

tomcat version 확인  (0) 2024.04.24
tomcat restart shell script, once scheduling with at command  (0) 2023.08.22
linux apache 동시 접속 수 확인  (0) 2023.02.13
tomcat version information command  (0) 2022.08.09
tomcat cache error  (0) 2022.08.04
Comments