免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2716 | 回复: 0
打印 上一主题 下一主题

[WebLogic] 从WebLogic Server中抓取thread dump的不同方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 03:38 |只看该作者 |倒序浏览
<DIV>
<P>WebLogic Server (WLS) and Java offer several ways to generate thread dumps, which are listed below in order of preference. It's always better to obtain the thread dumps by using operating system (OS) commands rather than by using Java classes or the Administration Console, because if the console is hanging, users won't be able to connect to it to issue thread dumps.</P>
<OL>
<LI>Use operating system commands to get the thread dumps when WLS starts up from a command-line script:<BR>
<UL>
<LI>On Windows OSes, thread dumps can be created by
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">+ <EM>the thread dumps are generated in the server stdout</EM></DIV>
<LI>On POSIX compliant platforms (e.g. Solaris and Linux), first identify the process ID (<EM>pid</EM>) using&nbsp;ps -ef | grep java, then run
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">kill -3&nbsp;<EM>pid&nbsp;</EM>&gt; td_filename 2&gt;&amp;1&nbsp;</DIV>Signal 3 is equivalent to SIGQUIT.&nbsp; </LI></UL>
<LI>Using beasvc:&nbsp;
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">beasvc -dump -svcname:<EM>service_name</EM> -log:<EM>td_pathname</EM></DIV>
<UL>
<LI><EM>service_name&nbsp;</EM>is the Windows service that is running the server instance (e.g. mydomain_myserver)
<LI><EM>td_pathname </EM>is the full path and the name of the file in which the thread dump will be generated into </LI></UL>
<LI>Using weblogic.WLST:<BR>
<DIV class=kmcodeblock style="WIDTH: 95%">setDomain.cmd or setDomain.sh depending on the OS<BR>java weblogic.WLST&nbsp;<BR>connect("<EM>username"</EM>,"<EM>password"</EM>,"t3://:")&nbsp;<BR>threadDump()&nbsp;<BR></DIV>the thread dump will be generated in Thread_Dump_AdminServer.txt
<LI>From a command line or shell, a thread dump can be generated via the following command <EM>(deprecated from WLS 9.0)</EM>:<BR>
<DIV class=kmcodeblock style="WIDTH: 95%">setDomain.cmd or setDomain.sh depending on the OS<BR>java weblogic.Admin : -username -password THREAD_DUMP</DIV>The thread dump will be generated in the server stdout defined
<LI>From the WLS Administration Console a thread dump can be created by navigating to Server -&gt; -&gt; Monitoring -&gt; Dump threads stack. &nbsp;This method could lead to truncated thread dumps or incomplete thread dump.
<LI>From the JRockit command line:
<DIV class=kmcodeblock style="WIDTH: 95%">jrcmd print_threads</DIV></LI></OL></DIV>
<P>&nbsp;</P>
<P>转自:<A href="https://support.oracle.com/" target=_blank>https://support.oracle.com</A></P>
<P>wlst内容参考:<A href="http://download.oracle.com/docs/cd/E13222_01/wls/docs92/config_.ing/index.html" target=_blank>http://download.oracle.com/docs/cd/E13222_01/wls/docs92/config_scripting/index.html</A></P>
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP