red hat forum 2012 - jboss rhq - java application monitoring & management platform

58

Upload: ted-won

Post on 05-Dec-2014

2.069 views

Category:

Documents


10 download

DESCRIPTION

Red Hat Forum 2012 - JBoss RHQ를 이용한 오픈소스 자바 애플리케이션 모니터링

TRANSCRIPT

Page 1: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform
Page 2: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

JBoss RHQ를 이용한

오픈소스 자바 애플리케이션 모니터링

KTH 원종석

JBoss User Group / RHQ Contributor

Page 3: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

About Me l  Korea  JBoss  User  Group  커뮤니티 부운영자

–  h/p://www.facebook.com/groups/jbossusergroup  

l  JBoss  RHQ  Evangelist  /  Contributor  -­‐  한글화 작업

l  tedwon.com  WIKI  운영

 

l  오픈 소스로 일하는 Java  개발자

l  Hadoop  /  CEP기반 Big  Data  플랫폼 설계/개발/운영

l  현재 KTH에서 DAISY  데이터 분석 플랫폼 개발 중

Page 4: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Content •  RHQ Overview •  RHQ Architecture •  RHQ History •  JBoss ON •  Contributions •  Monitoring Practice

Page 5: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

What is RHQ?

Page 6: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

What is RHQ? JBoss의 대표적인 Infrastructure Project

Open Source Management & Monitoring Project

Page 7: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

In some cases l  내가 만든 Java  Applica*on을 모니터링하고 싶다.  

l  장기간  지속적으로...  Chart도 필요하고...  Sta*s*cs도 필요하고...  

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

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

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

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

Page 8: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

“JBoss RHQ” One of the Solutions!!

Page 9: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Dashboards

Page 10: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Java Application Monitoring Graphs l  Custom  Java  ApplicaPon  /  JVM  모니터링

Page 11: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Metric Chart

Page 12: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Remote Operations l  원격 명령 실행 기능 제공

Page 13: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

REST API l  3th  party를 위한 API  제공

Page 14: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

REST API

Page 15: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ’d be one of the Solutions! l  개발/운영 전체 라이프 사이클을 위한Enterprise  Management  PlaUorm  

–  배포,  리소스 추가,  모니터링,  통지    

Page 16: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

What is RHQ? l  JBoss  Enterprise  Management  PlaUorm  

l  JBoss  Middleware  제품의 모니터링 PlaUorm  

l  JBoss  AS  

l  Infinispan  

l  HornetQ  

l  BlackTie  

l  Mobicents  

l  CirrAS  

l  Byteman  

l  Hibernate  

l  etc  ...  

Page 17: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform
Page 18: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ monitors any resources l  JBoss  제품 뿐만아니라 다른 모든 애플리케이션에 대해 모니터링 가능

l  Apache  Web  Server  

l  Apache  Tomcat  Server  

l  Apache  Hadoop  Cluster  

l  Apache  Zookeeper  Cluster  

l  Apache  Ka;a  Cluster  

l  Apache  Flume  

l  Facebook  Scribe  Log  Aggregator  (C-­‐daemon  provided  CLI)  

l  Etc...  

Page 19: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

What is RHQ? l  Make  technologies  more  manageable!!  

–  Aims  to  develop  a  common  services  management  plaAorm  

l  Java  기반의 Open  Source  System  Management  Project  

–  설치 매우 용이

l  전세계의 수많은 Contributor들의 참여와 기여에 의해 개발 되고 있음

l  소규모 단일 노드부터 대규모 클러스터 모니터링에 적용 가능

Page 20: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Architecture l  Agent  /  Server  Architecture  

l  Extending  by  Plugins  

Page 21: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Agent l  OS당 하나의 Agent  설치

l  각 Plugin은 특정 대상(resource)을 전담해서 모니터링

l  DB  저장 없는 Standalone  Java  Instance  

l  주기적으로 모니터링 정보를 수집하여 서버로 레포팅

l  JBoss  RemoPng  프레임워크를 이용한 socket  통신

Page 22: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Agent Plugins l  다양한 리소스를 위한 기본Plugin  제공

l  Server  Plugins  

l  Apache,  Tomcat,  JBoss  AS  

l  RDBMS  Plugins  

