반응형

1. Web.xml 파일 수정 내역 

<filter>
		<filter-name>monitoring</filter-name>
	    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
		<init-param>
			<param-name>authorized-users</param-name>
			<param-value>id:password</param-value>
		</init-param>
	</filter>
	
	<filter-mapping>
		<filter-name>monitoring</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<listener>
	    <listener-class>net.bull.javamelody.SessionListener</listener-class>
	</listener>

	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>Monitoring</realm-name>
	</login-config>
 
	<security-role>
		<role-name>monitoring</role-name>
	</security-role>
 
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Monitoring</web-resource-name>
			<url-pattern>/monitoring</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>monitoring</role-name>
		</auth-constraint>
	</security-constraint>

 

2. JEUSMain.xml  변경내역

 

<application>
      <name>javamelody</name>
      <path>/jeus/webapp</path>
      <deployment-type>COMPONENT</deployment-type>
      <web-component>
         <context-root>/</context-root>
      </web-component>
      <deployment-target>
         <target>
            <engine-container-name>eng2_monitoring</engine-container-name>
         </target>
      </deployment-target>
   </application>

 

반응형

'WAS > JEUS' 카테고리의 다른 글

제우스에서 log4sql 사용하기  (0) 2011.03.15
JEUS 5 세션 공유  (0) 2011.03.09
JEUSMain.xml Datasource 암호 설정  (0) 2011.01.13
IBM JVM 튜닝 - 3  (0) 2009.08.24
제우스 환경 설정 부분  (0) 2009.03.05
반응형

출처 : http://westzero.net/40

이 글을 클릭하셨다면 log4sql 이 뭔지는 다들 알고 들어 오셨을겁니다.
만약 모르신다면 제가 일전에 소개한 포스트 'System.out.println()은 잊어라 log4sql이 온다.'를 보고오시면 됩니다.

※ 이 글은 제우스에서 DataSource를 사용할 경우에만 해당되는 사항입니다.

log4sql은 직접적으로 DataSource를 지원하지 않습니다. 그리고 제우스에서도 직접적으로 드라이버 클래스를 지정할 수 없습니다.
따라서 제우스에서는 원하는 드라이버 클래스를 지정하려면 BlackboxConnectionPoolDataSource를 사용해야 합니다.

지정하는 방법은 다음 순서대로 따라하시면 됩니다.
  1. 먼저 log4sql.jar를 $JEUS_HOME/lib/application 경로에 넣어 주세요.
  2. $JEUS_HOME/호스트명/JEUSMain.xml 파일을 열어 다음과 같이 수정하세요
    [code]
    <database>
        <vendor>oracle</vendor>
        <export-name>oracledb</export-name>
        <data-source-class-name>jeus.jdbc.driver.blackbox.BlackboxConnectionPoolDataSource</data-source-class-name>
        <data-source-type>ConnectionPoolDataSource</data-source-type>
        <property>
            <name>DriverClassName</name>
            <type>java.lang.String</type>
            <value>core.log.jdbc.driver.OracleDriver</value>
        </property>
        <property>
            <name>URL</name>
            <type>java.lang.String</type>
            <value>jdbc:oracle:thin:@192.169.30.244:1521:ora9i</value>
        </property>
        <property>
            <name>User</name>
            <type>java.lang.String</type>
            <value>scott</value>
        </property>
        <property>
            <name>Password</name>
            <type>java.lang.String</type>
            <value>tiger</value>
        </property>
    </database>
    [/code]
  3. 이제 제우스를 실행시켜서 적용이 되었는지 확인하면 됩니다.
생각보다 간단하게 끝났습니다.^^

저는 BlackboxConnectionPoolDataSource을 몰라서 약 3일간 삽질을 하다가 티맥스 테크넷의 'Spy를 사용하여 SQL 로그 보기' 를 보고 알았습니다. 그리고 나중에 찾아보니 테크넷에 저보다 먼저 log4sql 적용 방법을 문의하신 분도 계시더군요.

테크넷은 회원가입을 해야하고 쉽게 찾기가 어려워 이렇게 따로 포스팅을 올립니다.
이렇게 포스트로 작성하면 구글링으로 쉽게 찾을 수 있을꺼에요.^^
반응형

'WAS > JEUS' 카테고리의 다른 글

JAVA Melody Jeus 추가  (0) 2019.12.02
JEUS 5 세션 공유  (0) 2011.03.09
JEUSMain.xml Datasource 암호 설정  (0) 2011.01.13
IBM JVM 튜닝 - 3  (0) 2009.08.24
제우스 환경 설정 부분  (0) 2009.03.05
반응형

답변입니다.
 
먼저 확인하는 내용입니다.
1. http://inho21.com/ 요청과 http://inho21.com/TEMS/ 라는 요청들에 대한 Context 간 Session 공유로 확인합니다.
2. http://inho21.com 라는 도메인으로 요청이 들어오며, 이는 웹서버를 통하여 들어온다고 확인합니다.
 
올려주신 설정은 확인하였습니다.
먼저 WEBMain.xml에서 context간 Session 공유에서 단일 도메인이기 때문에 <session-cookie> 설정은 없어도 됩니다.
======================================================================================
      <session-config>
         <distributable>true</distributable>
         <shared>true</shared>
         <timeout>600</timeout>
         <reload-persistent>true</reload-persistent>
      </session-config>
   </context-group>
   <session-server>
      <primary-server>hoya21</primary-server>
   </session-server>
</web-container>
======================================================================================
 
그리고 JEUSMain.xml에서 세션 서버를 설정하셨고, WEBMain.xml에서 <distributable>true</distributable> 로 설정하셨기 때문에 중앙집중식으로 세션 서버를 사용하시고, 이에 대하여 Container간 단일 Session Server를 사용하게 됩니다.
 
이와 같이 되었다면 다음 jeuadmin `hostname` -Uadministrator -P{설치시 암호} 를 실행하여,
console 관리툴에 들어가시기 바랍니다.
그 후, st -s 를 입력하셨을 경우(한개의 컨테이너 일 경우)
Context(Application) 갯수인 2개가 나오지 않고, 1개로 나오는지를 확인하시기 바랍니다.
1개로 나와야 두개의 Context가 하나의 Session Server를 사용하고 있다는 것입니다.
 
이후, 각 Context간 Session이 공유되는지를 확인하시기 바랍니다.
 
감사합니다.
 
 
ps. 샘플 소스로 Session.jsp 라는 소스를 올립니다. 세션이 공유 되고 있다면, 한 브라우저에서 /Session.jsp 호출 후, /TEMS/Session.jsp 호출시 하나의 JSessionID로 나와야 하며, 뒤에 호출된 것에 대해서 isNew() 값은 false로 나와야 합니다.
 
Session.jsp
======================================================================================
<%@ page language="java" session="true" contentType="text/html; charset=euc-kr" %>
<%
    out.println("test <br>");
    out.println("Session ID : "+session.getId() + "<br>");
    out.println("Session Creation Time : "+new java.util.Date(session.getCreationTime()) + "<br>");
    out.println("Session Last Access Time : "+new java.util.Date(session.getLastAccessedTime()) + "<br>");
    out.println("Session TimeOut : "+session.getMaxInactiveInterval() + "<br>");
    out.println("Session is new? "+session.isNew() + "<br>");
%>
======================================================================================
 
 
 

<질문 내용>
 
JEUS6.0 #Fix6
동일안 컨테이너에 컨텍스트 구분만 해서 사용합니다.
사용 컨텍스트 : '/', '/TEMS' 2개
node name : hoya21
가상도메인 : inho21.com
 
 
제목을 '세션공유에 대한 x차 질문입니다.' 라고 해서 계속 세팅을 하고 있습니다.
이전답변에서는 동일한 컨테이너에 컨텍스트를 등록하면 세션공유가 된다고 했던것 같은데...
4차 답변에서는 동일한 컨테이너 일지라도 컨텍스트간 세션공유가 되지 않는다..라는 답변이 있었고,
이것을 해결할려면 patch를 받아야 한다고 했습니다.
 
현재는 개발중 테스트 목적으로 개발자 노트북에 JEUS를 설치해서 동작 확인 및 설정을 하고 있습니다.
해서 JEUS6.0 #Fix6을 받아 설치하고, 같이 제공하는 patch를 설치했습니다.
데모버젼에서는 세션공유가 안되고, 정식라이센스를 발급 받은 서버에서만 세션공유를 위한 patch파일을
배포하는것인지 알고 싶습니다.
 
개발자의 입장에서 세션공유 테스트를 하려면 더이상 어찌 해야하는지도 답변을 주시면 감사하겠습니다.
 
--------------------------------------------아래---------------------------------------------
 
- JEUSMain.xml
   <node>
      <name>hoya21</name>
        <!-- Session Server Setting -->
        <session-server>
          <type>primary</type>
          <resolution>60000</resolution>
          <connect-timeout>5000</connect-timeout>
          <read-timeout>20000</read-timeout>
          <passivation-to>-1</passivation-to>
          <removal-to>1800000</removal-to>
          <check-to>30000</check-to>
        </session-server>

- WEBMain.xml
      <session-config>
         <!-- This Option is JEUS Session Server Use : Default - false -->
         <!-- If this Option is true, All Context Group Use JEUS Session Server -->
         <distributable>true</distributable>
         <!-- If this Option is true, All Context Group Share Session -->
         <!-- This Option is All Context Group Application Share Session : Default - false -->
         <shared>true</shared>
         <timeout>600</timeout>
         <reload-persistent>true</reload-persistent>
         <session-cookie>
            <jsessionid-name>JSESSIONID2</jsessionid-name>
            <domain>.inho21.com</domain>
         </session-cookie>
      </session-config>
   </context-group>
   <!-- Session Clustering Setting for No Node Clustering -->
   <session-server>
      <primary-server>hoya21</primary-server>
   </session-server>
</web-container>
 
출처 : http://technet.tmax.co.kr/kr/inquiry/qna/jeus/readBoardForm.do?bbsCode=qna_jeus&fc=inquiry&sc=inquiry_qna&tc=inquiry_qna_jeus&currentPage=1&seqNo=41849&categoryId=&productCode=&range=10&searchType=TITLE&searchText=%EA%B3%B5%EC%9C%A0





















JEUS Enterprise버전에서는 SessinServer를 제공합니다.
데모라이센스를 사용하시는 경우 기능제약이 없으므로 설정이 가능합니다.
 
JEUS Server안내서 9장과 JEUS Web Container안내서 8장을 참조하시어 SessionServer를 설정하시면
세션 공유가 가능합니다.
 
== JEUSMain.xml 파일
<jeus-system>
    . . .
    <node>
        . . .
        <session-server>
            <session-manager>
                <name>session1</name>
                <passivation-to>1800000</passivation-to>
                <removal-to>3600000</removal-to>
            </session-manager>
        </session-server>
        . . .
    </node>
 
위와 같이 Session Manager를 설정해 두고
 
== WEBMain.xml 파일 (3개의 컨테이너에 동일하게 설정)
<?xml version="1.0"?>
<web-container xmlns="http://www.tmaxsoft.com/xml/ns/jeus">
        . . .
    <session-cluster>
        <session-server>
            <server-name>session1</server-name>
            <connect-timeout>120000</connect-timeout>
            <read-timeout>120000</read-timeout>
        </session-server>
    </session-cluster>

와 같이 설정하시면 사용이 가능합니다.
 
위의 설정은 간략히 설정한 것입니다.
세부적인 옵션과 용도는 매뉴얼을 참고하시기 바랍니다.
 
 
 
----------------------------------------------------------------
안녕하세요
session 공유 대한 문의 드립니다.
 
현재 사용중이 jeus(jeus 5.0)에 컨테이너 3개를 설정하여
 
웹사이트를  3개를 운영 하려고 합니다. 웹 사이트 1 에  로그인후 session 을 유지 하면서
 
웹사이트 1~ 3 까지 공유하여 세션이 끈어지지 않게 할수 없는지 궁금합니다.


출처 :  http://technet.tmax.co.kr/kr/inquiry/qna/jeus/readBoardForm.do?bbsCode=qna_jeus&fc=inquiry&sc=inquiry_qna&tc=inquiry_qna_jeus&currentPage=4&seqNo=38491&categoryId=&productCode=&range=10&searchType=TITLE&searchText=%EA%B3%B5%EC%9C%A0
반응형

'WAS > JEUS' 카테고리의 다른 글

JAVA Melody Jeus 추가  (0) 2019.12.02
제우스에서 log4sql 사용하기  (0) 2011.03.15
JEUSMain.xml Datasource 암호 설정  (0) 2011.01.13
IBM JVM 튜닝 - 3  (0) 2009.08.24
제우스 환경 설정 부분  (0) 2009.03.05
반응형

가이드에는 <database> 안에 <encryption>암호..</encryption> 으로 지정되어 있으나...

제길슨...

안먹어... jeus5는 모르는 child 원소란다 -_-ㅋ

아놔...


 찾아보니

<password>tiger</password>

값이

base64일 경우
<password>{base64}dGlnZXI=</password>

형태로 변경적용 하면 된다.


특정 값을 암호화 하는 방법은

 jeus 계정으로

$> encryption base64 tiger

하면
[base64] : [tiger] --> [encode:dGlnZXI=]
[base64] : [dGlnZXI=] --> [decode:tiger]


적용가능한 암호화 알고리즘
- base64
  많이 쓰이나 암호화와 복호화가 쉬움.
   또한 복호화 툴이 많이... 2초면 복호화..

- SHA
  해쉬 암호화 방식 (중간 유추가 안되고)
   입력 A -> 해쉬함수 -> XADDD (값이라면)
   비교시 값을 입력받아 똑같이 해쉬 결과값을 비교하는 방식 비교적 안전

- DES
- DESede
- AES
- SEED
- Blowfish




반응형

'WAS > JEUS' 카테고리의 다른 글

제우스에서 log4sql 사용하기  (0) 2011.03.15
JEUS 5 세션 공유  (0) 2011.03.09
IBM JVM 튜닝 - 3  (0) 2009.08.24
제우스 환경 설정 부분  (0) 2009.03.05
JAVA HEAPDUMP 분석방법  (0) 2009.03.05
반응형

앞선 IBM JVM 튜닝 - 2 포스팅에서 AF를 줄이는 방안을 연구해 보자고 했다.

AF란 결국 아래의 두 논리의 경합이다.
1. heap memory상에는 움직일수 없는 객체들이 존재한다. (unmovable objects)
2. heap memory에 객체가 할당되기 위해서는 연속된 memory공간이 필요하다. (contiguous memory block)

여기서 '움직일수 없는 객체(unmovable object)'의 두가지 type에 대해 살펴보도록 하자.

pinned objects

  • java heap 영역이 아닌 space로 부터 참조를 당하고 있는 객체들을 말한다.
    (여기서 java heap 영역이 아닌 space란 말은 native heap, thread stack등의 영역을 의미하는데 이는 포스팅 진행중 설명하겠다.)
  • jvm 내부 스트럭처의 일부분 혹은, jni의 내부의 변수, 혹은 다른 pinned objects등에 의해 reference를 가진 객체를이 해당된다.

