I'm trying to connect to port 8020 on a CentOS vm but I'm getting telnet: connect to address <public_ip>: Connection refused
when I run telnet public_ip 8020
. When I run netstat -anp | grep 8020
I get
tcp 0 0 127.0.0.1:8020 0.0.0.0:* LISTEN 18908/java
tcp 0 0 127.0.0.1:38750 127.0.0.1:8020 TIME_WAIT -
I have other ports listening, telnet public_ip 50070
allows me to connect. The output for netstat on that is
tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN 18908/java
When I execute telnet localhost 8020
I get
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Do I need to do something to change the 127.0.0.1 in the netstat for 8020 to 0.0.0.0 like it is for the successful connection to 50070?
The output of iptables -L -v
is
Chain INPUT (policy ACCEPT 84481 packets, 11M bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 54190 packets, 6770K bytes)
pkts bytes target prot opt in out source destination
This is a hadoop service, the config that tells it to listen on port 8020 is in core-site.xml
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:8020</value>
</property>