l  MySQL,  PostgreSQL,  Oracle  

l  Java  JMX  Plugin  

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

l  Shell  Script,  Pid  file,  Process  Query    l  필요에 맞는 Custom  Plugin  제작 가능

–  간단하게 또는 정교하게 개발 가능

l  h/ps://docs.jboss.org/author/display/RHQ/Plugin+Community  

Page 23: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

SIGAR + JMX

RHQ 주요 모니터링 기술 l  OS  플랫폼 별 SIGAR  API  활용

–  SIGAR  API를 사용하여 System  InformaPon  Gathering  (CPU,  Memory)  

l  Java  표준 모니터링 스펙 JMX  활용

–  JMX  기술 기반으로 원격 JVM  모니터링/관리 기능 제공 -­‐  JMX  Plugin  

 

Page 24: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

What is JMX? l  Java 표준 모니터링 스펙 JMX 활용

l  RHQ는 하나의 JMX 클라이언트

l  http://goo.gl/BLHfM

JSR 160 Java Management Extensions

Page 25: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Implementation Techniques l  대부분 JBoss  project  기술로 구현

l  JBoss  AS  v4.2.3  

l  JBoss  Remo*ng  v2  

l  Hibernate  

l  JBoss  Web  /  TransacPons  /  Cache  /  SerializaPon  

l  JBoss  Seam  v2.1  /  RishFaces  

l  GWT  v2.4.0  

l  SmartGWT  v3.0  

l  Java  SE  6  Script  Features  for  RHQ  CLI  

Page 26: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ History l  2005년  부터  시작한  Hyperic  &  Red  Hat  joint  project  

l  Hyperic이 SIGAR  API를 기반으로 프로젝트를 처음 시작

l  Red  Hat이 확장 및 발전

l  2008년 2월 RHQ  1.0  배포

l  Red  Hat  and  Hyperic  Launch  Common  Services  PlaUorm  Project  

l  RHQ  Project  Overview    

l  Red  Hat  RHQ  vs.  SpringSource  Hyperic  HQ  으로 발전 중

l  RHQ에서 일부가 Jopr라는 프로젝트로 분리

l  2010년에 Jopr  프로젝트를 RHQ  프로젝트 하나로 통합

Page 27: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ History

Page 28: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

GNU General Public License GNU Lesser General Public License

http://git.fedorahosted.org/cgit/rhq/rhq.git/tree/LICENSE

RHQ License

Page 29: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

JBoss AS 5/6/7 Admin Console l  JBoss  AS  built-­‐in  admin  console  

l  Embedded  Jopr  

l  사실 RHQ  코드 재사용

l  RHQ를 통해 더욱 자세한 관리 및 모니터링 가능

Page 30: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

JBoss Operations Network l  RHQ  Commercial  Product  Version  

l  RHQ  유료 기술 지원 버전

l  Code  base  동일

l  Fully  quality-­‐tested  &  cer*fied  by  Red  Hat  

l  JBoss  ON  으로 줄여서 호칭

l  h/p://www.jboss.com/products/jbosson  

l  h/p://en.wikipedia.org/wiki/JBoss_operaPons_network  

Page 31: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Monitoring Practices

Page 32: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

How to monitor My Java App

l  Step  1.  RHQ  Server와 Agent  설치

l  Step  2.  Java  ApplicaPon에 JMX  MBean  추가

l  Step  3.  JMX  MBean정의에 맞춰서 Plugin  XML  파일 정의

l  Step  4.  나의 ApplicaPon용 JMX  Plugin으로 RHQ  Server에 등록

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

Java JMX + RHQ XML = Menu 추가 Standard & Simplicity

Page 33: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Sample JMX Application l  Business  Class에 MBean  인터페이스 구현

public  class  MyJmxObject  implements  MyJmxObjectMBean  {  

       //  모니터링 하고자하는 대상 데이터 Ex:  throughput  

       public  double  getRandomNumber()  {  

               return  Math.random();  

       }  

       //  원격에서 실행하고자 하는 Opera*on  Ex:  start/stop  

       public  String  toUppercase(String  string)  {  

               return  (string  !=  null)  ?  string.toUpperCase()  :  "";  

       }  

}  

Page 34: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Sample JMX Application l  MBean  인터페이스 정의

