티스토리 뷰

728x90
반응형

 포스팅에서는 WildFly(JBoss) 점검리스트에 대해 알아보겠습니다.


정기적으로 수행하는 간단한 확인만으로 현재 운영중에 있는 WildFly의 상태를 모니터링 할 수 있습니다. 이번 내용에서는 JBoss 6버전을 기준으로 가이드하며, WildFly와 대체적으로 동일하나, 상이한 부분에 대해서도 함께 가이드합니다.

점검내역

 

점검항목

점검방법

1

JBoss Version

standalone.sh -v

2

JVM Heap Check

jboss-cli.sh --connect --controller=IP:adminPort --command="/core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage)"

3

Standalone Boot Check

ps -ef | grep java | grep standalone

4

Service Time Check

(JBoss)

jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=web/connector=http:read-resource(recursive=true,include-runtime=true)”

5

Thread Status Check

jboss-cli.sh --connect --controller=IP:adminPort --command="/core-service=platform-mbean/type=threading:read-resource(include-runtime=true, recursive=true, recursive-depth=10)"

6

DB Connection Check

6-1) jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources:read-resource"

 

6-2) jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources/data-source=[datasource] write-attribute(name=statistics-enabled, value=true)"

 

6-3) jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources/data-source=[datasource]statistics=pool:read-resource(recursive=true, include-runtime=true)"

* 위 command는 $JBossHome/bin 아래에서 실행합니다.
* adminPort : cli로 접속하는 default admin port는 9999이며, 설정해놓은 offset에 따라 달라질 수 있습니다.
* 4. JBoss의 경우 Web subsystem 내에서 Service Time Check가 가능하나, WildFly에서는 undertow라는 subsystem 내에서 
확인이 가능합니다.

4

Service Time Check

(WildFly)

jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=undertow:write-attribute(name=statistics-enabled,value=true)"

// Service Time Check관련 모니터링을 위한 undertow 내의 statistics-enabled 설정

 

jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=undertow/server=default-server/http-listener=default:read-resource(recursive=true, include-runtime=true)"

1.버전정보 확인
[jboss64/bin$]./standalone.sh -v
=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: /home/wildfly/jboss64
  JAVA: /usr/local/jdk1.8.0_152/bin/java
  JAVA_OPTS:  -server -XX:+UseCompressedOops -verbose:gc -Xloggc:"/home/wildfly/jboss64/standalone/log/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true
=========================================================================
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
14:25:21,899 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.6.Final-redhat-1
JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) 

2.JVM heap size
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage)"
{
    "outcome" => "success",
    "result" => {
        "init" => 1367343104L,  //초기 힙사이즈
        "used" => 172333032L,   //사용된 힙사이즈
        "committed" => 1310720000L,  // used가 해당 사이즈까지 도달시, 신규메모리 공간 할당
        "max" => 1310720000L //최대 힙사이즈
    }
}

3.기동여부 확인
[jboss64/bin$]ps -ef | grep java | grep standalone
wildfly   6447  6327  1 14:15 pts/2    00:00:06 /usr/local/jdk1.8.0_152/bin/java -D[Standalone] -server -XX:+UseCompressedOops -verbose:gc -Xloggc:/home/wildfly/jboss64/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true -Dorg.jboss.boot.log.file=/home/wildfly/jboss64/standalone/log/server.log -Dlogging.configuration=file:/home/wildfly/jboss64/standalone/configuration/logging.properties -jar /home/wildfly/jboss64/jboss-modules.jar -mp /home/wildfly/jboss64/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/home/wildfly/jboss64 -Djboss.server.base.dir=/home/wildfly/jboss64/standalone -Djboss.server.base.dir=/home/wildfly/jboss64/standalone -Djboss.node.name=standalone -c standalone.xml -b 0.0.0.0 -bmanagement=172.21.70.24 -Djboss.socket.binding.port-offset=50

