zoukankan      html  css  js  c++  java
  • JMeter 压测Server Agent无法监控资源问题,PerfMon Metrics Collector报Waiting for sample,Error loading results file

    如何安装插件此博主已经说得很详细了。

    https://www.cnblogs.com/saryli/p/6596647.html

    但是需注意几点:

    1.修改默认端口,这样可以避免掉一个问题。ServerAgent默认是4444端口,当然你可以修改,比如:./startAgent.sh –-udp-port 0 –-tcp-port 3450这样。

    2.ServerAgent-2.2.1.zip下载下来之后拷贝到服务器上之后再进行解压。unzip ServerAgent-2.2.1.zip

     我的安装目录是/usr/local/Jmeter/ServerAgent-2.2.3

     (Jmeter从入门到MMP)

    在使用Jmeter的性能监控插件时遇到了几个问题mark一下:

    1.防火墙未关闭

    2.端口号被占用。linux下输入命令 lsof -i:4444查看是否有被占用。如果有,使用kill -9 25601关闭

    被占用会报如下错误

    [root@business01 ServerAgent-2.2.3]# sh startAgent.sh
    INFO 2019-01-25 15:52:36.544 [kg.apc.p] (): Binding UDP to 4444
    ERROR 2019-01-25 15:52:36.582 [kg.apc.p] (): Can't accept UDP connections
    java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.DatagramChannelImpl.bind(DatagramChannelImpl.java:691)
    at sun.nio.ch.DatagramSocketAdaptor.bind(DatagramSocketAdaptor.java:91)
    at kg.apc.perfmon.PerfMonWorker.listenUDP(PerfMonWorker.java:144)
    at kg.apc.perfmon.PerfMonWorker.startAcceptingCommands(PerfMonWorker.java:107)
    at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:174)
    INFO 2019-01-25 15:52:36.583 [kg.apc.p] (): Binding TCP to 4444
    ERROR 2019-01-25 15:52:36.586 [kg.apc.p] (): Can't accept TCP connections
    java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
    at kg.apc.perfmon.PerfMonWorker.listenTCP(PerfMonWorker.java:135)
    at kg.apc.perfmon.PerfMonWorker.startAcceptingCommands(PerfMonWorker.java:114)
    at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:174)

    3.未成功启动startAgent。下图是成功启动图。

    启动时使用此命令nohup sh startAgent.sh &(注意后面有一个&符号,此命令是不中断在后台运行)

    4.(这是主要问题)很多人都会出现如下问题Waiting for samples,

    执行了就是不出图形结果。解决方法:写入一个文件。

    但是不知道怎么写入文件呀,报Error loading results file - see file log错误。

    解决方法:新建一个txt文件,并添加以下文本之后保存。

    <?xml version="1.0" encoding="UTF-8"?>
    <testResults version="1.2">
    </testResults>

     也可直接,D:服务器性能监控数据.csv

    成功效果图

    弹出下图警告直接Overwrite existing file ,此警告是提示文件已存在。

    从左到右的按钮意思是:添加到现有文件、不要开始、覆盖现有文件

    5(这个也重要)如果有生成文件或者已创建的txt里有文字了,但是 还是显示Waiting for samples。那是因为你只发送了一条请求,执行时间少于1秒,所以线程组循环次数设置为永远吧!

     2号问题报错的开始

    [root@web01 ServerAgent-2.2.3]# sh startAgent.sh
    INFO 2018-12-11 17:39:44.960 [kg.apc.p] (): Binding UDP to 4444
    ERROR 2018-12-11 17:39:45.022 [kg.apc.p] (): Can't accept UDP connections
    java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.DatagramChannelImpl.bind(DatagramChannelImpl.java:691)
    at sun.nio.ch.DatagramSocketAdaptor.bind(DatagramSocketAdaptor.java:91)
    at kg.apc.perfmon.PerfMonWorker.listenUDP(PerfMonWorker.java:144)
    at kg.apc.perfmon.PerfMonWorker.startAcceptingCommands(PerfMonWorker.java:107)
    at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:174)
    INFO 2018-12-11 17:39:45.024 [kg.apc.p] (): Binding TCP to 4444
    ERROR 2018-12-11 17:39:45.029 [kg.apc.p] (): Can't accept TCP connections
    java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
    at kg.apc.perfmon.PerfMonWorker.listenTCP(PerfMonWorker.java:135)
    at kg.apc.perfmon.PerfMonWorker.startAcceptingCommands(PerfMonWorker.java:114)
    at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
    at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:174)

     2号问题的结束

    --udp-port 0 --tcp-port
  • 相关阅读:
    flash跨域策略文件crossdomain.xml配置详解
    ActionScript 3.0著名开源库 大集合
    SwiftSuspenders 1.6深入浅出1
    关于box2d相关学习教程记录一下
    as3框架集合
    写得蛮好的linux学习笔记七开机流程(收藏)
    写得蛮好的linux学习笔记一目录架构(收藏)
    写得蛮好的linux学习笔记三压缩命令(收藏)
    ListBox自绘,列表显示一系列图片
    Get WEB Page Content over Linux C
  • 原文地址:https://www.cnblogs.com/zdfbk/p/10107479.html
Copyright © 2011-2022 走看看