SlideShare a Scribd company logo
1 of 53
Download to read offline
JBoss RHQ와 Byteman을 이용한
오픈소스 자바 애플리케이션 모니터링


     JBoss User Group Community
           RHQ Contributor
                원종석
Break the Ice


 • 보통 개발자의 두 가지 무기에 관한 이야기

 • 비상시 유용한 오픈 소스 프로젝트 소개

 • 운영 서비스 모니터링은 RHQ

 • 운영 중인 JVM bytecode 들여다 볼 때는 Byteman

 • Thanks a lot JBoss!!

 • 그리고 Welcome to Korea JBoss User Group!!

 • 언제나 환영합니다.




                              -1-
About me?


 • 그냥 딸 바보 아빠

 • 오픈 소스로 일하는 보통 자바 개발자

 • 대형 SI 개발, 운영, SA

 • Workflow 솔루션, Big Data 플랫폼 개발

 • 실시간 대용량 Event 처리 플랫폼 개발

 • JBoss User Group Community 부대표

 • RHQ Contributor - 한글화 작업

 • tedwon.com WIKI 운영


                              -2-
Agenda


 • RHQ 소개


 • Byteman 소개


 • Demo




                -3-
Open Source Monitoring & Management Project




                    -4-
For Instance


 • 내가 만든 Java Application을 모니터링하고 싶다.

 • 장기간 지속적으로... Chart도 필요하고... Statistics도 필요하고...

 • 직접 만들려고 해보면 너무 일이 커지고

 • 돈 주고 사기에는 너무 비싸고

 • 손쉽게 공짜로 사용 할 수 있는 것 어디 없을까?

 • 게다가 좀 더 체계적이고 다양한 기능을 제공했으면 좋겠다.




                              -5-
완전 공짜

  -6-
RHQ would be one of the Solutions!




                            -7-
RHQ 4’s New Features


 • New Ajax Dynamic GUI

 • Use Java SE 6 Script Feature for RHQ CLI

 • REST API (under development)




                                    -8-
RHQ would be one of the Solutions!




                            -9-
RHQ would be one of the Solutions!




                            - 10 -
RHQ would be one of the Solutions!




                            - 11 -
RHQ would be one of the Solutions!




                            - 12 -
RHQ Project Home




                   http://rhq-project.org

               http://www.jboss.org/jopr




                            - 13 -
Conclusions in Advance


 Step 1. RHQ Server 와 Agent 설치

 Step 2. Java Application에 JMX MBean 추가

 Step 3. JMX MBean 기반 Plugin Descriptor XML 파일 정의

 Step 4. 나의 Application용 JMX Plugin을 RHQ Server에 등록

 Step 5. 모니터링 및 관리 시작!!




                                 - 14 -
RHQ by JBoss

 • JBoss Enterprise Management Platform

 • JBoss Middleware 제품의 모니터링 Platform

    o   JBoss AS
    o   Byteman
    o   Hibernate
    o   HornetQ
    o   Infinispan
    o   BlackTie
    o   Mobicents
    o   CirrAS
    o   etc ...




                                  - 15 -
What is RHQ?


 • Make technologies more manageable!!


 • Aims to develop a common services management platform


 • Java 기반의 Open Source System Management Project


 • Sigar API 를 사용하여 System Information Gathering (CPU, Mem)


 • JMX 기술 기반으로 원격 관리 기능 제공 - JMX Plugin


 • OS 플랫폼에서 Server 리소스까지 전반적인 모니터링/관리 기능 제공



                                  - 16 -
What is RHQ?


 • Agent의 plugin을 통해서 모니터링 정보 수집


 • 필요한 plugin만 구성해서 사용하면 적절


 • 실시간 모니터링 서버는 아님 - 최소 30초 주기로 모니터링


 • 장기간 모니터링에 적합




                          - 17 -
RHQ Server & Agent Architecture




                            - 18 -
RHQ Management Functionality


 • Inventory

 • Monitoring

 • Configuration

 • Events

 • Control




                          - 19 -
RHQ Management Functionality


 • Inventory
    o 모니터링 대상 정의/등록/관리
    o Resource directory

 • Monitoring
    o Monitoring any resource
    o Automatic discovery of resources
    o Monitoring for availability and performance
    o Complex alerting

 • Configuration
    o Configuration management
    o Audited, validated configuration editing and history




                                      - 20 -
RHQ Management Functionality


 • Events
    o WAS의 로그 에러 트래킹과 레포트



 • Control
    o 원격에서 operation 실행
    o Operation 스케쥴링




                          - 21 -
RHQ Monitor Architecture

 • 모니터링 대상을 Resource 라고 통칭한다.



                                    OS

                                    Process




                           - 22 -
RHQ Agent Plugins


 • 다양한 리소스를 위한 Plugin 제공

 • Server Plugins: Apache, Tomcat, JBoss AS

 • RDBMS Plugins: MySQL, PostgreSQL, Oracle

 • Java JMX Plugin

 • C daemon 프로세스 (Ex: Scribe Log Aggregator)

 • 필요에 맞는 Custom Plugin 제작 가능

 • http://rhq-project.org/display/RHQ/Plugin+Community




                                    - 23 -
RHQ Related Links



                     RHQ User Documentation

                RHQ Server Installation Guide

                     RHQ Server Users Guide

                     RHQ Agent Users Guide

                    Frequently Asked Questions

              http://tedwon.com/display/dev/RHQ




                               - 24 -
RHQ / JBoss ON Team

 • Red Hat building in Westford, Massachusetts




                                    - 25 -
RHQ Contributions


 • Installer UI 한글화 작업 완료 from v4.2

 • GWT UI 한글화 작업 진행 중...




                                         그냥 - Ted Won
    Red Hat - Heiko Rupp




                                - 26 -
- 27 -
http://www.jboss.org/byteman




            - 28 -
보통 개발자의 또 하나의 무기 Byteman

       명품 영국제 무기

      Thanks Andrew :-)




             - 29 -
Where to use?


 • Performance check
 • System.exit() and System.gc() check

 • synchronized block check

 • Analyze 3rd party library, WAS, etc




                                         - 30 -
Byte(code) man(ipulation) is


 • 안전하게 실행 중인 JVM 안의 bytecode 들여다 보는 도구

 • 디버깅 코드를 동적으로 삽입할 수 있는 도구

 • Tool that simplifies tracing and testing of Java programs

 • Bytecode Injection 방식 사용

 • 재컴파일, 재구동 없이 실행 중인 애플리케이션에 bytecode inject 가능

 • Works by modifying the bytecode of your application at runtime
   o 소스 코드 없이 동적으로 bytecode를 직접 변경




                                        - 30 -
Byte(code) man(ipulation) is


 • Java Agent API를 기반으로 Byteman Agent 구현
    o java.lang.instrument API for runtime bytecode transformation



 • Byteman is a Java agent program
    o Retransform code only after load



 • Injected codes are reversible
    o Inject된 bytecode는 다시 원복 가능




                                       - 31 -
Byteman Rule Script is


 • Rule based scripting language

 • Write code to see what code is doing

 • Very Java oriented (almost all Java)

 • We inject codes through rule script files

 • Event Condition Action (ECA) 으로 정의하는 scripting language

 • Dynamically load, reload or unload rules

 • BTrace는 rule 대신 annotation-oriented script 정의




                                          - 32 -
Sample Byteman Rule Script


RULE trace main entry
CLASS MyAppMain
METHOD main
AT ENTRY
IF true
DO
traceln("entering main")
ENDRULE




                             - 33 -
Sample Byteman Rule Script


RULE trace main entry => Rule name
CLASS MyAppMain
METHOD main
AT ENTRY
IF true
DO
traceln("entering main")
ENDRULE




                             - 34 -
Sample Byteman Rule Script


RULE trace main entry
CLASS MyAppMain => Event (Trigger point)
METHOD main
AT ENTRY
IF true
DO
traceln("entering main")
ENDRULE




                             - 35 -
Sample Byteman Rule Script


RULE trace main entry
CLASS MyAppMain
METHOD main
AT ENTRY
IF true => Condition
DO
traceln("entering main")
ENDRULE




                             - 36 -
Sample Byteman Rule Script


RULE trace main entry
CLASS MyAppMain
METHOD main
AT ENTRY
IF true
DO
traceln("entering main") => Action
ENDRULE




                               - 37 -
