기본 콘텐츠로 건너뛰기

5월, 2017의 게시물 표시

keytool 사용법

keytool.exe -genkey -alias juheon -keyalg RSA -keypass 1234qwer -storepass 1234qwer -keystore juheon.jks  keytool.exe -export -alias juheon -storepass 1234qwer -file juheon.cer -keystore juheon.jks  keytool.exe -importkeystore -srckeystore juheon.jks -destkeystore juheon.key.p12 -deststoretype PKCS12  D:\Java\32bit\jdk1.5.0_22\jre\lib\security\cacert  D:\Java\32bit\jdk1.5.0_22\bin\keytool.exe -import -alias tsasample -keystore  D:\Java\32bit\jdk1.5.0_22\jre\lib\security\cacert -file D:\workspace\Servers\tsa-server-web-config\tomcat.cer  keytool -import -alias somansa -keystore C:\Program Files\Java\jdk1.8.0_102\jre\lib\security\cacert -file c:\somansa.cer #인증서 생성  keytool -genkey -alias keyAlias -keyalg RSA -keypass changeit -storepass changeit –validity 9999 -keystore keystore.jks  keytool -export -alias keyAlias -storepass changeit -file server.cer -keystore keystore.jks  keytool -import -v -trustcacerts -alias keyAlias -file server.cer ...

Java thread dump

JAVA_HOME/bin/jstack <pid> > filename.txt ex) C:\Program Files\Java\jdk1.6.0_45\bin>jps -v 5084 Jps -Dapplication.home=C:\Program Files\Java\jdk1.6.0_45 -Xms8m 8336 Bootstrap -Djdk.tls.ephemeralDHKeySize=2048 -Djava.util.logging.config.file=C:\apache-tomcat-7.0.73\conf\logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=C:\apache-tomcat-7.0.73\endorsed -Dcatalina.base=C:\apache-tomcat-7.0.73 -Dcatalina.home=C:\apache-tomcat-7.0.73 -Djava.io.tmpdir=C:\apache-tomcat-7.0.73\temp C:\Program Files\Java\jdk1.6.0_45\bin>jstack 8336 > dump.txt

Java jstat로 메모리 모니터링

우선 간단히 확인하면 아래처럼 나온다. jstat -옵션 -pid -시간 하면 된다. ex)  ~]jstat -gc 16543 1000 저건 pid 16543(java)를 1초에 한번씩 결과값을 보여달란거다.  pid는 ps -efw | grep java로 알아내면 된다. or JAVA_HOME/bin/jps -v ~] jstat --help  invalid argument count Usage: jstat -help|-options        jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]] Definitions:   <option>      An option reported by the -options option   <vmid>        Virtual Machine Identifier. A vmid takes the following form:                      <lvmid>[@<hostname>[:<port>]]                 Where <lvmid> is the local vm identifier for the target        ...