ݺߣ

ݺߣShare a Scribd company logo
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 (20)

ansible why ?
ansible why ?ansible why ?
ansible why ?
Yashar Esmaildokht
Adapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at GoogleAdapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at Google
Apigee | Google Cloud
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
Venugopal Gummadala
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
VMware Tanzu Korea
Installation et configuration d'apache tomcatInstallation et configuration d'apache tomcat
Installation et configuration d'apache tomcat
Manassé Achim kpaya
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
Ji-Woong Choi
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
aaajjj4
ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...
Nancy Thomas
공개소프트웨어 기반 주요 클라우드 전환 사례
공개소프트웨어 기반 주요 클라우드 전환 사례공개소프트웨어 기반 주요 클라우드 전환 사례
공개소프트웨어 기반 주요 클라우드 전환 사례
rockplace
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
Ji-Woong Choi
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
Spring cloud on kubernetes
Spring cloud on kubernetesSpring cloud on kubernetes
Spring cloud on kubernetes
SangSun Park
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
VMware Tanzu Korea
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
Amazon Web Services Korea
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
Docker, Inc.
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Luong Vo
Adapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at GoogleAdapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at Google
Apigee | Google Cloud
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
Venugopal Gummadala
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
클라우드 네이티브 IT를 위한 4가지 요소와 상관관계 - DevOps, CI/CD, Container, 그리고 MSA
VMware Tanzu Korea
Installation et configuration d'apache tomcatInstallation et configuration d'apache tomcat
Installation et configuration d'apache tomcat
Manassé Achim kpaya
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
Ji-Woong Choi
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
aaajjj4
ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...
Nancy Thomas
공개소프트웨어 기반 주요 클라우드 전환 사례
공개소프트웨어 기반 주요 클라우드 전환 사례공개소프트웨어 기반 주요 클라우드 전환 사례
공개소프트웨어 기반 주요 클라우드 전환 사례
rockplace
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
Ji-Woong Choi
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
Spring cloud on kubernetes
Spring cloud on kubernetesSpring cloud on kubernetes
Spring cloud on kubernetes
SangSun Park
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
Docker를 활용한 손쉬운 ECS 활용기 - 김민태 (AUSG) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
VMware Tanzu Korea
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
Amazon Web Services Korea
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
Docker, Inc.
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Luong Vo

Viewers also liked (6)

[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
Ji-Woong Choi
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
jbugkorea
Now and Future of APM
Now and Future of APMNow and Future of APM
Now and Future of APM
cowboy93
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Ted Won
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
uEngine Solutions
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
OpenStack Korea Community
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
Ji-Woong Choi
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
개발자가 인프라를 만났을때 - RHQ를 활용한 Legacy System 모니터링
jbugkorea
Now and Future of APM
Now and Future of APMNow and Future of APM
Now and Future of APM
cowboy93
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Pla...
Ted Won
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
uEngine Solutions
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
OpenStack Korea Community

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

RHQ 공감 Seminar 6th
RHQ 공감 Seminar 6thRHQ 공감 Seminar 6th
RHQ 공감 Seminar 6th
Ted Won
장고로 웹서비스 만들기 기초
장고로 웹서비스 만들기   기초장고로 웹서비스 만들기   기초
장고로 웹서비스 만들기 기초
Kwangyoun Jung
RHAMT 소개
RHAMT 소개RHAMT 소개
RHAMT 소개
Opennaru, inc.
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-to
Ji-Woong Choi
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
NHN FORWARD
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 debugging
Jongwon 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
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Jemin Huh
kt-cloud
kt-cloudkt-cloud
kt-cloud
Kenu, GwangNam Heo
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
Inho Kang
Openstack Datadog.pptx
Openstack Datadog.pptxOpenstack Datadog.pptx
Openstack Datadog.pptx
FreddyManullang3
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 Native
rockplace
젠킨스 설치 및 설정
젠킨스 설치 및 설정젠킨스 설치 및 설정
젠킨스 설치 및 설정
중선 곽
practical perf testing - d2startup
practical perf testing - d2startuppractical perf testing - d2startup
practical perf testing - d2startup
JunHo Yoon
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi
RHQ 공감 Seminar 6th
RHQ 공감 Seminar 6thRHQ 공감 Seminar 6th
RHQ 공감 Seminar 6th
Ted Won
장고로 웹서비스 만들기 기초
장고로 웹서비스 만들기   기초장고로 웹서비스 만들기   기초
장고로 웹서비스 만들기 기초
Kwangyoun Jung
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-to
Ji-Woong Choi
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
NHN FORWARD
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 debugging
Jongwon 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
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Spring boot 를 적용한 전사모니터링 시스템 backend 개발 사례
Jemin Huh
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
Inho 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 Native
rockplace
젠킨스 설치 및 설정
젠킨스 설치 및 설정젠킨스 설치 및 설정
젠킨스 설치 및 설정
중선 곽
practical perf testing - d2startup
practical perf testing - d2startuppractical perf testing - d2startup
practical perf testing - d2startup
JunHo Yoon
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi

More from Ted Won (16)

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 Internal
Ted 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 Kubernetes
Ted Won
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
Ted Won
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with Esper
Ted Won
JDG 7 & Spark Integration
JDG 7 & Spark IntegrationJDG 7 & Spark Integration
JDG 7 & Spark Integration
Ted 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 Review
Ted Won
JBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring PlatformJBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring Platform
Ted 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 Data
Ted 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 Esper
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 Internal
Ted 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 Kubernetes
Ted Won
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
Ted Won
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with Esper
Ted Won
JDG 7 & Spark Integration
JDG 7 & Spark IntegrationJDG 7 & Spark Integration
JDG 7 & Spark Integration
Ted 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 Review
Ted Won
JBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring PlatformJBoss Community's Application Monitoring Platform
JBoss Community's Application Monitoring Platform
Ted 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 Data
Ted 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 Esper
Ted Won

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 -