qunarcorp / bistoury

Bistoury是去哪儿网的java应用生产问题诊断工具,提供了一站式的问题诊断方案
GNU General Public License v3.0
4.01k stars 824 forks source link

运行成功了,但是主机信息都是空的 #29

Closed rolandx closed 5 years ago

rolandx commented 5 years ago

运行是成功了,但是主机信息什么点开后都是空的 ./quick_start.sh -p xxxx -j /usr/java/jdk1.8.0_211-amd64/ start image

xleiy commented 5 years ago

看一下bistoury-agent-bin/logs/bistoury-agent.out中有没有错误信息啊

cowcomic commented 5 years ago

我也是这样,页面什么都看不到,而且页面还经常弹出“websocket连接失败”

wikiwikiwiki commented 5 years ago

我也是这样,页面什么都看不到,而且页面还经常弹出“websocket连接失败”

你可以在这个页面(https://github.com/qunarcorp/bistoury/blob/dev-2/docs/cn/FAQ.md )看看第一条能不能解决。 不行的话可以进qq群我们仔细看一下日志

cowcomic commented 5 years ago

我也是这样,页面什么都看不到,而且页面还经常弹出“websocket连接失败”

你可以在这个页面(https://github.com/qunarcorp/bistoury/blob/dev-2/docs/cn/FAQ.md )看看第一条能不能解决。 不行的话可以进qq群我们仔细看一下日志

加了-i指定ip之后可以了 不过在看文件信息,jvm信息中的Jar Dependency的时候后台报错

com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) ~[tools.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasStarter.attachAgent(ArthasStarter.java:97) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasStarter.start(ArthasStarter.java:56) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:38) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:110) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:84) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:77) [bistoury-commands-2.0.3.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) [guava-20.0.jar:na] at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) [guava-20.0.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) [guava-20.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] [21:38:53 [log-agent-exec-12] QTraceId[] ERROR q.t.b.remoting.netty.TaskProcessor] - arthas command error, id [190830.213853.10.2.25.139.82732.25], command [appconfig -pid240229] java.lang.IllegalStateException: can not init bistoury, start arthas error, pid [240229],Agent JAR loaded but agent failed to initialize at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:114) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:84) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:77) ~[bistoury-commands-2.0.3.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) ~[guava-20.0.jar:na] at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) ~[guava-20.0.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) ~[guava-20.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] Caused by: java.lang.RuntimeException: start arthas error, pid [240229],Agent JAR loaded but agent failed to initialize at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:41) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:110) ~[bistoury-commands-2.0.3.jar:na] ... 9 common frames omitted

wikiwikiwiki commented 5 years ago

我也是这样,页面什么都看不到,而且页面还经常弹出“websocket连接失败”

你可以在这个页面(https://github.com/qunarcorp/bistoury/blob/dev-2/docs/cn/FAQ.md )看看第一条能不能解决。 不行的话可以进qq群我们仔细看一下日志

加了-i指定ip之后可以了 不过在看文件信息,jvm信息中的Jar Dependency的时候后台报错

com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) ~[tools.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasStarter.attachAgent(ArthasStarter.java:97) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasStarter.start(ArthasStarter.java:56) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:38) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:110) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:84) [bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:77) [bistoury-commands-2.0.3.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) [guava-20.0.jar:na] at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) [guava-20.0.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) [guava-20.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] [21:38:53 [log-agent-exec-12] QTraceId[] ERROR q.t.b.remoting.netty.TaskProcessor] - arthas command error, id [190830.213853.10.2.25.139.82732.25], command [appconfig -pid240229] java.lang.IllegalStateException: can not init bistoury, start arthas error, pid [240229],Agent JAR loaded but agent failed to initialize at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:114) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.getTelnet(AbstractTelnetStore.java:53) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:84) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.ArthasTask$1.call(ArthasTask.java:77) ~[bistoury-commands-2.0.3.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) ~[guava-20.0.jar:na] at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) ~[guava-20.0.jar:na] at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) ~[guava-20.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] Caused by: java.lang.RuntimeException: start arthas error, pid [240229],Agent JAR loaded but agent failed to initialize at qunar.tc.bistoury.commands.arthas.ArthasEntity.start(ArthasEntity.java:41) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.forceCreateClient(AbstractTelnetStore.java:149) ~[bistoury-commands-2.0.3.jar:na] at qunar.tc.bistoury.commands.arthas.telnet.AbstractTelnetStore.doGetTelnet(AbstractTelnetStore.java:110) ~[bistoury-commands-2.0.3.jar:na] ... 9 common frames omitted

你再看看第二条能不能解决...

cowcomic commented 5 years ago

第二条木有解决

xleiy commented 5 years ago

用户目录下logs/arthas/arthas.log这个日志发一下

cowcomic commented 5 years ago

用户目录下logs/arthas/arthas.log这个日志发一下

用户目录是指哪个目录?

cowcomic commented 5 years ago

image

xleiy commented 5 years ago

上面输出了已加载的所有类,里面应该是没有org.springframework.web.servlet.DispatcherServlet这个类,你需要使用-c参数指定一个类,因为不能是agent使用到的类,推荐使用用户自身中间件jar包或者spring中类,如果使用业务类,可能导致小部分功能不可用。可以看这里

cowcomic commented 5 years ago

image

image image

这里说的是要我的被监控程序需要有这个类吗?有啊

cowcomic commented 5 years ago

image 这是log日志的最开始

wikiwikiwiki commented 5 years ago

image 这是log日志的最开始

你是不是只是依赖了这个jar包,但是没有用到? 从“begin print all loaded classes”开始,打印了所有已加载的类,你看看是不是没有

cowcomic commented 5 years ago

image 这是log日志的最开始

你是不是只是依赖了这个jar包,但是没有用到? 从“begin print all loaded classes”开始,打印了所有已加载的类,你看看是不是没有

是在这所有已加载的类里面找DispatcherServlet吗? 这个打印的所有已加载的类是我自己服务里面加载的类吗? 那有另外一个问题了,这下面打印的所有已加载的类里面连我们自己的类都没有

wikiwikiwiki commented 5 years ago

这里会打印所有已加载的类, 如果自己的类都没有的话,那应该是加载错pid了

cowcomic commented 5 years ago

这里会打印所有已加载的类, 如果自己的类都没有的话,那应该是加载错pid了

应该没错,因为页面上栈信息都能出来

wikiwikiwiki commented 5 years ago

这里会打印所有已加载的类, 如果自己的类都没有的话,那应该是加载错pid了

应该没错,因为页面上栈信息都能出来

这里面显示已加载的类肯定是准确的,不过是在agent attach的时候的已加载类,后面并不会更新。 难道你这里attach的时候应用很多类都未加载? 你说的页面上栈信息是啥。

cowcomic commented 5 years ago

image image 这样配没错吧 我的服务是实时业务,有大量的对象是长期存在的,不应该没有已加载的类

cowcomic commented 5 years ago

我明明指定了-p 监控的是170690这个pid 为啥页面上报错的领一个pid image 这个PID也的确是我的另一个服务,但我并没有指定他啊

xleiy commented 5 years ago

这变优先级有点问题,你在bistoury-agent-bin/bin/bistoury-agent-env.sh的JAVA_OPTS 加上 -Dbistoury.pid.handler.jps.enable=false -Dbistoury.pid.handler.ps.enable=false,bug已经修复,下次一起发布