-1

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>
9
  • Please post the output of IPTables -L -v If the service/application listening to 8020 needs to be accessible outside the box itself, then you probably want to change the config of the service in question to listen to 0.0.0.0
    – Joe
    Feb 1, 2016 at 23:04
  • what's the downvote for?
    – gary69
    Feb 1, 2016 at 23:07
  • how do I do that?
    – gary69
    Feb 1, 2016 at 23:10
  • What is listening on port 8020? Feb 1, 2016 at 23:12
  • hadoop, the port accessible through hdfs
    – gary69
    Feb 1, 2016 at 23:14

1 Answer 1

3
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://localhost:8020</value>
</property>

You told it to bind to localhost. That's not a good idea if you want it to be accessible from other machines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .