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 sejong king <se...@yahoo.com> on 2008/12/02 06:32:11 UTC
${user.name}, ${user.host}?
Hello,
In hadoop-site.xml, hadoop.tmp.dir uses ${user.name} to retrieve the username for its directory. Is there a similar way to retrieve the name of the host that this particular datanode is starting up on? (in order to create unique directory names for each node. something along the lines of: user.host, user.local.name, machine.name, etc...)
Thanks!
-Sej
Re: ${user.name}, ${user.host}?
Posted by Doug Cutting <cu...@apache.org>.
Variables in configuration files may be Java system properties or other
configuration parameters. The list of pre-defined Java system
properties is at:
http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties()
Unfortunately the host name is not in that list. You could define it by
adding something like the following to conf/hadoop-env.sh:
HADOOP_DATANODE_OPTS="-Dhost.name=`hostname`"
Doug
sejong king wrote:
> Hello,
>
> In hadoop-site.xml, hadoop.tmp.dir uses ${user.name} to retrieve the username for its directory. Is there a similar way to retrieve the name of the host that this particular datanode is starting up on? (in order to create unique directory names for each node. something along the lines of: user.host, user.local.name, machine.name, etc...)
>
> Thanks!
> -Sej
>
>
>
>