how to find rack id of a host in java programming language

163 Views Asked by At

Сan any body tell me if we do not provide any rack-awareness configuration to the hadoop, then hadoop rack-awareness will work or not. My basic purpose is to know, does hadoop able to know the rack id from system directly or we have to provide it threw a file.

Also Is there any way in java to fetch the rack id from the system. sorry if its silly question basically i don't know about how rack system works

1

There are 1 best solutions below

0
On

Hadoop has to be configured with the rackawareness script to figure out the machine to the rack mapping. Without this configuration it can't figure on it's own. More information about the rackawareness here and a sample script here. The script takes a machine/node as an input and returns the rack which it belongs to.