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 Ramya R <rr...@yahoo-inc.com> on 2008/11/26 07:36:46 UTC

How to retrieve rack ID of a datanode

Hi all,

 

I want to retrieve the Rack ID of every datanode. How can I do this?

I tried using getNetworkLocation() in
org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
as the output for all datanodes.

 

Any advice?

 

Thank in advance

Ramya

 


Re: How to retrieve rack ID of a datanode

Posted by Amar Kamat <am...@yahoo-inc.com>.
Ramya R wrote:
> Hi all,
>
>  
>
> I want to retrieve the Rack ID of every datanode. How can I do this?
>
> I tried using getNetworkLocation() in
> org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
> as the output for all datanodes.
>
>   
Have you setup the cluster to be rack-aware? Atleast in MR we have to 
provide a script that resolves the rack for a given node. Might be 
similar for DFS too. See topology.script.file.name parameter in 
hadoop-default.conf for more details.
Amar
>  
>
> Any advice?
>
>  
>
> Thank in advance
>
> Ramya
>
>  
>
>
>   


Re: How to retrieve rack ID of a datanode

Posted by Yi-Kai Tsai <yi...@yahoo-inc.com>.
hi Ramya

Setup topology.script.file.name in your hadoop-site.xml  and the script.

check http://hadoop.apache.org/core/docs/current/cluster_setup.html , 
Hadoop Rack Awareness section.


> Hi Lohit,
>   I have not set the datanode to tell namenode which rack it belongs to.
> Can you please tell me how do I do it? Is it using setNetworkLocation()?
>  
> My intention is to kill the datanodes in a given rack. So it would be
> useful even if I obtain the subnet each datanode belongs to.
>
> Thanks
> Ramya
>
> -----Original Message-----
> From: lohit [mailto:lohit_bv@yahoo.com] 
> Sent: Wednesday, November 26, 2008 12:26 PM
> To: core-user@hadoop.apache.org
> Subject: Re: How to retrieve rack ID of a datanode
>
> /default-rack is set when datanode has not set rackID. It is upto the
> datanode to tell namenode which rack it belongs to.
> Is your datanode doing that explicitly ?
> -Lohit
>
>
>
> ----- Original Message ----
> From: Ramya R <rr...@yahoo-inc.com>
> To: core-user@hadoop.apache.org
> Sent: Tuesday, November 25, 2008 10:36:46 PM
> Subject: How to retrieve rack ID of a datanode
>
> Hi all,
>
>
>
> I want to retrieve the Rack ID of every datanode. How can I do this?
>
> I tried using getNetworkLocation() in
> org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
> as the output for all datanodes.
>
>
>
> Any advice?
>
>
>
> Thank in advance
>
> Ramya
>   


-- 
Yi-Kai Tsai (cuma) <yi...@yahoo-inc.com>, Asia Regional Search Engineering.


Re: How to retrieve rack ID of a datanode

Posted by lohit <lo...@yahoo.com>.
I take that back. I forgot about the changes in new version of HDFS.
If you are testing this take a look at TestReplication.java
Lohit



----- Original Message ----
From: Ramya R <rr...@yahoo-inc.com>
To: core-user@hadoop.apache.org
Cc: lohit_bv@yahoo.com
Sent: Tuesday, November 25, 2008 11:15:28 PM
Subject: RE: How to retrieve rack ID of a datanode

Hi Lohit,
  I have not set the datanode to tell namenode which rack it belongs to.
Can you please tell me how do I do it? Is it using setNetworkLocation()?

My intention is to kill the datanodes in a given rack. So it would be
useful even if I obtain the subnet each datanode belongs to.

Thanks
Ramya

-----Original Message-----
From: lohit [mailto:lohit_bv@yahoo.com] 
Sent: Wednesday, November 26, 2008 12:26 PM
To: core-user@hadoop.apache.org
Subject: Re: How to retrieve rack ID of a datanode

/default-rack is set when datanode has not set rackID. It is upto the
datanode to tell namenode which rack it belongs to.
Is your datanode doing that explicitly ?
-Lohit



----- Original Message ----
From: Ramya R <rr...@yahoo-inc.com>
To: core-user@hadoop.apache.org
Sent: Tuesday, November 25, 2008 10:36:46 PM
Subject: How to retrieve rack ID of a datanode

Hi all,



I want to retrieve the Rack ID of every datanode. How can I do this?

I tried using getNetworkLocation() in
org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
as the output for all datanodes.



Any advice?



Thank in advance

Ramya


RE: How to retrieve rack ID of a datanode

Posted by Ramya R <rr...@yahoo-inc.com>.
Hi Lohit,
  I have not set the datanode to tell namenode which rack it belongs to.
Can you please tell me how do I do it? Is it using setNetworkLocation()?
 
My intention is to kill the datanodes in a given rack. So it would be
useful even if I obtain the subnet each datanode belongs to.

Thanks
Ramya

-----Original Message-----
From: lohit [mailto:lohit_bv@yahoo.com] 
Sent: Wednesday, November 26, 2008 12:26 PM
To: core-user@hadoop.apache.org
Subject: Re: How to retrieve rack ID of a datanode

/default-rack is set when datanode has not set rackID. It is upto the
datanode to tell namenode which rack it belongs to.
Is your datanode doing that explicitly ?
-Lohit



----- Original Message ----
From: Ramya R <rr...@yahoo-inc.com>
To: core-user@hadoop.apache.org
Sent: Tuesday, November 25, 2008 10:36:46 PM
Subject: How to retrieve rack ID of a datanode

Hi all,



I want to retrieve the Rack ID of every datanode. How can I do this?

I tried using getNetworkLocation() in
org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
as the output for all datanodes.



Any advice?



Thank in advance

Ramya

Re: How to retrieve rack ID of a datanode

Posted by lohit <lo...@yahoo.com>.
/default-rack is set when datanode has not set rackID. It is upto the datanode to tell namenode which rack it belongs to.
Is your datanode doing that explicitly ?
-Lohit



----- Original Message ----
From: Ramya R <rr...@yahoo-inc.com>
To: core-user@hadoop.apache.org
Sent: Tuesday, November 25, 2008 10:36:46 PM
Subject: How to retrieve rack ID of a datanode

Hi all,



I want to retrieve the Rack ID of every datanode. How can I do this?

I tried using getNetworkLocation() in
org.apache.hadoop.hdfs.protocol.DatanodeInfo. I am getting /default-rack
as the output for all datanodes.



Any advice?



Thank in advance

Ramya