简体   繁体   English

连接到 jmeter 从站 docker 容器时出现连接被拒绝错误

[英]Connection refused error while connecting to jmeter slave docker container

I'm trying to implement Jmeter distributed framework with Docker.我正在尝试使用 Docker 实现 Jmeter 分布式框架。 Master and slaves are running on different hosts in ec2.主从运行在 ec2 的不同主机上。 Ports have been opened to allow communication.端口已打开以允许通信。

Master is stuck with the below message主人被以下消息卡住了

Starting distributed test with remote engines: [slaveIP:1099] @ Sun Nov 21 04:50:29 GMT 2021 (1637470229447)
Remote engines have been started:[slaveIP:1099]

On the slave side, it is throwing me connection refused errors.在从站方面,它向我抛出了连接被拒绝的错误。

java.rmi.ConnectException: Connection refused to host: 172.17.0.2; nested exception is:

Command to start slave machine:启动从机的命令:

docker run \
        -dit \
        -p 6000:6000 \
        -p 1099:1099 \
        -v "${volume_path}":${jmeter_path} \
        --rm \
        jmeter \
        -n -s \
        -Jclient.rmi.localport=3000 \
        -Jserver.rmi.localport=6000 \
        -Dserver_port=1099 \
        -Djava.rmi.server.hostname=<HostIP> \
        -Dserver.rmi.ssl.disable=true \
        -j ${jmeter_path}/server/slave_${timestamp}_${IP_ADD}.log

Command to start master启动master的命令

docker run \
  -v "${volume_path}":${jmeter_path} \
  -p 3000:3000 \
  --rm \
  jmeternew \
  -n -X \
   -t ${jmeter_path}/$1 \
  -Dserver.rmi.ssl.disable=true \
  -Dclient.rmi.localport=3000 \
  -R slaveIP:1099 \
  -l ${jmeter_path}/client/result_${timestamp}.jtl \
  -j ${jmeter_path}/client/jmeter_${timestamp}.log

The same commands are working if I'm running master and slave on the same machine.如果我在同一台机器上运行 master 和 slave,则相同的命令正在工作。 I tried changing the java.rmi.server.hostname=0.0.0.0.我尝试更改 java.rmi.server.hostname=0.0.0.0。 It's also throwing me connection refused error它也让我连接被拒绝错误

According to:根据:

Just we need:只是我们需要:

  • configure the slave machine配置从机
  • configure the run machine配置运行机器
  • add the slave ip/ips on the master using the file jmeter/bin/jmeter.properties使用文件jmeter/bin/jmeter.properties在主服务器上添加从 IP/IP
  remote_hosts=192.165.0.10,192.165.0.20,192.165.0.30
  • the main and slave ports are randomly assigned so you should use parameters: client.rmi.localport and server.rmi.localport respectively.主端口和从端口是随机分配的,因此您应该分别使用参数: client.rmi.localport 和 server.rmi.localport
  • then start the master jmeter然后启动主控 jmeter
  • then start the slave jmeter and the connection will be established.然后启动从机 jmeter 并建立连接。

advice建议

Establish the connection with docker, following and of the several tutorials on the internet.按照网上的几个教程,与 docker 建立连接。 This will help you to detect errors like:这将帮助您检测以下错误:

  • firewalls permissions防火墙权限
  • ports configuration on master and slave主从端口配置
  • public/private network restrictions公共/私人网络限制
  • etc ETC

If it works, then use docker to automate it.如果可行,则使用 docker 使其自动化。

  1. You're using 172.17.0.2 which is kind of local network address for Class B networks so your "hosts" might not be able to reach each other, try using public IP addresses instead您正在使用172.17.0.2这是Class B 网络的一种本地网络地址,因此您的“主机”可能无法相互访问,请尝试使用公共 IP 地址
  2. You will need to open the RMI ports in your OS firewall and in EC2 security groups您需要在操作系统防火墙EC2 安全组中打开 RMI 端口
  3. I fail to see why would you need docker there, it doesn't add any value and only making things more complicated and consumes resources我不明白你为什么需要 docker 那里,它没有增加任何价值,只会让事情变得更复杂并消耗资源
  4. I fail to see the reason for going for the distributed testing there, one master and one slave is equal to one "load generator" machine which means that you can just run your test in command-line non-GUI mode from a single host and get the same results.我看不到在那里进行分布式测试的原因,一台主机和一台从机等于一台“负载生成器”机器,这意味着您可以从单个主机以命令行非 GUI 模式运行测试,并且得到相同的结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Selenium RemoteWebDriver与Selenium Docker Firefox容器连接时,如何解决“拒绝连接”错误? - How to fix “Connection Refused” error while connecting with Selenium Docker Firefox container from Selenium RemoteWebDriver? 连接拒绝从 docker 连接到 Elasticsearch docker 容器 - Connection Refused connecting from docker to Elasticsearch docker container 从 docker 容器连接到主机 mysql db 时连接被拒绝 - Connection refused when connecting to host mysql db from docker container 通过Jmeter进行负载测试时,Tomcat 7中的连接拒绝错误 - Connection refused error in Tomcat 7 while doing load testing through Jmeter Docker容器中数据库容器和docker中的java容器之间的连接被拒绝 - Connection refused in Docker container between database container and java container in docker 詹金斯奴隶“拒绝联系” - Jenkins Slave “Connection Refused” ConnectException:连接被拒绝(连接被拒绝) - 通过Jedis连接到Redis - ConnectException: Connection refused (Connection refused)- While connecting to Redis through Jedis 无法在 docker 容器之间进行通信 - 连接被拒绝 - cannot communicate between docker container - connection refused 尝试在Docker容器之间进行连接时连接被拒绝(连接被拒绝) - Connection refused (Connection refused) while trying to connect between docker containers Apache Tomcat连接使用JMeter对1000个用户进行负载测试时拒绝错误 - Apache Tomcat Connection Refused error while load testing with 1000 users using JMeter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM