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 zhang jianfeng <zj...@gmail.com> on 2009/08/25 02:47:34 UTC

localhost:9000 and ip:9000 is not the same ?

Hi all,



I have two computers, and in the hadoop-site.xml, I define the
fs.default.name as localhost:9000, then I cannot access the cluster with
Java API from another machine

But if I change it to its real IP  192.168.1.103:9000, then I can access the
cluster with Java API from another machine.

It’s so strange, are they any different ?



Thank you.

Jeff zhang

Re: localhost:9000 and ip:9000 is not the same ?

Posted by Edward Capriolo <ed...@gmail.com>.
On Mon, Aug 24, 2009 at 8:55 PM, Matt Massie<ma...@cloudera.com> wrote:
> Jeff-
>
> If you look in /etc/hosts, you see the "localhost" is 127.0.0.1 (and if you
> use IPv6, ::1).  This address is strictly loopback and can only be used for
> inter-process communication on a single machine.
>
> See: http://en.wikipedia.org/wiki/Localhost
>
> -Matt
>
>
> On Mon, Aug 24, 2009 at 5:47 PM, zhang jianfeng <zj...@gmail.com> wrote:
>
>> Hi all,
>>
>>
>>
>> I have two computers, and in the hadoop-site.xml, I define the
>> fs.default.name as localhost:9000, then I cannot access the cluster with
>> Java API from another machine
>>
>> But if I change it to its real IP  192.168.1.103:9000, then I can access
>> the
>> cluster with Java API from another machine.
>>
>> It’s so strange, are they any different ?
>>
>>
>>
>> Thank you.
>>
>> Jeff zhang
>>
>

You have to watch out for this fact when configuring multinode hadoop.
For example if your configuration uses
mapred.job.tracker=localhost:50030 you can run a job tracker on a
separate node but the other hosts in the cluster will not be able to
find it because they will look for it on localhost instead of where it
really is. Same applies for secondary namenode. It will run happily
repeating the a log like "not able to find namenode on
localhost:50030" hopefully you notice this before you need the
snapshot.

Re: localhost:9000 and ip:9000 is not the same ?

Posted by Matt Massie <ma...@cloudera.com>.
Jeff-

If you look in /etc/hosts, you see the "localhost" is 127.0.0.1 (and if you
use IPv6, ::1).  This address is strictly loopback and can only be used for
inter-process communication on a single machine.

See: http://en.wikipedia.org/wiki/Localhost

-Matt


On Mon, Aug 24, 2009 at 5:47 PM, zhang jianfeng <zj...@gmail.com> wrote:

> Hi all,
>
>
>
> I have two computers, and in the hadoop-site.xml, I define the
> fs.default.name as localhost:9000, then I cannot access the cluster with
> Java API from another machine
>
> But if I change it to its real IP  192.168.1.103:9000, then I can access
> the
> cluster with Java API from another machine.
>
> It’s so strange, are they any different ?
>
>
>
> Thank you.
>
> Jeff zhang
>

Re: localhost:9000 and ip:9000 is not the same ?

Posted by HRoger <ha...@163.com>.
fs.default.name is the run the namenode machine,is it 192.168.1.103?


zjffdu wrote:
> 
> Hi all,
> 
> 
> 
> I have two computers, and in the hadoop-site.xml, I define the
> fs.default.name as localhost:9000, then I cannot access the cluster with
> Java API from another machine
> 
> But if I change it to its real IP  192.168.1.103:9000, then I can access
> the
> cluster with Java API from another machine.
> 
> It’s so strange, are they any different ?
> 
> 
> 
> Thank you.
> 
> Jeff zhang
> 
> 

-- 
View this message in context: http://www.nabble.com/localhost%3A9000-and-ip%3A9000-is-not-the-same---tp25126420p25132806.html
Sent from the Hadoop core-user mailing list archive at Nabble.com.


Re: localhost:9000 and ip:9000 is not the same ?

Posted by Aaron Kimball <aa...@cloudera.com>.
Jeff,

Hadoop (HDFS in particular) is overly strict about machine names. The
filesystem's id is based on the DNS name used to access it. This needs to be
consistent across all nodes and all configurations in your cluster. You
should always use the fully-qualified domain name of the namenode in your
configuration.

- Aaron

On Mon, Aug 24, 2009 at 5:47 PM, zhang jianfeng <zj...@gmail.com> wrote:

> Hi all,
>
>
>
> I have two computers, and in the hadoop-site.xml, I define the
> fs.default.name as localhost:9000, then I cannot access the cluster with
> Java API from another machine
>
> But if I change it to its real IP  192.168.1.103:9000, then I can access
> the
> cluster with Java API from another machine.
>
> It’s so strange, are they any different ?
>
>
>
> Thank you.
>
> Jeff zhang
>