Event Condition Action Rules


 • Event
    o CLASS/INTERFACE, METHOD, AT
        defines trigger point(s) for rule


 • Binding
    o introduces/initializes rule variables



 • Condition
    o Java boolean expression



 • Action
    o one or more Java expressions




                                          - 38 -
Driving Byteman


 • Download Byteman and unzip

 • Set BYTEMAN_HOME

 • Install as “Java agent” through java options => 서버 재구동

         -javaagent:$BYTEMAN_HOME/lib/byteman.jar=agentoptions

    o   script:script.btm install rules from script.btm at agent startup
    o   boot:my.jar add my.jar to bootstrap classpath
    o   sys:my.jar add my.jar to system classpath
    o   listener:true start up agent listener
    o   port:999 use listener port 999
    o   address:192.168.0.1 use listener host 192.168.0.1




                                           - 39 -
Driving Byteman

 • Download Byteman and unzip
 • Set BYTEMAN_HOME




                                - 40 -
Running JBoss AS with Byteman

 • run-with-byteman.sh
    o 시작 스크립트에 아래 두 라인 추가
    o Tomcat 또한 동일



BYTEMAN_OPTS="-Dorg.jboss.byteman.verbose=true
       -Dorg.jboss.byteman.debug=true
       -Dorg.jboss.byteman.transform.all
       -javaagent:byteman.jar=
       script:my-byteman-rules.txt
       ,boot:byteman.jar
       ,boot:byteman-sample.jar
       ,sys:byteman-sample.jar
       ,listener:true
       ,port:9551
       ,address:127.0.0.1"

JAVA_OPTS="$BYTEMAN_OPTS -Xms1g -Xmx1g $JAVA_OPTS"


                                - 41 -
Quick Start - MyAppMain.java

package org.my;

public class MyAppMain {

    public static void main(String[] args) {

        for (int i = 0; i < args.length; i++) {
             System.out.println(args[i]);
        }
    }
}

$ java org.my.MyAppMain foo bar baz
foo
bar
baz



                                             - 42 -
Quick Start - appmain.btm

MyAppMain 클래스의 main 메소드 호출 시작시에 로그를 출력하라.

RULE trace main entry
CLASS MyAppMain
METHOD main
AT ENTRY
IF true
DO traceln("entering main")
ENDRULE




                              - 43 -
Load Rules at JVM Start



$ java -javaagent:byteman.jar=script:appmain.btm
org.my.MyAppMain foo bar baz


entering main
foo
bar
baz
$




                                 - 44 -
Byteman Built In Methods


 • Tracing
    o traceOpen, traceClose, traceln, traceStack, ...

 • Managing Shared Rule State
    o flag, clear, countDown, incrementCounter, ...

 • Timing
    o createTimer, getElapsedTime, resetTimer

 • Checking Caller Stack
    o callerEquals, callerMatches

 • Thread Synchronization
    o delay, waitFor, signalWake, rendezvous, ...

 • Recursive Trigger Management
    o setTriggering



                                         - 45 -
Refer to Byteman Programmer’s Guide

   http://tedwon.com/display/dev/Byteman




                    - 46 -
Byteman Versions




                   - 47 -
DEMO



 - 48 -
• RHQ Demo
   o Dashboard
   o Custom Java App
   o Alert
   o JBoss AS Cluster Group View
• Byteman Demo
   o Install byteman agent at start up
   o Install byteman agent into a running jvm
   o Load Rule
   o Unload Rule
• Byteman Plugin Demo
   o Autodiscovery Byteman Agent
   o Monitor Byteman Agent Availability & Rules




                                    - 49 -
Thanks
iamtedwon@gmail.com
JBoss RHQ와 Byteman을 이용한 오픈소스 자바 애플리케이션 모니터링

More Related Content

What's hot

[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance TuningJi-Woong Choi
 
Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법정수 한
 
Scouter Tutorial & Sprint
Scouter Tutorial & SprintScouter Tutorial & Sprint
Scouter Tutorial & SprintGunHee Lee
 
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)Ji-Woong Choi
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우jieunsys
 
Pinpoint spring_camp 2015
Pinpoint spring_camp 2015Pinpoint spring_camp 2015
Pinpoint spring_camp 2015Woonduk-Kang
 
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어NHN FORWARD
 
