本文轉自:https://www.cnblogs.com/lsjdddddd/p/5806077.htmlhtml
有關jmeter分佈式測試的環境配置,大概就是那樣,可是每次想要進行jmeter分佈式測試的時候,老是會有各類奇怪的問題,下面整理了一些可能遇到的坑。java
問題:若是你的服務器名字和報錯的時候顯示的服務器名不一致(refuse to host:10.10.34.21,而服務器名明明是172.16.129.43)linux
只要錯誤中出現:Error in rconfigure() method java.rmi.ConnectException:Connection refused to host:10.10.34.21;nested exception is:java.net.ConnectException:connection timed out:connectwindows
那就就是服務器之間沒有連通。服務器
方案:這是服務器雙網卡形成的問題分佈式
在linux上 修改jmeter-server測試
RMI_HOST_DEF=-Djava.rmi.server.hostname=slave機器名.net
在windows上 修改jmeter.bat3d
新增set rmi_host=-Djava.rmi.server.hostname=本機ipserver
修改set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %DDRAW% %rmi_host%
問題:若是機器能夠開始測試,可是測試速度很是慢,測試結果也是很是大的值。
方案:檢查slave服務器和被測試服務器之間是否能夠ping通
問題:controller機器上收不到slave機器鏈接過來的信息。
方案:檢查slave服務器的hostname和/etc/hosts中服務器對應的名字是否相同
問題:slave服務器上能夠starting test,可是在jmeter界面上依舊報以下圖錯誤。
Connection refused to host:172.16.129.43;nested exception is:java.net.ConnectException:Connection timed out:connect.
方案:檢查slave服務器的防火牆是否打開,須要關閉
1) 重啓後生效
開啓: chkconfig iptables on
關閉: chkconfig iptables off
2) 即時生效,重啓後失效
開啓: service iptables start
關閉: service iptables stop