You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Ian Nowland <in...@novell.com> on 2009/07/27 17:31:27 UTC

Trying to connect to remote hdfs through java

Hi,

I'm trying to set up a service to connect to hdfs on a remote server running Hbase and hadoop. However, I'm running into some connection problems. 

our hadoop-site.xml defines fs.default.name as hdfs://localhost:54310, and indeed sshing into the server and running a hadoop dfs -ls against that address lists the contents of the hadoop file system. However, a netstat -lptu also shows

tcp6       0      0 localhost:54310         [::]:*                  LISTEN      17252/java,

which tells me that the service is only listening to connections from localhost. How do I enable this service to listen to connections from anywhere?

My other question is that I believe this is the port that I should be connecting to inside java, but am not completely positive of that fact. If it is another port I am supposed to be connecting to, which one should it be, so that I can verify that the firewall is open for that port?

Thank you,

--Ian


Re: Trying to connect to remote hdfs through java

Posted by Steve Loughran <st...@apache.org>.
Ian Nowland wrote:
> Hi,
> 
> I'm trying to set up a service to connect to hdfs on a remote server running Hbase and hadoop. However, I'm running into some connection problems. 
> 
> our hadoop-site.xml defines fs.default.name as hdfs://localhost:54310, and indeed sshing into the server and running a hadoop dfs -ls against that address lists the contents of the hadoop file system. However, a netstat -lptu also shows
> 
> tcp6       0      0 localhost:54310         [::]:*                  LISTEN      17252/java,
> 
> which tells me that the service is only listening to connections from localhost. How do I enable this service to listen to connections from anywhere?
> 

1. Hadoop shouldn't be using IPv6 at all; start the JVM with 
-Djava.net.preferIPv4Stack=true

2. your fs.default.name should be the hostname of the machine "namenode1"

3. you should make sure that /etc/hosts on that machine doesn't point 
the hostname back to localhost. Ubuntu has started to do this, which may 
eliminated support calls related to laptops and badly configured DNS 
servers, but causes problems on hadoop.

4. the test is try to telnet to the port remotely, via "telnet namenode 
1 54310", if you can connect, then your NN may be up.

-steve