public  interface  MyJmxObjectMBean  {  

       //  모니터링 하고자하는 대상 데이터 Ex:  throughput  

       double  getRandomNumber();  

       //  원격에서 실행하고자 하는 Opera*on  Ex:  start/stop  

       String  toUppercase(String  string);  

}  

l  JMX  OpPon  추가  

     java  -­‐Dcom.sun.management.jmxremote.port=19999  \  

       -­‐Dcom.sun.management.jmxremote.authen*cate=false  \  

       -­‐Dcom.sun.management.jmxremote.ssl=false  \  

       -­‐jar  ./jmxapp.jar  

Page 35: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Plugin XML Schema

Page 36: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

rhq-plugin.xml 정의

l  MBean  정보를 rhq-­‐plugin태그와 맵핑

 

<plugin  name="CustomJmx"  displayName="Custom  JMX  Plugin">  

     <depends  plugin="JMX"  useClasses="true"/>  

     <service  name="First  Custom  Service">                                ==>  모니터링 서비스 정의

<opera*on  name="toUppercase"                    ==>  Opera*on  정의

                                 displayName="String  To  Uppercase"/>  

           <metric  property="RandomNumber"          ==>  Chart  정의

                           displayType="summary"  

                           defaultInterval="30000"/>  

     </service>  

</plugin>  

Page 37: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Sample JMX Application l  이제 모니터링 및 원격 명령을 위한 구성이 완료되었습니다.  

Page 38: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Live Chart l  1초 단위의 실시간 모니터링 차트 제공

Page 39: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Linux  Server  리소스 모니터링

Page 40: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  CPU  Usage  StaPsPcs  

Page 41: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Memory  Usage  StaPsPcs  

Page 42: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  JVM  Monitoring  

–  CPU  /  Heap  /  Classes  /  Thread  

Page 43: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  JBoss  ApplicaPon  Server  7  

Page 44: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  JBoss  ApplicaPon  Server  7  

Page 45: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  JBoss  ApplicaPon  Server  7  

Page 46: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  JBoss  ApplicaPon  Server  7  

Page 47: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Kata  Server  리소스 모니터링

Page 48: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Hadoop  Cluster  리소스 모니터링

Page 49: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Hadoop  Cluster  리소스 모니터링

Page 50: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Hadoop  Cluster  리소스 모니터링

Page 51: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Monitoring Practices l  Hadoop  Cluster  리소스 모니터링

Page 52: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Contributions

Page 53: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Contributions  

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

l  메인 메뉴 GWT  UI  한글화  작업  진행  중  

 

 

l  RHQ  Plugin  개발

–  h/ps://github.com/tedwon/apache-­‐hadoop-­‐rhq-­‐plugin  

–  h/ps://github.com/tedwon/apache-­‐kata-­‐rhq-­‐plugin  

–  h/ps://github.com/tedwon/apache-­‐zookeeper-­‐rhq-­‐plugin  (Incomplete)  

 

 

Page 54: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

RHQ Contributions

Page 55: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Motivations l  모니터링 시스템 개발 공수  이슈  

l  우리가 사용하는 리소스에 대한 측정  필요  

l  장애  발생시  원인 파악에 도움

l  측정하는 습관  필요  

l  Measure-­‐driven  Development  

l  A/B  test를 습관화하는 개발 문화

l  Quality  향상

l  이러한 활동을 위한 인프라  제공  

l  일종의 개발자의 무기

l  Product 개발시 활용

Page 56: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

http://www.jboss.org/rhq

https://docs.jboss.org/author/display/RHQ

RHQ Project Home

Page 57: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Demos & Videos

RHQ Related Links l  RHQ  User  DocumentaPon  

l  RHQ  Server  InstallaPon  Guide  

l  RHQ  Server  Users  Guide  

l  RHQ  Agent  Users  Guide  

l  Frequently  Asked  QuesPons  

l  h/p://tedwon.com/display/dev/RHQ  

l  h/p://rhq-­‐project.org/display/JOPR2/Demos  

l  h/p://support.rhq-­‐project.org/display/RHQ/Videos  

Page 58: Red Hat Forum 2012 - JBoss RHQ - Java Application Monitoring & Management Platform

Thanks Q&A

[email protected]