오픈소스 모니터링비교
오픈소스 모니터링비교오픈소스 모니터링비교
오픈소스 모니터링비교sprdd
 
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)I Goo Lee
 
[오픈소스컨설팅]Fault Tolerance Architecture by Netflix
[오픈소스컨설팅]Fault Tolerance Architecture by Netflix[오픈소스컨설팅]Fault Tolerance Architecture by Netflix
[오픈소스컨설팅]Fault Tolerance Architecture by NetflixJi-Woong Choi
 
E2E-Monitor와 Pinpoint 비교
E2E-Monitor와 Pinpoint 비교E2E-Monitor와 Pinpoint 비교
E2E-Monitor와 Pinpoint 비교Jung Kim
 
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration GuideJi-Woong Choi
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211Ji-Woong Choi
 
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례Jemin Huh
 
JVM과 톰캣 튜닝
JVM과 톰캣 튜닝JVM과 톰캣 튜닝
JVM과 톰캣 튜닝Mungyu Choi
 
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3Ji-Woong Choi
 
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)Osc Osc
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축I Goo Lee
 
[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들NHN FORWARD
 

What's hot (20)

Opensource apm scouter in practice
Opensource apm scouter in practiceOpensource apm scouter in practice
Opensource apm scouter in practice
 
[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning
 
Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법
 
Scouter Tutorial & Sprint
Scouter Tutorial & SprintScouter Tutorial & Sprint
Scouter Tutorial & Sprint
 
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
Pinpoint spring_camp 2015
Pinpoint spring_camp 2015Pinpoint spring_camp 2015
Pinpoint spring_camp 2015
 
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
 
오픈소스 모니터링비교
오픈소스 모니터링비교오픈소스 모니터링비교
오픈소스 모니터링비교
 
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
 
[오픈소스컨설팅]Fault Tolerance Architecture by Netflix
[오픈소스컨설팅]Fault Tolerance Architecture by Netflix[오픈소스컨설팅]Fault Tolerance Architecture by Netflix
[오픈소스컨설팅]Fault Tolerance Architecture by Netflix
 
E2E-Monitor와 Pinpoint 비교
E2E-Monitor와 Pinpoint 비교E2E-Monitor와 Pinpoint 비교
E2E-Monitor와 Pinpoint 비교
 
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
 
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
 
JVM과 톰캣 튜닝
JVM과 톰캣 튜닝JVM과 톰캣 튜닝
JVM과 톰캣 튜닝
 
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
 
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축
 
[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들
 

Similar to JBoss RHQ와 Byteman을 이용한 오픈소스 자바 애플리케이션 모니터링

장고로 웹서비스 만들기 기초
장고로 웹서비스 만들기   기초장고로 웹서비스 만들기   기초
장고로 웹서비스 만들기 기초Kwangyoun Jung
 
Service operation
Service operationService operation
Service operationTerry Cho
 
Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료Han Sung Kim
 
[오픈소스컨설팅] OpenShift PaaS Platform How-to
[오픈소스컨설팅] OpenShift PaaS Platform How-to[오픈소스컨설팅] OpenShift PaaS Platform How-to
[오픈소스컨설팅] OpenShift PaaS Platform How-toJi-Woong Choi
 
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안Opennaru, inc.
 
20170813 django api server unit test and remote debugging
20170813 django api server unit test and remote debugging20170813 django api server unit test and remote debugging
20170813 django api server unit test and remote debuggingJongwon Han
 
171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계우진 신
 
Cloud life seminar open shift,이준영(배포용)
Cloud life seminar   open shift,이준영(배포용)Cloud life seminar   open shift,이준영(배포용)
Cloud life seminar open shift,이준영(배포용)Software in Life
 
Infra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInfra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInho Kang
 
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)삵 (sarc.io)
 
Openshift 활용을 위한 Application의 준비, Cloud Native
Openshift 활용을 위한 Application의 준비, Cloud NativeOpenshift 활용을 위한 Application의 준비, Cloud Native
Openshift 활용을 위한 Application의 준비, Cloud Nativerockplace
 
젠킨스 설치 및 설정
젠킨스 설치 및 설정젠킨스 설치 및 설정
젠킨스 설치 및 설정중선 곽
 
practical perf testing - d2startup
practical perf testing - d2startuppractical perf testing - d2startup
practical perf testing - d2startupJunHo Yoon
 
Meetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsMeetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsminseok kim
 
Source To URL Without Dockerfile
Source To URL Without DockerfileSource To URL Without Dockerfile
Source To URL Without DockerfileWon-Chon Jung
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇BOAZ Bigdata
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기Brian Hong
 

Similar to JBoss RHQ와 Byteman을 이용한 오픈소스 자바 애플리케이션 모니터링 (20)

장고로 웹서비스 만들기 기초
장고로 웹서비스 만들기   기초장고로 웹서비스 만들기   기초
장고로 웹서비스 만들기 기초
 
RHAMT 소개
RHAMT 소개RHAMT 소개
RHAMT 소개
 
Service operation
Service operationService operation
Service operation
 
Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료
 
[오픈소스컨설팅] OpenShift PaaS Platform How-to
[오픈소스컨설팅] OpenShift PaaS Platform How-to[오픈소스컨설팅] OpenShift PaaS Platform How-to
[오픈소스컨설팅] OpenShift PaaS Platform How-to
 
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
 
20170813 django api server unit test and remote debugging
20170813 django api server unit test and remote debugging20170813 django api server unit test and remote debugging
20170813 django api server unit test and remote debugging
 
171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계
 
Cloud life seminar open shift,이준영(배포용)
Cloud life seminar   open shift,이준영(배포용)Cloud life seminar   open shift,이준영(배포용)
Cloud life seminar open shift,이준영(배포용)
 
kt-cloud
kt-cloudkt-cloud
kt-cloud
 
Infra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInfra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and Terraform
 
Openstack Datadog.pptx
Openstack Datadog.pptxOpenstack Datadog.pptx
Openstack Datadog.pptx
 
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)
LUA를 이용한 스마트한 웹서버 만들기 (Ray. Lee)
 
Openshift 활용을 위한 Application의 준비, Cloud Native
Openshift 활용을 위한 Application의 준비, Cloud NativeOpenshift 활용을 위한 Application의 준비, Cloud Native
Openshift 활용을 위한 Application의 준비, Cloud Native
 
젠킨스 설치 및 설정
젠킨스 설치 및 설정젠킨스 설치 및 설정
젠킨스 설치 및 설정
 
practical perf testing - d2startup
practical perf testing - d2startuppractical perf testing - d2startup
practical perf testing - d2startup
 
Meetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vsMeetup tools for-cloud_native_apps_meetup20180510-vs
Meetup tools for-cloud_native_apps_meetup20180510-vs
 
Source To URL Without Dockerfile
Source To URL Without DockerfileSource To URL Without Dockerfile
Source To URL Without Dockerfile
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기
 

More from Ted Won

Undertow RequestBufferingHandler 소개
Undertow RequestBufferingHandler 소개Undertow RequestBufferingHandler 소개
Undertow RequestBufferingHandler 소개Ted Won
 
JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개Ted Won
 
JBoss Modules Internal
JBoss Modules InternalJBoss Modules Internal
JBoss Modules InternalTed Won
 
오픈 소스 컨트리뷰션 가이드
오픈 소스 컨트리뷰션 가이드오픈 소스 컨트리뷰션 가이드
오픈 소스 컨트리뷰션 가이드Ted Won
 
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...Ted Won
 
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesJenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesTed Won
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overviewTed Won
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with EsperTed Won
 
JDG 7 & Spark Integration
JDG 7 & Spark IntegrationJDG 7 & Spark Integration
JDG 7 & Spark IntegrationTed Won
 
지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기Ted Won
 
Nara - Personalized Web Recommendation Service Quick Review
Nara - Personalized Web Recommendation Service Quick ReviewNara - Personalized Web Recommendation Service Quick Review
Nara - Personalized Web Recommendation Service Quick ReviewTed Won
 
JBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring PlatformJBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring PlatformTed Won
 
Real-time Big Data Analytics Practice with Unstructured Data
Real-time Big Data Analytics Practice with Unstructured DataReal-time Big Data Analytics Practice with Unstructured Data
Real-time Big Data Analytics Practice with Unstructured DataTed Won
 
Building Real-time CEP Application with Open Source Projects
Building Real-time CEP Application with Open Source Projects Building Real-time CEP Application with Open Source Projects
Building Real-time CEP Application with Open Source Projects Ted Won
 
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기Ted Won
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with EsperTed Won
 

More from Ted Won (16)

Undertow RequestBufferingHandler 소개
Undertow RequestBufferingHandler 소개Undertow RequestBufferingHandler 소개
Undertow RequestBufferingHandler 소개
 
JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개
 
JBoss Modules Internal
JBoss Modules InternalJBoss Modules Internal
JBoss Modules Internal
 
오픈 소스 컨트리뷰션 가이드
오픈 소스 컨트리뷰션 가이드오픈 소스 컨트리뷰션 가이드
오픈 소스 컨트리뷰션 가이드
 
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...
Jenkins X Hands-on - automated CI/CD solution for cloud native applications o...
 
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesJenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with Esper
 
JDG 7 & Spark Integration
JDG 7 & Spark IntegrationJDG 7 & Spark Integration
JDG 7 & Spark Integration
 
지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기
 
Nara - Personalized Web Recommendation Service Quick Review
Nara - Personalized Web Recommendation Service Quick ReviewNara - Personalized Web Recommendation Service Quick Review
Nara - Personalized Web Recommendation Service Quick Review
 
JBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring PlatformJBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring Platform
 
Real-time Big Data Analytics Practice with Unstructured Data
Real-time Big Data Analytics Practice with Unstructured DataReal-time Big Data Analytics Practice with Unstructured Data
Real-time Big Data Analytics Practice with Unstructured Data
 
Building Real-time CEP Application with Open Source Projects
Building Real-time CEP Application with Open Source Projects Building Real-time CEP Application with Open Source Projects
Building Real-time CEP Application with Open Source Projects
 
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with Esper
 

Recently uploaded

Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 

Recently uploaded (6)

Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 

JBoss RHQ와 Byteman을 이용한 오픈소스 자바 애플리케이션 모니터링

  • 1. JBoss RHQ와 Byteman을 이용한 오픈소스 자바 애플리케이션 모니터링 JBoss User Group Community RHQ Contributor 원종석
  • 2. Break the Ice • 보통 개발자의 두 가지 무기에 관한 이야기 • 비상시 유용한 오픈 소스 프로젝트 소개 • 운영 서비스 모니터링은 RHQ • 운영 중인 JVM bytecode 들여다 볼 때는 Byteman • Thanks a lot JBoss!! • 그리고 Welcome to Korea JBoss User Group!! • 언제나 환영합니다. -1-
  • 3. About me? • 그냥 딸 바보 아빠 • 오픈 소스로 일하는 보통 자바 개발자 • 대형 SI 개발, 운영, SA • Workflow 솔루션, Big Data 플랫폼 개발 • 실시간 대용량 Event 처리 플랫폼 개발 • JBoss User Group Community 부대표 • RHQ Contributor - 한글화 작업 • tedwon.com WIKI 운영 -2-
  • 4. Agenda • RHQ 소개 • Byteman 소개 • Demo -3-
  • 5. Open Source Monitoring & Management Project -4-
  • 6. For Instance • 내가 만든 Java Application을 모니터링하고 싶다. • 장기간 지속적으로... Chart도 필요하고... Statistics도 필요하고... • 직접 만들려고 해보면 너무 일이 커지고 • 돈 주고 사기에는 너무 비싸고 • 손쉽게 공짜로 사용 할 수 있는 것 어디 없을까? • 게다가 좀 더 체계적이고 다양한 기능을 제공했으면 좋겠다. -5-
  • 8. RHQ would be one of the Solutions! -7-
  • 9. RHQ 4’s New Features • New Ajax Dynamic GUI • Use Java SE 6 Script Feature for RHQ CLI • REST API (under development) -8-
  • 10. RHQ would be one of the Solutions! -9-
  • 11. RHQ would be one of the Solutions! - 10 -
  • 12. RHQ would be one of the Solutions! - 11 -
  • 13. RHQ would be one of the Solutions! - 12 -
  • 14. RHQ Project Home http://rhq-project.org http://www.jboss.org/jopr - 13 -
  • 15. Conclusions in Advance Step 1. RHQ Server 와 Agent 설치 Step 2. Java Application에 JMX MBean 추가 Step 3. JMX MBean 기반 Plugin Descriptor XML 파일 정의 Step 4. 나의 Application용 JMX Plugin을 RHQ Server에 등록 Step 5. 모니터링 및 관리 시작!! - 14 -
  • 16. RHQ by JBoss • JBoss Enterprise Management Platform • JBoss Middleware 제품의 모니터링 Platform o JBoss AS o Byteman o Hibernate o HornetQ o Infinispan o BlackTie o Mobicents o CirrAS o etc ... - 15 -
  • 17. What is RHQ? • Make technologies more manageable!! • Aims to develop a common services management platform • Java 기반의 Open Source System Management Project • Sigar API 를 사용하여 System Information Gathering (CPU, Mem) • JMX 기술 기반으로 원격 관리 기능 제공 - JMX Plugin • OS 플랫폼에서 Server 리소스까지 전반적인 모니터링/관리 기능 제공 - 16 -
  • 18. What is RHQ? • Agent의 plugin을 통해서 모니터링 정보 수집 • 필요한 plugin만 구성해서 사용하면 적절 • 실시간 모니터링 서버는 아님 - 최소 30초 주기로 모니터링 • 장기간 모니터링에 적합 - 17 -
  • 19. RHQ Server & Agent Architecture - 18 -
  • 20. RHQ Management Functionality • Inventory • Monitoring • Configuration • Events • Control - 19 -
  • 21. RHQ Management Functionality • Inventory o 모니터링 대상 정의/등록/관리 o Resource directory • Monitoring o Monitoring any resource o Automatic discovery of resources o Monitoring for availability and performance o Complex alerting • Configuration o Configuration management o Audited, validated configuration editing and history - 20 -
  • 22. RHQ Management Functionality • Events o WAS의 로그 에러 트래킹과 레포트 • Control o 원격에서 operation 실행 o Operation 스케쥴링 - 21 -
  • 23. RHQ Monitor Architecture • 모니터링 대상을 Resource 라고 통칭한다. OS Process - 22 -
  • 24. RHQ Agent Plugins • 다양한 리소스를 위한 Plugin 제공 • Server Plugins: Apache, Tomcat, JBoss AS • RDBMS Plugins: MySQL, PostgreSQL, Oracle • Java JMX Plugin • C daemon 프로세스 (Ex: Scribe Log Aggregator) • 필요에 맞는 Custom Plugin 제작 가능 • http://rhq-project.org/display/RHQ/Plugin+Community - 23 -
  • 25. RHQ Related Links RHQ User Documentation RHQ Server Installation Guide RHQ Server Users Guide RHQ Agent Users Guide Frequently Asked Questions http://tedwon.com/display/dev/RHQ - 24 -
  • 26. RHQ / JBoss ON Team • Red Hat building in Westford, Massachusetts - 25 -
  • 27. RHQ Contributions • Installer UI 한글화 작업 완료 from v4.2 • GWT UI 한글화 작업 진행 중... 그냥 - Ted Won Red Hat - Heiko Rupp - 26 -
  • 30. 보통 개발자의 또 하나의 무기 Byteman 명품 영국제 무기 Thanks Andrew :-) - 29 -
  • 31. Where to use? • Performance check • System.exit() and System.gc() check • synchronized block check • Analyze 3rd party library, WAS, etc - 30 -
  • 32. Byte(code) man(ipulation) is • 안전하게 실행 중인 JVM 안의 bytecode 들여다 보는 도구 • 디버깅 코드를 동적으로 삽입할 수 있는 도구 • Tool that simplifies tracing and testing of Java programs • Bytecode Injection 방식 사용 • 재컴파일, 재구동 없이 실행 중인 애플리케이션에 bytecode inject 가능 • Works by modifying the bytecode of your application at runtime o 소스 코드 없이 동적으로 bytecode를 직접 변경 - 30 -
  • 33. Byte(code) man(ipulation) is • Java Agent API를 기반으로 Byteman Agent 구현 o java.lang.instrument API for runtime bytecode transformation • Byteman is a Java agent program o Retransform code only after load • Injected codes are reversible o Inject된 bytecode는 다시 원복 가능 - 31 -
  • 34. Byteman Rule Script is • Rule based scripting language • Write code to see what code is doing • Very Java oriented (almost all Java) • We inject codes through rule script files • Event Condition Action (ECA) 으로 정의하는 scripting language • Dynamically load, reload or unload rules • BTrace는 rule 대신 annotation-oriented script 정의 - 32 -
  • 35. Sample Byteman Rule Script RULE trace main entry CLASS MyAppMain METHOD main AT ENTRY IF true DO traceln("entering main") ENDRULE - 33 -
  • 36. Sample Byteman Rule Script RULE trace main entry => Rule name CLASS MyAppMain METHOD main AT ENTRY IF true DO traceln("entering main") ENDRULE - 34 -
  • 37. Sample Byteman Rule Script RULE trace main entry CLASS MyAppMain => Event (Trigger point) METHOD main AT ENTRY IF true DO traceln("entering main") ENDRULE - 35 -
  • 38. Sample Byteman Rule Script RULE trace main entry CLASS MyAppMain METHOD main AT ENTRY IF true => Condition DO traceln("entering main") ENDRULE - 36 -
  • 39. Sample Byteman Rule Script RULE trace main entry CLASS MyAppMain METHOD main AT ENTRY IF true DO traceln("entering main") => Action ENDRULE - 37 -
  • 40. Event Condition Action Rules • Event o CLASS/INTERFACE, METHOD, AT  defines trigger point(s) for rule • Binding o introduces/initializes rule variables • Condition o Java boolean expression • Action o one or more Java expressions - 38 -
  • 41. Driving Byteman • Download Byteman and unzip • Set BYTEMAN_HOME • Install as “Java agent” through java options => 서버 재구동 -javaagent:$BYTEMAN_HOME/lib/byteman.jar=agentoptions o script:script.btm install rules from script.btm at agent startup o boot:my.jar add my.jar to bootstrap classpath o sys:my.jar add my.jar to system classpath o listener:true start up agent listener o port:999 use listener port 999 o address:192.168.0.1 use listener host 192.168.0.1 - 39 -
  • 42. Driving Byteman • Download Byteman and unzip • Set BYTEMAN_HOME - 40 -
  • 43. Running JBoss AS with Byteman • run-with-byteman.sh o 시작 스크립트에 아래 두 라인 추가 o Tomcat 또한 동일 BYTEMAN_OPTS="-Dorg.jboss.byteman.verbose=true -Dorg.jboss.byteman.debug=true -Dorg.jboss.byteman.transform.all -javaagent:byteman.jar= script:my-byteman-rules.txt ,boot:byteman.jar ,boot:byteman-sample.jar ,sys:byteman-sample.jar ,listener:true ,port:9551 ,address:127.0.0.1" JAVA_OPTS="$BYTEMAN_OPTS -Xms1g -Xmx1g $JAVA_OPTS" - 41 -
  • 44. Quick Start - MyAppMain.java package org.my; public class MyAppMain { public static void main(String[] args) { for (int i = 0; i < args.length; i++) { System.out.println(args[i]); } } } $ java org.my.MyAppMain foo bar baz foo bar baz - 42 -
  • 45. Quick Start - appmain.btm MyAppMain 클래스의 main 메소드 호출 시작시에 로그를 출력하라. RULE trace main entry CLASS MyAppMain METHOD main AT ENTRY IF true DO traceln("entering main") ENDRULE - 43 -
  • 46. Load Rules at JVM Start $ java -javaagent:byteman.jar=script:appmain.btm org.my.MyAppMain foo bar baz entering main foo bar baz $ - 44 -
  • 47. Byteman Built In Methods • Tracing o traceOpen, traceClose, traceln, traceStack, ... • Managing Shared Rule State o flag, clear, countDown, incrementCounter, ... • Timing o createTimer, getElapsedTime, resetTimer • Checking Caller Stack o callerEquals, callerMatches • Thread Synchronization o delay, waitFor, signalWake, rendezvous, ... • Recursive Trigger Management o setTriggering - 45 -
  • 48. Refer to Byteman Programmer’s Guide http://tedwon.com/display/dev/Byteman - 46 -
  • 51. • RHQ Demo o Dashboard o Custom Java App o Alert o JBoss AS Cluster Group View • Byteman Demo o Install byteman agent at start up o Install byteman agent into a running jvm o Load Rule o Unload Rule • Byteman Plugin Demo o Autodiscovery Byteman Agent o Monitor Byteman Agent Availability & Rules - 49 -