dosed objects

  • 순간적으로 pinned objects화 된 객체등을 의미한다.
  • java 코드내의 local variable, 혹은 method 간의 호출에 사용되는 parameter 객체들이 될 수있다.
  • GC Thread가 돌때, 위에서 설명한 dosed object들은 active로 간주되어 GC의 대상에서 벗어나게 되고,이후 GC Thread에 의해서 reference 참조 여부가 결정된 후, 일반 객체처럼 수거된다.

아래의 그림을 보면 쉽게 이해가 갈 것이다.

이러한 unmovable objects들 중, 다행히 dosed object들은 생명이 짧다. 따라서 곧 mark-sweep될 가능성이 많다.
하지만, 문제는 pinned object들 이다. 이 녀석들은 대부분 긴 생명력을 자랑하면서, 제한된 Heap 공간에 자기 멋대로 자리를 틀어 버리기 때문이다.
필연적으로 이러한 pinned objects들이 다수 존재하게 되면, 그만큼 AF가 발생할 확률이 높다는 말이 된다.

그렇다면, 어떠한 방법이 있을까?

사례 1) Heap사용률은 높지 않지만, 다수의 pinned object에 의해 AF가 발생.
이경우는, pinned objects들만 사용할 수 있는 전용공간을 Heap상에 만들어 주면 된다.
이때 사용되는 대표적인 옵션은 아래와 같다.
-Xknnn  -Xpiii[k][,ooo[k]] 

  • nnn is the maximum number of classes used by the application,
  • iii is the size of the primary pinned cluster, 
  • ooo is the size of the overflow pinned clusters in bytes, and
  • Using k changes value from bytes to kilobytes.

윗 영문해설은 'ibm'사이트에서 발췌한 항목에 대한 설명인데, 개인적으로는 다음과 같이 이해하고 있다.
 'nnn'은 메모리에 로딩된 application class의 총 개수를 의미하며, 'iii'는 pinned objects를 연속된 공간에 묶기 위한 cluster된 공간의 크기인데, WAS등이 부팅되면서 로딩시키는 class들 중, pinned성격의 object들이 먼저 위치하는 공간의 크기를 의미하며, 'ooo'는 JVM Runtime시 종종 생성되고 사라지는 pinned object들이 위치하는 공간이다.
통상, -Xk로 표현되는 옵션을 'KCluster'라고 부르며, -Xp로 표현되는 옵션을 'PCluster'라고 부른다.

통상적인 경우, 1.3.1_07 이상 및 1.4.2 이상의 ibm jdk에서는 이를 산출하기 위한 back data를 볼 수 있는 옵션을 제공하고 있다.

  • 1.3.1_07 이상의 1.3대 jvm
    -verbosegc -Xtgc2
  • 1.4.2 이상의 jvm
    -verbosegc -Dibm.dg.trc.print=st_verify

위의 설정이 작동하게 되면, standard out 에 아래와 같은 로그가 찍히게 된다.
<GC(VFY-SUM): pinned=3000(classes=2755/freeclasses=0) dosed=9388 movable=1045582 free=3340>
해석해 보면, 총 2755개의 application class들이 로딩되어 있으며, 이중 unmovable object로는 pinned objects가 3000개, 그리고 순간 pinned화 된 dosed object가 9388개 존재한다. 기타 movable한 object는 1045582개 존재하며, mark가 끊긴 object들은 3340개 존재한다.

위와같은 로그를 획득하였다면, -Xk와 -Xp의 sizing을 해 보자.

  • -Xk sizing
    통상적으로 로딩된 class개수의 10%정도를 더 설정해 주는 것을 권고한다. 위의 data를 기반으로 산출해 보면 아래와 같다.
    2755 + (2755x0.1) = 3030, 따라서 -Xk3030과 같이 설정한다.
  • -Xp sizing
    이부분에 대한 명쾌한 설명을 하고 있는 자료를 본적이 없다. IBM에서도 아래와 같이 설명하고 있다.
    If the problem still persist after setting a -Xk value then you may want to look at setting  -Xp as well and examining the application code to see if you can reduce the size of the larger objects that are being requested.
    Sizing the -Xp option is a complex task and should only be done with assistance from IBM Support.


    위에서 설명한데로, -Xpiii[k][,ooo[k]]형식이 되는데, 'iii'는 pinned objects를 연속된 공간에 묶기 위한 cluster된 공간의 크기인데, WAS등이 부팅되면서 로딩시키는 class들 중, pinned성격의 object들이 먼저 위치하는 공간의 크기를 의미하며, 'ooo'는 JVM Runtime시 종종 생성되고 사라지는 pinned object들이 위치하는 공간으로 이해한다.

    따라서, -Xk옵션으로 별다른 개선효과가 없다면, AF가 발생했을 당시의 gc로그를 기반으로, AF를 유발한 object 크기를 유형별로 산출하여, 단위시간에 몰리는 object크기의 총 합정도를 설정하여, 반복테스트를 통하여 가장 좋은 성능을 발휘하는 임계치를 찾는 방법을 사용해야 할 것 같다.

사례 2) unmovable obejcts는 많지 않지만, 다수의 dosed objects들에 의한 AF발생.

  • -Xcompactgc
    모든 GC사이클 수행시마다, compact를 수행한다. 성능은 크게 감소할 것을 감수해야 한다.
    하지만, 해당 옵션을 활성화 시켜서 AF가 많이 줄어 든다고 판단되면, dosed objects들에 의한 AF가 많다라고 간주하는데 판단기준이 될 수 있다.
  • -Xpartialcompatgc
    compact trigger가 자주 발생한다. 즉, 기존의 full compaction을 점진적(incremental)으로 진행한다.
    비활성화는 -Xnopartialcompactgc로 설정하면 되고, full compaction 모드로 작동하게 된다.
  • -Xgcpolicy
    IBM JVM 튜닝 - 1 을 참조한다.

사례 3) unmovable obejcts는 많지 않지만, 다수의 large size objects들에 의한 AF발생.
large object를 위한 loa(large object area)영역을 지정한다.

  • jdk 1.4 이상
    -Xloratio : loa 영역의 크기를 백분률로 지정한다. 
                   loa 영역을 지정한 경우, 통상적으로 Xmx영역을 일정비율 늘려줘야 한다. 
                   공식은 아래와 같다.               
                                       New Xmx = Current Xmx / (1 - loratio)
  • jdk 1.5이상
    -Xloa : 64k 이상의 large object들만을 담는 loa(large object area)를 활성화 한다.
    -Xloainitial : loa영역의 초기 백분률로 0~0.95의 수치를 지정한다. 기본값은 0.05(5%)이다.
    -Xloamaximum : loa영역의 최대 백분률로 0~0.95의 수치를 지정한다. 기본값은 0.5(50%)이다.



포스팅을 마무리하고 보니, IBM JVM 튜닝중 AF쪽에 포커스가 맞추어 진 느낌이다.
다음에는 IBM JVM 전반에 걸쳐 포스팅을 해볼까 한다.

저작자 표시 비영리 변경 금지
반응형

'WAS > JEUS' 카테고리의 다른 글

JEUS 5 세션 공유  (0) 2011.03.09
JEUSMain.xml Datasource 암호 설정  (0) 2011.01.13
제우스 환경 설정 부분  (0) 2009.03.05
JAVA HEAPDUMP 분석방법  (0) 2009.03.05
웹상에서 제우스 로그 확인하기  (0) 2009.03.05
반응형

