JMeter分布式测试主服务器启动失败:[No route to host (Host unreachable)]问题求助
Let’s tackle this frustrating issue—even though your EC2 instances can ping each other, that doesn’t always mean JMeter’s RMI (Remote Method Invocation) connections can get through. Here’s a step-by-step breakdown to get your distributed test up and running:
1. Verify JMeter is listening on the right IP/port
Ping checks ICMP, but JMeter uses TCP for RMI. First, make sure your slave node is binding to its public IP (not just the private EC2 internal IP):
- On the slave, edit
jmeter.propertiesand set:server.rmi.localport=1099 # Use a fixed port instead of random server.rmi.remote.host=204.xxx.xxx.xxx # Your slave's public IP - Restart the JMeter server on the slave with this command to force public IP binding:
./jmeter-server -Djava.rmi.server.hostname=204.xxx.xxx.xxx - On both master and slave, confirm JMeter is listening correctly with:
You should see the slave listening on its public IP:1099, and the master ready to connect out.ss -tulpn | grep java
2. Double-check EC2 Security Groups & Network ACLs
You mentioned opening necessary ports, but let’s confirm the bidirectional rules:
- Slave Security Group: Allow inbound traffic from your master’s public IP (54.xxx.xx.xx) on port 1099 (and any other fixed ports you set for JMeter).
- Master Security Group: Allow outbound traffic to your slave’s public IP on port 1099. Don’t forget—your master initiates the connection to the slave, so outbound rules matter here.
- Network ACLs: These are subnet-level firewalls, so ensure both inbound and outbound rules allow TCP traffic on port 1099 between the two instances’ public IPs. Network ACLs are stateless, so you need explicit allow rules for both directions.
3. Test Port Connectivity Directly
Skip JMeter for a second—test if the master can actually reach the slave’s RMI port:
- On the master, run:
Or ifnc -zv 204.xxx.xxx.xxx 1099ncisn’t installed:
If this fails, your network setup (security groups/ACLs/firewall) is the problem. If it succeeds, move on to JMeter-specific configs.telnet 204.xxx.xxx.xxx 1099
4. Align JMeter Configs & Versions
- On the master, update
jmeter.propertiesto point to the slave’s public IP with the correct port:remote_hosts=204.xxx.xxx.xxx:1099 - Critical: Ensure both master and slave are running the exact same JMeter version. Even minor version differences can break RMI connections, leading to "no route to host" errors that don’t actually relate to networking.
5. Check Instance-Level Firewalls
EC2 security groups are usually the main barrier, but some instances have local firewalls enabled:
- On Ubuntu/Debian, check
ufw status—if active, allow port 1099:sudo ufw allow from 54.xxx.xx.xx to any port 1099 - On RHEL/CentOS, check
iptables -L—add a rule to allow inbound traffic from the master on port 1099, or temporarily stop the firewall to test.
Once you’ve worked through these steps, try starting your distributed test again. Most often, the issue comes down to JMeter binding to the private EC2 IP instead of the public one, or missing outbound rules on the master’s security group.
内容的提问来源于stack exchange,提问作者ayman salman

