1.使用jmeter执行脚本,在察看结果树的的响应数据中看到的错误提示如下:
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
2.解决办法:
①使用ps -ef|grep httpd查看lampp有没有启动,如图表示没有启动:
②那么执行/opt/lampp/lampp start去开启lampp
③重新执行jmeter,还是报同样的错误;这是因为Apache的日志中多了一个httpd.pid的文件。
④执行killall -9 httpd,然后到lampp的logs文件夹去删除httpd.pid文件,路径是(/opt/lampp/logs/httpd.pid):
⑤重新启动lampp
⑥再次使用jmeter就ok了