<IPCPERM>

inter-process communication permission mask

Web Server 시스템에 대한 관리자가 아닌 개발자와 같은 다른 사용자가 wsdown이나 특정 프로세스를 기동 및 종료를 할 수 있으며 이를 wsadmin를 통해 확인할 수 있도록 한다. Unix 시스템 환경 하에서는 관리자 개인이나 그룹, 기타에게 각각 파일 접속 제어(판독기능/기록기능/수행기능)를 지정 할 수 있다. 즉, default인 경우에는 다른 사용자들은 위의 기능을 사용할 수 없으나, IPCPERM이 0777인 경우에는 다른 사용자들은 위의 모든 기능을 사용할 수 있다.

 

<Set user ID, Set group ID, Sticky bit>

In addition to the basic permissions discussed above, there are also three bits of information defined for files in UNIX :

  • SUID or setuid : change user ID on execution : if setuid bit is set, when the file be executed by a user, thre process will have the same rights as the owner of the file being executed.
  • SGID or setgid : chage group ID on execution : Same as above, but inherits rights of the group of the owner of the file. For directories it also may mean that when a new file is created in the directory it will inherit the group of the directory (and not of the user who created the file)
  • Sticky bit : It was used to trigger process to "stick" in memory after it is finished, now this usage is obsolete. Currently its use is system dependant and it is mostly used to suppress deletion of the files that belong to other users in the folder where you hava "write" access to.
  • Numeric representation

    • Octal digit | Binary value | Meaning
    • 0 000 setuid, setgid sticky bits are cleared
    • 1 001 sticky bit is set
    • 2 010 setgid bit is set
    • 3 011 setgid and sticky bits are set
    • 4 100 setuid bit is set
    • 5 101 setuid and sticky bits are set
    • 6 110 setuid and setgid bits are set
    • 7 111 setuid, setgid, sticky bits are set
  • Textual representation

    • SUID : if set, then replaces "x" in the owner permissions to "s", if owner has execute permission, or to "S" otherwise. Example: -rws------ both owner execute and SUID are set, -r-S------ SUID is set, but owner execute is not set
    • SGID : If set, then repplaces "x" in the group permissions to "s", if group has execute permission, or to "S" otherwise.
    • Sticky : If set, then replaces "x" in the others permissions to "t", if others have execute permissions, or to "T" otherwise

 

<Invocation Manager 설정>

Method invocation manager는 Engine Container에서 Servlet/JSP methods, stateless EJB methods 그리고 MDB methods와 같은 Stateless 메소드를 호출하는 동안 사용하는 외부 자원(external resource)을 추적하고 보고한다.

  • NoAction : 기능을 사용하지 않는다.
  • Warning : 이 선택사항이 선택되면, 만약 한 자원이 무상태 메소드 호출 동안 사용되었지만 반환할 때 닫지 않게 될 경우 이벤트가 container log에 warning 메시지로 기록된다.
  • AutoClose : 이 선택사항이 선택되면, 만약 한 자원이 무상태 메소드 호출 동안 사용되었으나 반환할 때 닫히지 않는다면 자원이 자동적으로 닫힌다.

위치는 <jeus-system> - <node> - <engine-container> - <invocation-manager-action> 이다.

AutoClose일 때 다음과 같은 메시지가 나온다.

  • 2008.05.08 17:17:16][0][0_540] [test-19] [Network-0907] <SocketStreamImpl> closing the SocketStream because of occuring the exception: [SocketStream(remote : test:63370(), local : test:9736(JNSServer), jeus.net.impl.SocketStream14@17dc299)]
     java.io.IOException: disconnected

Warning일 때

  • [2008.05.28 16:26:56][1][0_540] [container1-20] [MGR-0396] Resources are not closed after use: [JeusConnection[ID=oracle-13,actual=oracle.jdbc.driver.LogicalConnection@107e4bc]]
    [2008.05.28 16:26:56][0][0_540] [container1-20] [MGR-0107] RequestURI : /test.jsp

 

 

<WebtoB와 JEUS 사이에서 DOCROOT 변경 없이 이미지가 정상적으로 뜨게 하는 방법>

  • ServiceOrder가 URI, EXT 일 경우 : URI 절에서는 구별해서 처리하기 어렵다. 왜냐하면, URI에서 처리를 담당할 ServerType이나 Vhost를 설정하기 때문이다.
  • ServiceOrder가 EXT, URI 일 경우 : EXT 절에서 각각에 타입들에 대해서 각각의 ServerType를 설정하기 때문에 각각의 ServerType이나 Vhost에 따라서 JSP/Servlet는 해당 JEUS의 어플리케이션의 PATH에, 정적인 것은 해당 WebtoB의 DOCROOT나 Vhost의 DOCROOT에 저장하면 된다.

 

<period>의 역할

Worker Thread를 없애기 위해서 풀을 검사하는 시간 간격

 

<asqcount> 확인

문제가 있어서.. 다음에 확인.(cqcount가 증가하는 문제 발생.. 자세한 내역은 모르겠음)

 

<disable-pipe> 옵션

  • 이것은 JEUS에서 나오는 error 메시지에서 차이를 알 수 있다.
  • false 일때 : fail to reconnect => No such file or directory [IOException]

    • [2008.05.07 09:12:40][1][0_540] [container1-14] [WEB-3346] worker(webtob1-hth0(localhost:9900)-w00:null) : fail to reconnect
      <<__Exception__>>
      java.io.IOException: No such file or directory
              at jeus.util.net.PipeSocketImpl.pipeConnect(Native Method)
              at jeus.util.net.PipeSocketImpl.connect(PipeSocketImpl.java:46)
              at jeus.util.net.PipeSocket.createImpl(PipeSocket.java:89)
              at jeus.util.net.PipeSocket.<init>(PipeSocket.java:66)
              at jeus.util.net.WebtobPipeSocket.<init>(WebtobPipeSocket.java:25)
              at jeus.util.net.JeusNetUtil.getWebtobSocket(JeusNetUtil.java:194)
              at jeus.servlet.engine.WebtobThreadPoolManager.connectSocket(WebtobThreadPoolManager.java:529)
              at jeus.servlet.engine.WebtobThreadPoolManager.registryConnection(WebtobThreadPoolManager.java:522)
              at jeus.servlet.engine.WebtobRequestProcessor.reconnect(WebtobRequestProcessor.java:362)
              at jeus.servlet.engine.WebtobRequestProcessor.reconnect(WebtobRequestProcessor.java:328)
              at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:82)
      <<__!Exception__>>
  • true 일때 : fail to reconnect => Connection refused [ConnectException]

    • [2008.05.07 09:11:16][1][0_540] [container1-15] [WEB-3346] worker(webtob1-hth0(localhost:9900)-w01:null) : fail to reconnect
      <<__Exception__>>
      java.net.ConnectException: Connection refused
              at java.net.PlainSocketImpl.socketConnect(Native Method)
              at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
              at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
              at java.net.Socket.connect(Socket.java:464)
              at java.net.Socket.connect(Socket.java:414)
              at java.net.Socket.<init>(Socket.java:310)
              at java.net.Socket.<init>(Socket.java:125)
              at jeus.util.net.JeusNetUtil.getWebtobSocket(JeusNetUtil.java:179)
              at jeus.servlet.engine.WebtobThreadPoolManager.connectSocket(WebtobThreadPoolManager.java:529)
              at jeus.servlet.engine.WebtobThreadPoolManager.registryConnection(WebtobThreadPoolManager.java:522)
              at jeus.servlet.engine.WebtobRequestProcessor.reconnect(WebtobRequestProcessor.java:362)
              at jeus.servlet.engine.WebtobRequestProcessor.reconnect(WebtobRequestProcessor.java:328)
              at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:82)
      <<__!Exception__>>

 

