There's no such environment variable internally, But there's a work around.
Get the host name by using java api, and put the value into configuration,
just like this:

Configuration conf=new Configuration();
conf.set("hostname",InetAddress.getLocalHost().getHostName());

then you can use the ${hostname} in *-site.xml



On Thu, Mar 11, 2010 at 6:50 AM, Lu welman <[email protected]> wrote:

> Hi, all
>
> I saw that in *-site.xml, we can use ${user.name} to get the username of
> present user.
> If I want to get the environment $HOSTNAME, what should I do?
>
> I tried ${HOSTNAME}, ${env.hostname}, both of them can't work.
> It just return the string of "${HOSTNAME}" and "${env.hostname}"
> themselves.
>
> So can anybody tell me what I should use for get this environment?
> Thank you!
>
> welman Lu
>



-- 
Best Regards

Jeff Zhang

Reply via email to