4.Service Time check : request에 대한 처리 현황을 확인합니다.
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=web/connector=http:read-resource(recursive=true,include-runtime=true)"
{
    "outcome" => "success",
    "result" => {
        "bytesReceived" => "0",  // 요청된 Request의 Bytes
        "bytesSent" => "5486", // 응답한 Response의 Bytes
        "enable-lookups" => false,
        "enabled" => true,
        "errorCount" => "0",  //에러횟수
        "executor" => undefined,
        "max-connections" => undefined,
        "max-post-size" => 2097152,
        "max-save-post-size" => 4096,
        "maxTime" => "68",
        "name" => "http",
        "processingTime" => "72",
        "protocol" => "HTTP/1.1",
        "proxy-binding" => undefined,
        "proxy-name" => undefined,
        "proxy-port" => undefined,
        "redirect-binding" => undefined,
        "redirect-port" => 443,
        "requestCount" => "5",  //요청횟수
        "scheme" => "http",
        "secure" => false,
        "socket-binding" => "http",
        "virtual-server" => undefined,
        "configuration" => undefined
    }
}

5.Thread Status Check : Thread 상태를 확인합니다.
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/core-service=platform-mbean/type=threading:read-resource(include-runtime=true, recursive=true, recursive-depth=10)"
"thread-contention-monitoring-supported" => true,
        "thread-cpu-time-supported" => true,
        "current-thread-cpu-time-supported" => true,
        "object-monitor-usage-supported" => true,
        "synchronizer-usage-supported" => true,
        "thread-contention-monitoring-enabled" => false,
        "thread-cpu-time-enabled" => true,
        "thread-count" => 65,    //시스템상에서의 active thread
        "peak-thread-count" => 94,   
        "total-started-thread-count" => 135L,
   "daemon-thread-count" => 14, 
        "current-thread-cpu-time" => 5259440L,
        "current-thread-user-time" => 0L,
        "object-name" => "java.lang:type=Threading"
    }
}

6.DB Connection Check : datasource 모니터링 결과를 확인합니다.
6-1.등록되어있는 datasource확인
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources:read-resource"
{
    "outcome" => "success",
    "result" => {
        "data-source" => {
            "oracleDs" => undefined, // 현재 등록되어있는 datasource
            "ExampleDS" => undefined //현재 등록되어있는 datasource
        },
        "jdbc-driver" => {
            "h2" => undefined,
            "oracle" => undefined
        },
        "xa-data-source" => undefined
    }
}

6-2.모니터링 결과를 확인하기위한 datasource별 statistics-enabled사용
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources/data-source=oracleDs:write-attribute(name=statistics-enabled,value=true)"
{
       "outcome" => "success",
       "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}
*처음 설정하는 경우 "outcome" => "failed" 와 함께 "response-headers" => {"process-state" => "reload-required"} 라는 메시지가 뜨며, 이 경우에는 재기동이 필요할 수 있습니다.

6-3.datasource별 모니터링 결과
[jboss64/bin$]./jboss-cli.sh --connect --controller=IP:adminPort --command="/subsystem=datasources/data-source=oracleDs/statistics=pool:read-resource(recursive=true,include-runtime=true)"
{
    "outcome" => "success",
   "result" => {
       "ActiveCount" => "1",
       "AvailableCount" => "20",
       "AverageBlockingTime" => "0",
        "AverageCreationTime" => "370",
        "CreatedCount" => "1",
        "DestroyedCount" => "0",
        "InUseCount" => "0",
        "MaxCreationTime" => "370",
        "MaxUsedCount" => "1",
        "MaxWaitCount" => "0",
        "MaxWaitTime" => "0",
        "TimedOut" => "0",
        "TotalBlockingTime" => "0",
        "TotalCreationTime" => "370",
        "statistics-enabled" => true
    }
}

이상으로 본 포스팅을 마치도록 하겠습니다. 서버의 상태를 확인하여 선조치 및 대응할 수 있도록 활용을 부탁드립니다.
고맙습니다.


728x90
반응형