티스토리 뷰

자바 어플리케이션을 모니터링 하기 위해서는 APM Tool 이나 Jstat, Jmap 등과 같은 Java command 로 확인이 가능하다. 하지만 서버 Console에서 메모리, CPU 사용율을 간단히 확인하고 싶을 때 각종 유,무료 APM Tool은 너무 거창하고 Jstat 같은 command 명령어는 시각화 부분이 아쉽다. 이럴 때 사용할 수 있는 JVM-mon 이라는 오픈소스툴을 소개하려 한다.

다운로드 및 압축해제

$wget https://github.com/ajermakovics/jvm-mon/releases/download/0.3/jvm-mon-0.3.tar.gz

--2019-11-27 09:04:46--  https://github.com/ajermakovics/jvm-mon/releases/download/0.3/jvm-mon-0.3.tar.gz
Resolving github.com (github.com)... 52.78.231.108
Connecting to github.com (github.com)|52.78.231.108|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/81111993/bb9e0da4-130c-11e7-9090-4462f6b2d39c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191127T000446Z&X-Amz-Expires=300&X-Amz-Signature=f9ad0819c1bd79cbd77ff64106f18d0eeedc425692d8f22776a1912faa327ebf&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djvm-mon-0.3.tar.gz&response-content-type=application%2Foctet-stream [following]
--2019-11-27 09:04:46--  https://github-production-release-asset-2e65be.s3.amazonaws.com/81111993/bb9e0da4-130c-11e7-9090-4462f6b2d39c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191127T000446Z&X-Amz-Expires=300&X-Amz-Signature=f9ad0819c1bd79cbd77ff64106f18d0eeedc425692d8f22776a1912faa327ebf&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djvm-mon-0.3.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.200.83
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.200.83|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21444288 (20M) [application/octet-stream]
Saving to: 'jvm-mon-0.3.tar.gz'

jvm-mon-0.3.tar.gz                                                                         100%[========================================================================================================================================================================================================================================>]  20.45M  1.03MB/s    in 23s

2019-11-27 09:05:10 (923 KB/s) - 'jvm-mon-0.3.tar.gz' saved [21444288/21444288]

$tar xvf ./jvm-mon-0.3.tar.gz

 

JAVA_HOME 등록

JAVA_HOME 경로가 환경 변수에 등록되지 않았다면 등록해줘야 한다. echo 명령어로 확인해보자

$ echo ${JAVA_HOME}
					//빈 라인을 출력 profile 에 자바 홈등록
                    
//자바설치위치 찾기
$ which javac
/usr/bin/javac
$ readlink -f /usr/bin/javac
/usr/lib/jvm/zulu-8-amd64/bin/javac

//profile 에 등록
$sudo vi /etc/profile

~~~~~~~~~~~~~~~~profile 내용 생략
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

export JAVA_HOME=/usr/lib/jvm/zulu-8-amd64



//변경사항 적용
$source /etc/profile

 

JVM-mom 실행

$~/jvm-mon-0.3/bin/jvm-mon

OpenJDK 64-Bit Server VM warning: You have loaded library /home/hsquare/jvm-mon-0.3/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

 

 

더 많은 정보는 아래 링크를 참고

https://github.com/ajermakovics/jvm-mon

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크