3

我正在尝试启动并运行一个简单的 JProfiler localhost 会话。我已经创建了会话,主机是 127.0.0.1,端口是默认的 8849,并且我已经将启动/关闭命令指向了我的本地 tomcat 安装 startup.sh/shutdown.sh。我单击确定,我得到“连接到 127.0.0.1:8849”,150 秒后(我修改了超时)它超时并说:

无法连接到 127.0.0.1:8849。请确保远程地址正确,远程程序启动正常,网络路由允许socket连接。

地址不可能是错误的,并且我已经验证 (ps -ef|grep tomcat) 进程已启动,并且还检查了 tomcat 日志,它正在等待请求:

INFO: Starting Coyote HTTP/1.1 on http-8080
Apr 15, 2011 7:49:13 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 15, 2011 7:49:13 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/21  config=null
Apr 15, 2011 7:49:13 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 47312 ms

我还需要做些什么来打开端口吗?例如,我是否应该修改传递给 tomcat 的 JAVA_OPTS?

4

4 回答 4

4

是的。你需要这样的东西(对于 OS X)

export JAVA_OPTS="-agentlib:jprofilerti=port=8849  \
   -Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar"

export DYLD_LIBRARY_PATH=/Applications/jprofiler5/bin/macos

通常当您通过 JProfiler 中的向导配置新会话时,它会告诉您需要输入的确切参数。

对我来说,这个向导是 StartCenter -> New Session ,然后选择“New remote integration”。这将询问本地/远程、启动模式、jvm 类型、分析端口,并在第 6 页上显示“执行所需的修改”并列出这些。

或者,您可以从菜单栏中选择“集成向导”。

于 2011-04-15T15:00:35.837 回答
1

第 1 步:在 Linux 机器.bash_profile中从/root目录中打开文件。enter code here在.bash_profile 文件中输入 jprofiller 位置(使用下面的命令导出)

export LD_LIBRARY_PATH=/dsvol/jprofiler6/bin/linux-x86

第二步:进入Tomcat安装目录。从文件夹中打开catalina.sh文件 在bin文件中输入以下详细信息(catalina.sh文件中默认只有红色信息和黑色信息catalina.sh

export JPROFILER_HOME
JAVA_OPTS="-Xms768m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -agentpath:/opt/Performance/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849 $CATALINA_OPTS"

第 3 步:通过执行starup.sh命令从 bin 文件夹启动服务器

于 2011-12-07T15:00:23.600 回答
1

最简单的配置方法是遵循此处描述的 JProfiler 提供的向导,还有非常方便的非 GUI 向导:

http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/sessions/remote.html

例如对于 Tomcat,以下内容会自动插入到 Tomcat 的 startup.sh 脚本中,这意味着您不必猜测:


# The following lines have been added by the
# application server integration wizard of JProfiler

CATALINA_OPTS="-agentpath:/local/jprofiler8/bin/linux-x64/libjprofilerti.so=port=8849,nowait $CATALINA_OPTS"
export CATALINA_OPTS

# end of modifications

exec "$PRGDIR"/"$EXECUTABLE" run "$@"

祝你好运

于 2013-11-12T16:59:17.533 回答
1
-agentpath:/Applications/JProfiler.app/Contents/Resources/app/bin/macos/libjprofilerti.jnilib  -Xbootclasspath/a:/Applications/JProfiler.app/Contents/Resources/app/bin/agent.jar

这对我有用,JProfiler 9.1.1;OSX 10.11.3

于 2016-03-03T14:26:27.470 回答