<oracle database type>

  • OCI(type 2)

    • Oracle Call Interfase(OCI)
    • SQL을 실행하는 PL>SQL 어플리케이션, OCCI를 이용하는 C++ 어플리케이션, OCI기반 JDBC 드라이버를 사용하는 Java 어플리케이션, ODBC 드라이버를 사용하는 C 어플리케이션, OLEDB 드라이버를 사용하는 VB 어플리케이션, Pro*C 어플리케이션, 분산형 SQL에서 사용
    • 최신 Oracle Database Server 기능의 즉각적인 활용, 엔터프라이즈 수준의 성능과 확장성, 안정적인 보안 모델 구현, Oracle이 실행되는 모든 플랫폼에서 호환성 보장
  • THIN(type 4)

 

 

<enable-wait>

  • true :

    • tmax@test:~/jeus5/config/test$ da 1
      JEUS 5.0 (fix #25) JDBC Connection Pool Controller
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      ==========================================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         2    10   10     0      0       true      true
      ==========================================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         2    10   10     0      0       true      true
      ==========================================================================
    • 와 같이 나왔으며 위의 연결정보를 끊지 않고 12개를 띄운 것이다.
    • 결과로는 11번째 요청부터는 일정 시간이 지난 뒤에 요청이 반환되지 않았다.
    • <<__Exception__>>
      jeus.jdbc.connectionpool.WaitTimeoutException: enable-wait timeout occurred from the connection pool; export-name=[oracle]
              at jeus.jdbc.connectionpool.ConnectionStore.getObject(ConnectionStore.java:191)
              at jeus.jdbc.connectionpool.ConnectionStore.getConnection(ConnectionStore.java:245)
              at jeus.jdbc.connectionpool.ConnectionPool.prepareConnection(ConnectionPool.java:820)
              at jeus.jdbc.connectionpool.ConnectionPool.innerGetConnection(ConnectionPool.java:705)
              at jeus.jdbc.connectionpool.ConnectionPool.getConnection(ConnectionPool.java:642)
              at jeus.jdbc.datasource.DataSourceWrapper.getConnection(DataSourceWrapper.java:42)
              at jeus_jspwork._500_test_5fjsp._jspService(_500_test_5fjsp.java:64)
              at jeus.servlet.jsp.HttpJspBase.service(HttpJspBase.java:54)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
              at jeus.servlet.jsp.JspServletWrapper.executeServlet(JspServletWrapper.java:101)
              at jeus.servlet.engine.ServletWrapper.execute(ServletWrapper.java:214)
              at jeus.servlet.jsp.JspServletWrapper.execute(JspServletWrapper.java:147)
              at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:183)
      <<__!Exception__>>
      jeus.jdbc.connectionpool.WaitTimeoutException: enable-wait timeout occurred from the connection pool; export-name=[oracle]
              at jeus.jdbc.connectionpool.ConnectionStore.getObject(ConnectionStore.java:191)
              at jeus.jdbc.connectionpool.ConnectionStore.getConnection(ConnectionStore.java:245)
              at jeus.jdbc.connectionpool.ConnectionPool.prepareConnection(ConnectionPool.java:820)
              at jeus.jdbc.connectionpool.ConnectionPool.innerGetConnection(ConnectionPool.java:705)
              at jeus.jdbc.connectionpool.ConnectionPool.getConnection(ConnectionPool.java:642)
              at jeus.jdbc.datasource.DataSourceWrapper.getConnection(DataSourceWrapper.java:42)
              at jeus_jspwork._500_test_5fjsp._jspService(_500_test_5fjsp.java:64)
              at jeus.servlet.jsp.HttpJspBase.service(HttpJspBase.java:54)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
              at jeus.servlet.jsp.JspServletWrapper.executeServlet(JspServletWrapper.java:101)
              at jeus.servlet.engine.ServletWrapper.execute(ServletWrapper.java:214)
              at jeus.servlet.jsp.JspServletWrapper.execute(JspServletWrapper.java:147)
              at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:183)
  • false = 옵션이 없을 때

    • tmax@test:~/jeus5/config/test$ da 1
      JEUS 5.0 (fix #25) JDBC Connection Pool Controller
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      ==========================================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         2    10   2      1      0       false     true
      ==========================================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         2    10   10     0      1       false     true
      ==========================================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         2    10   10     0      2       false     true
      ==========================================================================
    • 와 같이 나왔으며 위의 정보 연결을 끊지 않고 12개를 띄웠을 때이다.
    • 다음 12번째 의 결과 이다
      ConnectionPool query is select sysdate from dual
      con is JeusConnection[ID=oracle-12,actual=oracle.jdbc.driver.LogicalConnection@ed3e63]
      ??깃?? : 2008-05-07 12:34:42.0
    • ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         3    10   10     0      5       false     true
      ==========================================================================
      test_container1>coninfo oracle
      ========================================================
      Connection information list for oracle
      --------------------------------------------------------
      | id                   | state | usecount | state time(sec)
      --------------------------------------------------------
      oracle-15             idle    0          27.0
      oracle-5              active  0          31.0
      oracle-8              active  0          30.0
      oracle-13             idle    0          28.0
      oracle-4              active  0          32.0
      oracle-12             idle    0          28.0
      oracle-1              active  1          34.0
      oracle-9              active  0          29.0
      oracle-14             idle    0          27.0
      oracle-10             active  0          29.0
      oracle-11             idle    0          29.0
      oracle-2              active  1          33.0
      oracle-6              active  0          31.0
      oracle-3              active  1          33.0
      oracle-7              active  0          30.0
      ========================================================
      test_container1>coninfo oracle
      ========================================================
      Connection information list for oracle
      --------------------------------------------------------
      | id                   | state | usecount | state time(sec)
      --------------------------------------------------------
      oracle-15             idle    0          69.0
      oracle-5              active  0          74.0
      oracle-8              active  0          72.0
      oracle-13             idle    0          70.0
      oracle-4              active  0          74.0
      oracle-12             idle    0          70.0
      oracle-1              active  1          77.0
      oracle-9              active  0          72.0
      oracle-14             idle    0          70.0
      oracle-10             active  0          71.0
      oracle-11             idle    0          71.0
      oracle-2              active  1          76.0
      oracle-6              active  0          73.0
      oracle-3              active  1          75.0
      oracle-7              active  0          73.0
      ========================================================
      test_container1>info
      ==========================================================================
      id     name       min  max  current  idle  disposable  waiting   working
      ==========================================================================
      1  oracle         3    10   10     0      9       false     true
      ==========================================================================
      test_container1>coninfo oracle
      ========================================================
      Connection information list for oracle
      --------------------------------------------------------
      | id                   | state | usecount | state time(sec)
      --------------------------------------------------------
      oracle-15             idle    0          90.0
      oracle-5              active  0          94.0
      oracle-17             idle    0          6.0
      oracle-18             idle    0          5.0
      oracle-8              active  0          93.0
      oracle-13             idle    0          91.0
      oracle-4              active  0          95.0
      oracle-12             idle    0          91.0
      oracle-1              active  1          97.0
      oracle-9              active  0          92.0
      oracle-14             idle    0          90.0
      oracle-10             active  0          92.0
      oracle-11             idle    0          92.0
      oracle-2              active  1          96.0
      oracle-6              active  0          94.0
      oracle-16             idle    0          7.0
      oracle-3              active  1          96.0
      oracle-7              active  0          93.0
      oracle-19             idle    0          5.0
      ========================================================
      test_container1>coninfo oracle
      ========================================================
      Connection information list for oracle
      --------------------------------------------------------
      | id                   | state | usecount | state time(sec)
      --------------------------------------------------------
      oracle-15             idle    0          121.0
      oracle-5              active  0          125.0
      oracle-17             idle    0          37.0
      oracle-18             idle    0          36.0
      oracle-8              active  0          124.0
      oracle-13             idle    0          121.0
      oracle-4              active  0          126.0
      oracle-12             idle    0          122.0
      oracle-1              active  1          128.0
      oracle-9              active  0          123.0
      oracle-14             idle    0          121.0
      oracle-10             active  0          123.0
      oracle-11             idle    0          122.0
      oracle-2              active  1          127.0
      oracle-6              active  0          125.0
      oracle-16             idle    0          37.0
      oracle-3              active  1          126.0
      oracle-7              active  0          124.0
      oracle-19             idle    0          35.0
      ========================================================
      test_container1>
    • <<__!Exception__>>
      jeus.jdbc.connectionpool.JeusSQLException: Failed to create a new PooledConnection from [oracle]
              at jeus.jdbc.connectionpool.ConnectionPool.getPooledConnection(ConnectionPool.java:468)
              at jeus.jdbc.connectionpool.ConnectionStore.createDisposableConnection(ConnectionStore.java:349)
              at jeus.jdbc.connectionpool.ConnectionPool.prepareConnection(ConnectionPool.java:825)
              at jeus.jdbc.connectionpool.ConnectionPool.innerGetConnection(ConnectionPool.java:705)
              at jeus.jdbc.connectionpool.ConnectionPool.getConnection(ConnectionPool.java:642)
              at jeus.jdbc.datasource.DataSourceWrapper.getConnection(DataSourceWrapper.java:42)
              at jeus_jspwork._500_test_5fjsp._jspService(_500_test_5fjsp.java:64)
              at jeus.servlet.jsp.HttpJspBase.service(HttpJspBase.java:54)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
              at jeus.servlet.jsp.JspServletWrapper.executeServlet(JspServletWrapper.java:101)
              at jeus.servlet.engine.ServletWrapper.execute(ServletWrapper.java:214)
              at jeus.servlet.jsp.JspServletWrapper.execute(JspServletWrapper.java:147)
              at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:183)
      Caused by: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12519, TNS:no appropriate service handler found
      The Connection descriptor used by the client was:
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=127.0.0.1))(CONNECT_DATA=(SID=orcl10)))

              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
              at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
              at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
              at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
              at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
              at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
              at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:297)
              at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:221)
              at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:157)
              at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:94)
              at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:75)
              at jeus.jdbc.connectionpool.ConnectionPool.getPooledConnection(ConnectionPool.java:444)
              ... 12 more

 

 

