Tomcat JMX 접속 모니터링 설정 및 확인 방법
1. Tomcat 설치 - 7.0.X
2. tomcat user/role setting
[jboss@ip-10-31-156-81 bin]$ vi ../conf/tomcat-users.xml
<? xml version = '1.0' encoding = 'utf-8' ?> < tomcat-users > < role rolename = "admin-gui" /> < role rolename = "manager" /> < role rolename = "manager-gui" /> < role rolename = "manager-script" /> < role rolename = "manager-jmx" /> < role rolename = "manager-status" /> < user username = "tomcat" password = "s3cret" roles = "admin-gui,manager-gui,manager-script,manager-jmx,manager-status" /> </ tomcat-users > |
------------------------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<tomcat-user>
<role rolename="admin-gui" />
<role rolename="manager" />
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="manager-jmx" />
<role rolename="manager-status" />
<user username="tomcat" password="" roles="admin-gui,manager-gui,manager-script,manager-jmx,manager-status" />
1
2
3
4
5
6
7
8
9
10
| <? xml version = '1.0' encoding = 'utf-8' ?> < tomcat-users > < role rolename = "admin-gui" /> < role rolename = "manager" /> < role rolename = "manager-gui" /> < role rolename = "manager-script" /> < role rolename = "manager-jmx" /> < role rolename = "manager-status" /> < user username = "tomcat" password = "s3cret" roles = "admin-gui,manager-gui,manager-script,manager-jmx,manager-status" /> </ tomcat-users > |
3. Web Browser를 위한 URL String Query
http://host-ip:port/manager/jmxproxy/?qry=*:*
------------------------------------------------------------
O<SPAN style="LINE-HEIGHT: normal; WHITE-SPACE: pre-wrap">K - Number of results: 106</SPAN><DIV><PRE style="LINE-HEIGHT: normal; WORD-WRAP: break-word; WHITE-SPACE: pre-wrap">Name: Catalina:type=ThreadPool,name="ajp-apr-8009"modelerType: org.apache.tomcat.util.modeler.BaseModelMBean
useSendfile: false
minSpareThreads: 10
acceptorThreadPriority: 5
maxThreads: 200
sSLEnabled: false
sSLVerifyDepth: 10
pollerThreadCount: 1
localPort: 8009
connectionCount: 1
currentThreadCount: 0
keepAliveTimeout: -1
threadPriority: 5
useComet: trues
SLCipherSuite: ALL
soLinger: -1
sslEnabledProtocolsArray: Array[java.lang.String] of length 0
sendfileCount: 0
socketProperties: org.apache.tomcat.util.net.SocketProperties@556ca3d5
bindOnInit: true
backlog: 100
port: 8009
usePolling: true
deferAccept: true
running: true
algorithm: SunX509
pollTime: 2000
useCometTimeout: false
name: ajp-apr-8009
sendfileSize: 1024
maxHeaderCount: 100
clientAuth: false
keepAliveCount: 0
tcpNoDelay: true
maxConnections: 8192
sSLVerifyClient: none
maxKeepAliveRequests: 100
keystoreType: JKS
keystoreFile: /home/jboss/.keystore
paused: false
sSLHonorCipherOrder: false
sSLProtocol: all
sessionTimeout: 86400
ciphersArray: Array[java.lang.String] of length 0
sslProtocol: TLS
acceptorThreadCount: 1
sendfileThreadCount: 1
soTimeout: -1
currentThreadsBusy: 0
daemon: true
sSLInsecureRenegotiation: false</PRE></DIV>
-----------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
| O<SPAN style= "LINE-HEIGHT: normal; WHITE-SPACE: pre-wrap" >K - Number of results: 106< /SPAN ><DIV><PRE style= "LINE-HEIGHT: normal; WORD-WRAP: break-word; WHITE-SPACE: pre-wrap" >Name: Catalina: type =ThreadPool,name= "ajp-apr-8009" modelerType: org.apache.tomcat.util.modeler.BaseModelMBean useSendfile: false minSpareThreads: 10 acceptorThreadPriority: 5 maxThreads: 200 sSLEnabled: false sSLVerifyDepth: 10 pollerThreadCount: 1 localPort: 8009 connectionCount: 1 currentThreadCount: 0 keepAliveTimeout: -1 threadPriority: 5 useComet: true sSLCipherSuite: ALL soLinger: -1 sslEnabledProtocolsArray: Array[java.lang.String] of length 0 sendfileCount: 0 socketProperties: org.apache.tomcat.util.net.SocketProperties@556ca3d5 bindOnInit: true backlog: 100 port: 8009 usePolling: true deferAccept: true running: true algorithm: SunX509 pollTime: 2000 useCometTimeout: false name: ajp-apr-8009 sendfileSize: 1024 maxHeaderCount: 100 clientAuth: false keepAliveCount: 0 tcpNoDelay: true maxConnections: 8192 sSLVerifyClient: none maxKeepAliveRequests: 100 keystoreType: JKS keystoreFile: /home/jboss/ .keystore paused: false sSLHonorCipherOrder: false sSLProtocol: all sessionTimeout: 86400 ciphersArray: Array[java.lang.String] of length 0 sslProtocol: TLS acceptorThreadCount: 1 sendfileThreadCount: 1 soTimeout: -1 currentThreadsBusy: 0 daemon: true sSLInsecureRenegotiation: false < /PRE >< /DIV > |
4. 위의 리스트내역 중 Name에 해당하는 부분을 URL의 Quer를 붙여넣으면 각 MBean에 대한 항목 확인 가능
예: http://host-ip:port/manager/jmxproxy/?qry=Catalina:type=DataSource,context=/host-manager,host=localhost,class=javax.sql.DataSource,name="jdbc/readPool"