JMeter Perfmon指标采集器报java.net.connectException: connection refused求助
java.net.ConnectException: Connection refused Error Hey there, let’s work through this frustrating connection issue with your Perfmon metric collector. That java.net.ConnectException: Connection refused error tells us your collector can’t establish a connection to the target Linux server on port 4444—even though you’ve already opened the port. Here’s a step-by-step breakdown of what to check next:
Verify the Perfmon service is actually listening on port 4444
Opening the port doesn’t help if the service isn’t running or isn’t bound to that port. Run either of these commands on your Linux server to check:netstat -tulpn | grep 4444ss -tulpn | grep 4444
Look for an entry showing your Perfmon service (check the PID/process name column) listening on0.0.0.0:4444(allowing all IPs) or the specific IP your collector uses. If there’s no output, your service isn’t listening—double-check its configuration to ensure it’s set to use port 4444, then restart the service.Check firewall rules (and direction)
A common gotcha: opening the port doesn’t mean the firewall is allowing traffic in the right direction.- If your collector is on a remote machine, confirm your Linux server’s firewall (firewalld/iptables) has an inbound rule allowing traffic on 4444. For firewalld, that’d be
firewall-cmd --add-port=4444/tcp --permanentfollowed byfirewall-cmd --reload. - If the collector is local, test connecting to
localhost:4444first withtelnet localhost 4444ornc -zv localhost 4444. If that works but connecting via the server’s public IP fails, the service might be bound only to the loopback address (127.0.0.1)—update its config to listen on0.0.0.0instead.
- If your collector is on a remote machine, confirm your Linux server’s firewall (firewalld/iptables) has an inbound rule allowing traffic on 4444. For firewalld, that’d be
Test network connectivity from the collector’s machine
From the system running your Perfmon collector, runtelnet <Linux-server-IP> 4444ornc -zv <Linux-server-IP> 4444. If this fails, the issue isn’t on the Linux server alone—check for intermediate firewalls (like corporate routers, cloud security groups) that might be blocking port 4444 traffic between the two machines.Validate the Perfmon service is running properly
Even if the port shows as listening, the service might be in a broken state. Check its status withsystemctl status <your-perfmon-service-name>(for systemd systems) and look through its logs (usually in/var/log/or viajournalctl -u <service-name>) for startup errors or configuration issues.Temporarily disable the firewall (for testing only)
As a last quick check, temporarily stop your Linux firewall (systemctl stop firewalldoriptables -F) and retest the connection. If it works now, you know the problem is a misconfigured firewall rule—re-enable the firewall and fix the rule accordingly.
If you’ve gone through all these steps and still hit the same error, feel free to share more details: what type of Perfmon service are you running? Is the collector on the same network as the Linux server? Any recent changes to the server or collector config?
内容的提问来源于stack exchange,提问作者Limbo