<JDBC type 특성>

  • type 1 : JDBC-ODBC Bridge

    • JDBC-ODBC Bridge는 JDBC가 ODBC Driver에 접근하는 통로를 제공한다.
    • 이것은 Sun에서 이미 구현을 해놓았다.
    • 주로 Window에서 ODBC에 등록해놓은 데이타베이스를 접근할 때 사용을 한다.
  • type 2 : Native - API partly - Java Driver

    • 벤데에서 제공하는 라이브러리를 이용해 DB를 엑서스한다는 의미
    • 그러므로 벤더에서 제공되는 2진 파일과 인터페이스 하기 위해 자바는 부분적으로 Java Native Method를 이용하게 된다.
    • 그래서 type 2 는 플렛폼에 의존적이다. 또한 servlet는 가능하나, applet는 불가능하다.
  • type 3 : JDBC - Net pure Java Driver

    • JDBC의 호출을 DBMS에 비종속적인 네트워크 프로토콜로 바꾼 후 다시 서버에 의해 원하는 DBMS의 프로토콜로 해석
    • 그래서 플렛폼과 프로토콜에 무관하게 DB와 연동하여 사용할 수 있다는 장점을 가지고 있다.
    • 그러나, 유로이며, 전문적인 드라이버 제공 회사가 있다.
  • type 4 : Native - protocol pure Java Driver

    • JDBC API는 DBMS가 사용하는 전용 프로토콜을 이용해 직접 인터페이스를 한다. 클라이언트에서 DBMS 서버로 직접 엑세스하게 되므로 인트라넷을 위한 작고 빠른 실용적인 대안이 된다.
    • 이것은 플렛폼에 무관하지 않고 독립적이다.
    • 앞에서 언급했듯이 DBMS의 프로토콜을 이용하여 접속을 한다.
    • 그래서 벤더의 JDBC 드라이버가 필요하다.(DBMS에 의존적):

 

<덤프 떠보기>

- 현재 실패한 상태.

 

출처 : http://negator.springnote.com/pages/1153896

반응형

'WAS > JEUS' 카테고리의 다른 글

JEUSMain.xml Datasource 암호 설정  (0) 2011.01.13
IBM JVM 튜닝 - 3  (0) 2009.08.24
JAVA HEAPDUMP 분석방법  (0) 2009.03.05
웹상에서 제우스 로그 확인하기  (0) 2009.03.05
제우스 연결 세션 병렬화  (0) 2009.03.05
반응형

Java 프로그램은 처음 시작할 때 사용할 Heap메모리 영역을 할당하고 시작한다. 만일 이러한 Heap영역이 부족하게 되면 OutOfMemoryError이라는 에러를 발생시키고 비정상 종료하게 된다.

이러한 OutOfMemoryError이 발생할 경우 개발자는 난감한 상황에 빠지게 되는데, 어떤 프로그램에서 메모리를 많이 잡아 먹었는지 파악하기 힘들기 때문이다.

이러한 경우 일반적으로 사용되는 도구가 Profiler인데, Profiler의 가장 큰 문제는 사용하게 되면 실행 속도가 10배 이상 느려져서 정상적으로 동작하기 힘들어 진다. 그래서 Profiler를 사용하게 되면 OutOfMemoryError이 발생하지 않는 경우도 종종 있다.

그러면 이러한 OutOfMemoryError를 좀더 현실적으로 진단할 방법은 무엇일까?

1. IBM JVM의 경우

IBM JVM을 사용해 보신 분들을 이미 알고 있겠지만 IBM에서는 Heapdump라는 메모리의 Heap정보를 파일로 추출하는 기능을 제공해 준다. (필자의 경우 IBM JVM의 가장 큰 장점이라고 생각하는 기능이다.)

AIX와 같은 IBM OS에서 프로그램을 실행시켜 보신 분들은 아래와 같은 파일이 생성된 것을 볼 수 있었을 것이다.

확장자가 phd로 끝나는 파일이 Heapdump파일이고 javacore로 시작되는 파일이 Threaddump 파일이다.

Threaddump는 파일을 읽는 방법만 익히면 어렵지 않게 읽을 수 있다. 관련 내용은 추후에 다른 포스트에서 설명하겠다.

하지만 Heapdump파일의 경우 별도의 Tool이 필요하다. IBM은 HeapRoots라는 명령창 기반 프로그램과 HeapAnalyzer라는 GUI기반 프로그램을 제공한다.

HeapRoots의 경우 복잡하지는 않지만 별도의 사용법을 알아야 하지만 HeapAnalyser의 경우 직관적인 UI가 제공되서 쉽게 사용이 가능하다.

각 프로그램은 다음 링크에서 다운 받을 수 있다.

Heap Analyzer를 실행한 화면은 아래와 같다.

 

2. SUN JVM의 경우

SUN JVM의 경우 Heapdump를 따로 제공하지 않았었다. 정석은 Profiler를 이용하는 것인네 너무 느리기 때문에 여러가지 편법들이 난무했는데, 그 중에는 IBM Heapdump 모듈을 이용하는 편법도 있었다.

IBM HeapDump for Solaris : http://www.skywayradio.com/tech/WAS51/IBMHeapDump/ 

하지만 JDK 1.4.1에서만 동작하고 1.4.2이후 버전에서는 동작하지 않는다는 치명적인 단점이 있었다.

시간이 지나 Java 5가 나오면서 SUN도 운영 관리의 중요성에 눈을 조금씩 떠가면서 JMX 가 추가되었고 HotSpot VM 명령 옵션에 Heapdump를  추출하는 옵션을 추가하게 되었다.

옵션은 다음과 같다.

-XX:+HeapDumpOnOutOfMemoryError

이 옵션은 1.5.0_07 이나 1.4.2_12 이상 버전 부터 지원한다.

옵션을 추가해서 실행하면 아래와 같이 나온다.

$ java -XX:+HeapDumpOnOutOfMemoryError -mn256m -mx512m ConsumeHeap
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid2262.hprof ...
Heap dump file created [531535128 bytes in 14.691 secs]
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at ConsumeHeap$BigObject.(ConsumeHeap.java:22)
        at ConsumeHeap.main(ConsumeHeap.java:32)

파일은 현재 폴더에 HPROF 바이너리 포멧으로 생성되고 JHAT(Java Heap Analysis Tool)와 같이 HPROF 포멧을 지원하는 툴로 분석할 수 있다.

JHAT : http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html

만일 폴더를 변경하려면 -XX:HeapDumpPath= 옵션을 이용할 수 있다.

관련 링크 : http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gdaog.html#gbzrr

                  http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gblfj.html

3. HP JVM의 경우

SUN JVM과 동일한데 1.5.0_04 나 1.4.2_11부터 지원한다. 상세한 내용은 아래 링크를 참고한다.

Java Troubleshooting Guide for HP-UX Systems : http://docs.hp.com/en/5992-1918/5992-1918.pdf

분석하는데 HPJtune를 사용한다.

HPjtune :  http://www.hp.com/products1/unix/java/java2/hpjtune/

 

 
 
반응형
반응형

------------------------------------------

tail_log_ajax.jsp

------------------------------------------

 

<%@ page contentType="text/html;charset=euc-kr" %>
<%@ page import="java.io.*" %>
<%!
public String toKorean(String param) {
 try{
  //param=new String(param.getBytes("ISO-8859-1"),"EUC-KR");
 }catch(Exception e){
 }
 return param;
}
%>

<%
response.setHeader("Pragma","No-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0);
response.setHeader ("Cache-Control", "no-cache");
%>

<%
//로그파일명
String log_filename = request.getParameter("log_filename") == null ? "": request.getParameter("log_filename");
long end_point = (request.getParameter("end_point")==null)? 0:Long.parseLong(request.getParameter("end_point")+"");
//로그파일이 있는 디렉토리
String log_dir = request.getParameter("log_dir");
if(log_dir==null||log_dir.length()==0){
 log_dir = "/home/jeus5/logs/vmstest/";
}

StringBuffer sb = new StringBuffer();
RandomAccessFile read_file = new RandomAccessFile(log_dir+"/"+log_filename, "r");
long str_length = read_file.length();
long start_point = (end_point>0)?end_point:str_length;
read_file.seek(start_point);  
String str;
long file_point = start_point;
while((str = read_file.readLine()) != null){
 sb.append(toKorean(str)+"\n");
 file_point = read_file.getFilePointer();
 read_file.seek(file_point);  
}
read_file.close();
String log_data = sb.toString();
out.print(file_point+","+log_data);
%>

 

 

-------------------------------------------

 

--------------------------------------------

tail_log.jsp

--------------------------------------------

 

<%@ page contentType="text/html;charset=euc-kr" %>
<%@ page import="java.io.*" %>
<%!
public String toKorean(String param) {
 try{
  //param=new String(param.getBytes("ISO-8859-1"),"EUC-KR");
 }catch(Exception e){
 }
 return param;
}
%>

<%
//로그파일이 있는 디렉토리
String log_dir = request.getParameter("log_dir");
if(log_dir==null||log_dir.length()==0){
 log_dir = "/home/jeus5/logs/vmstest/";
}

//화면에 나타낼 로그파일 길이
long log_length = 100000;
//로그파일명
String log_filename = request.getParameter("log_filename") == null ? "": request.getParameter("log_filename");

// 디렉토리인 객체를 생성
File myDir = new File(log_dir);
// 디렉토리의 내용 구하기
File[] list_files = myDir.listFiles();

//파일시작위치
long start_point = 0;
//파일끝위치
long end_point = 0;
//파일내용
String log_data = "";
if(!log_filename.equals("")){
 StringBuffer sb = new StringBuffer();
 RandomAccessFile read_file = new RandomAccessFile(log_dir+"/"+log_filename, "r");
 //파일 길이를 구한다.
 long str_length = read_file.length();
 //파일을 읽을 위치를 정한다.
 start_point = (str_length<log_length)?0:(str_length-log_length);
 read_file.seek(start_point);  
 String str;
 end_point = str_length;
 while((str = read_file.readLine()) != null){
  sb.append(toKorean(str)+"\n");
  //파일을 읽고 마지막 위치를 알아낸다.
  end_point = read_file.getFilePointer();
  read_file.seek(end_point);  
 }
 read_file.close();
 //파일내용
 log_data = sb.toString();
}
%>

<HTML>
<HEAD>
<title>로그파일보기</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
<!--
a {text-decoration:none; color: black;}
a:link {text-decoration:none; color: black;}
a:visited {text-decoration:none; color: black;}
a:active {text-decoration:none; color: black;}
a:hover {text-decoration:none; color:black;}
body,table,tr,td {  font-family: "굴림"; font-size: 9pt; font-style: normal; color: black;}
-->
</style>
<script>
 //ajax를 위한 함수입니다.
 function getXmlHttpRequest(){
  var xmlhttp = false;
  // Mozilla/Safari
  if (window.xmlhttpuest) {
    xmlhttp = new xmlhttpuest();
  }
  // IE
  else if (window.ActiveXObject) {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  return xmlhttp;
 }
</script>
</head>

<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
 <tr height="10%">
  <td align="left" valign="bottom">
   <table border="0" cellspacing="0" cellpadding="0">
   <form name="fileform" method="post" action="tail_log.jsp">
    <tr>
     <td align="left" valign="bottom" height="20">
      로그파일을 tail -f 명령어 처럼 보여줍니다.
     </td>
    </tr>
    <tr>
     <td>
      <select id="log_dir" name="log_dir" onChange="window.Location='tail_log.jsp?log_dir='+this.options[this.selectedIndex].value">
      <option value="/home/jeus5/logs/vmstest/">개발서버      
      </select><script>document.fileform.log_dir.value="<%=log_dir%>";</script>
      <select name="log_filename">
       <option value="">파일선택</option>
       <%
       if (list_files != null) {
        for (int i = 0; i < list_files.length; i++) {
         if(!list_files[i].isDirectory()){
          String filename = list_files[i].getName();
          filename = filename.substring(filename.lastIndexOf("/")+1,filename.length());
       %>
       <option value="<%=filename%>" <%=log_filename.equals(filename)?"selected":""%>><%=filename%></option>
       <%
         }
        }
       }
       %>
      </select>
     </td>
     <td>
      <input type="submit" value="로그파일보기">
     </td>
    </tr>
   </form>
   </table>
  </td>
 </tr>
 <tr height="90%">
  <td>
   <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
   <form name="logform">
    <tr>
     <td><!--textarea id="log_data_area" name="log_data" style="width:100%;height:100%;"></textarea--><xmp id="log_data" name="log_data" style="text-overflow:ellipsis;overflow:auto;border:1 solid #000000;width:1300;height:100%"><%=log_data%>
     </xmp></td>
    </tr>
   </form>
   </table>
  </td>
 </tr>
</table>
<%
if(!log_filename.equals("")){
%>
<script>
 var end_point = <%=end_point%>;
function include_ajax_repeat(){
  var url = 'tail_log_ajax.jsp?log_filename=<%=log_filename%>&end_point='+end_point;
  //alert(url);
  var xmlhttp = getXmlHttpRequest();
  if(url){
   xmlhttp.open("GET", url, true);
   xmlhttp.onreadystatechange = function() {
    if(xmlhttp.readyState == 4) {
     if(xmlhttp.status == 200) {
      var resText = xmlhttp.responseText;
      //마지막 위치
      end_point = resText.substring(0,resText.indexOf(','));
      //새로운 로그 데이타
      var data = resText.substring(resText.indexOf(',')+1,resText.length);
      log_data.innerText = log_data.innerText + data;
      //일정한 양의 로그데이타만 남긴다.
      if(log_data.innerText.length><%=log_length%>) log_data.innerText = log_data.innerText.substring(log_data.innerText.length-<%=log_length%>);
      //스크롤 이동
      document.getElementById('log_data').scrollTop=document.getElementById('log_data').scrollHeight+<%=log_length%>;
      xmlhttp = null;
     } else {
      //alert("Error loading "+url+", "+xmlhttp.status+"("+xmlhttp.statusText+")");
      top.window.title="Error loading "+url+", "+xmlhttp.status+"("+xmlhttp.statusText+")";
      xmlhttp = null;
     }
    }
   }
   xmlhttp.send(null);
  }  
  setTimeout("include_ajax_repeat()", 2000);//msec 마다 서버와 통신함
  return false;
 }
 function include_ajax_repeat_old(){
  var url = 'tail_log_ajax.jsp?log_filename=<%=log_filename%>&end_point='+end_point;
  //alert(url);
  var xmlhttp = getXmlHttpRequest();
  if(url){
   xmlhttp.open("GET", url, true);
   xmlhttp.onreadystatechange = function() {
    if(xmlhttp.readyState == 4) {
     if(xmlhttp.status == 200) {
      var resText = xmlhttp.responseText;
      //마지막 위치
      end_point = resText.substring(0,resText.indexOf(','));
      //새로운 로그 데이타
      var log_data = resText.substring(resText.indexOf(',')+1,resText.length);
      document.logform.log_data.value = document.logform.log_data.value + log_data;
      //일정한 양의 로그데이타만 남긴다.
      if(document.logform.log_data.value.length><%=log_length%>) document.logform.log_data.value = document.logform.log_data.value.substring(document.logform.log_data.value.length-<%=log_length%>);
      //스크롤 이동
      document.getElementById('log_data_area').scrollTop=document.getElementById('log_data_area').scrollHeight+<%=log_length%>;
     } else {
      //alert("Error loading "+url+", "+xmlhttp.status+"("+xmlhttp.statusText+")");
      top.window.document.title="Error loading "+url+", "+xmlhttp.status+"("+xmlhttp.statusText+")";
     }
    }
   }
   xmlhttp.send(null);
  }
  setTimeout("include_ajax_repeat()", 2000);//msec 마다 서버와 통신함
  return false;
 }
 include_ajax_repeat();
</script>
<%
}
%>
</body>
</html>

 

---------------------------------------------------------

 

출처 : http://realcool.egloos.com/4778358

*** 주의사항

Clustering 환경에서는 경로를 반드시 파일로 부터 읽어 와야 한다.

안그럼 무자게 많은 error 가 발생함.

반응형
반응형

<database>
                <vendor>oracle</vendor>
                <export-name>VIIMS</export-name>
                <data-source-class-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-class-name>
                <data-source-type>ConnectionPoolDataSource</data-source-type>
                <database-name>BILNS30</database-name>
                <data-source-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-name>
                <description>ICIS_NSBL_DB</description>
                <user>vimis</user>
                <password>votmdnjem</password>
                <property>
                   <name>URL</name>
                   <type>java.lang.String</type>
                   <value>jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=200.182.154.51)(Port=1523))(ADDRESS=(PROTOCOL=TCP)(Host=200.182.154.52)(Port=1523))(FAILOVER = o
n)(LOAD_BALANCE =off))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME=VIMIS)))</value>
                </property>
                <driver-type>thin</driver-type>
                <connection-pool>
                   <pooling>
                        <min>30</min>
                        <max>40</max>
                        <step>5</step>
                        <period>3600000</period>
                   </pooling>
                   <wait-free-connection>
                      <enable-wait>true</enable-wait>
                      <wait-time>2000</wait-time>
                   </wait-free-connection>
                   <check-query>select 1 from dual</check-query>
                   <check-query-period>300000</check-query-period>
                </connection-pool>
        </database>
반응형
반응형

$JEUS_HOME -> 제우스 설치 디렉토리(리눅스/유닉스용)
%JEUS_HOME% -> 윈도우 설치 디렉토리
 
제우스 설치 아뒤 기본 암호
administrator/jeusadmin
가끔 암호가 대문자일 경우가 있다 ^^

1. JEUS 3.x
$ encode 암호
ex) $ encode 암호
[jeusadmin] --> [amV1c2FkbWlu]

2. JEUS 4.x  : $JEUS_HOME/config/hostname/file_realm.xml 내용중 아래 password 수정
    <user>
        <user-name>administrator</user-name>
        <password>amV1c2FkbWlu</password>
        <role-name>system</role-name>
    </user>

* Windows> java -classpath "%JEUS_HOME%\lib\system\jeus.jar" jeus.security.Base64 <암호>
* UNIX> java -classpath $JEUS_HOME/lib/system/jeus.jar jeus.security.Base64 <암호>
예) $ java -classpath $JEUS_HOME/lib/system/jeus.jar jeus.security.Base64 암호
[jeusadmin] --> [amV1c2FkbWlu] --> [jeusadmin]

or encryption base64 <암호> ( 4.2.4.0 부터 지원)

3. JEUS 5.x
$JEUS_HOME/config/hostname/security/SYSTEM_DOMAIN/account.xml 내용중 아래수정
        <user>
            <name>administrator</name>
            <password>{base64}amV1c2FkbWlu</password>
            <group>Administrators</group>
        </user>

* Windows > java -classpath "%JEUS_HOME%\lib\system\jeus.jar" jeus.security.admin.Base64Coder  encode | decode <암호>
* Unix > java -classpath $JEUS_HOME/lib/system/jeus.jar jeus.security.admin.Base64Coder encode | decode <암호>
or encryption base64 <암호>

반응형

'WAS > JEUS' 카테고리의 다른 글

제우스 환경 설정 부분  (0) 2009.03.05
JAVA HEAPDUMP 분석방법  (0) 2009.03.05
웹상에서 제우스 로그 확인하기  (0) 2009.03.05
제우스 연결 세션 병렬화  (0) 2009.03.05
JEUS Administrator 명령  (0) 2009.03.05

+ Recent posts