You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@whirr.apache.org by Russell Jurney <ru...@gmail.com> on 2013/07/30 23:08:27 UTC

How to find hostname of the node being booted?

I need to feed the hostname of the node/role being booted, and feed it into
a configuration file to tell the service which interface to bind to. I'm
probably a knucklehead, but I can't find this in examples.

How do I find the hostname of a node, to feed to configuration?

-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
Ah great, thanks!

Russell Jurney http://datasyndrome.com

On Jul 31, 2013, at 12:30 AM, Andrei Savu <sa...@gmail.com> wrote:

Yes. You also get PRIVATE_HOSTNAME and others.
On Jul 31, 2013 1:32 AM, "Russell Jurney" <ru...@gmail.com> wrote:

> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
> call that in my ActionHandler and then rely on those variables in other
> scripts?
>
>
> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com>wrote:
>
>> You have only one network interface on ec2. The public IP / hostname are
>> not exposed as devices. You can only bind to the private network.
>>
>>  All the properties Cluster.Instance are exposed as environment variables:
>>
>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>>
>> -- Andrei
>>
>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <
>> russell.jurney@gmail.com> wrote:
>>
>>> I need to feed the hostname of the node/role being booted, and feed it
>>> into a configuration file to tell the service which interface to bind to.
>>> I'm probably a knucklehead, but I can't find this in examples.
>>>
>>> How do I find the hostname of a node, to feed to configuration?
>>>
>>> --
>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome
>>> .com
>>>
>>
>>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
> com
>

Re: How to find hostname of the node being booted?

Posted by Andrei Savu <sa...@gmail.com>.
Yes. You also get PRIVATE_HOSTNAME and others.
On Jul 31, 2013 1:32 AM, "Russell Jurney" <ru...@gmail.com> wrote:

> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
> call that in my ActionHandler and then rely on those variables in other
> scripts?
>
>
> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com>wrote:
>
>> You have only one network interface on ec2. The public IP / hostname are
>> not exposed as devices. You can only bind to the private network.
>>
>> All the properties Cluster.Instance are exposed as environment variables:
>>
>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>>
>> -- Andrei
>>
>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <
>> russell.jurney@gmail.com> wrote:
>>
>>> I need to feed the hostname of the node/role being booted, and feed it
>>> into a configuration file to tell the service which interface to bind to.
>>> I'm probably a knucklehead, but I can't find this in examples.
>>>
>>> How do I find the hostname of a node, to feed to configuration?
>>>
>>> --
>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome
>>> .com
>>>
>>
>>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
> com
>

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
Pardon, should read "is this a limitation in whirr?" not druid


On Tue, Jul 30, 2013 at 3:49 PM, Russell Jurney <ru...@gmail.com>wrote:

> Hmmmm looking a bit deeper - in the Cluster class, I see the ability to
> get a list of IPs per ROLE. However... I have multiple possible instances
> for each and every ROLE, and every role has to know its own IP/hostname.
> The configuration file requires this.
>
> I looked at how the Hadoop configs work, and they assume one instance of
> certain types of nodes. Is this a limitation in druid - or can I just use
> something simple, like `hostname` - although I'm not sure how to get it
> back into my configuration builder in Java?
>
>
> On Tue, Jul 30, 2013 at 3:32 PM, Russell Jurney <ru...@gmail.com>wrote:
>
>> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
>> call that in my ActionHandler and then rely on those variables in other
>> scripts?
>>
>>
>> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com>wrote:
>>
>>> You have only one network interface on ec2. The public IP / hostname are
>>> not exposed as devices. You can only bind to the private network.
>>>
>>>  All the properties Cluster.Instance are exposed as environment
>>> variables:
>>>
>>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>>>
>>> -- Andrei
>>>
>>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <
>>> russell.jurney@gmail.com> wrote:
>>>
>>>> I need to feed the hostname of the node/role being booted, and feed it
>>>> into a configuration file to tell the service which interface to bind to.
>>>> I'm probably a knucklehead, but I can't find this in examples.
>>>>
>>>> How do I find the hostname of a node, to feed to configuration?
>>>>
>>>> --
>>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com
>>>> datasyndrome.com
>>>>
>>>
>>>
>>
>>
>> --
>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
>> com
>>
>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
> com
>



-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
Ah, Cluster.Instance is a static class. I can literally call Cluster.Instance.getPrivateHostname() any time. Thanks, sorry for the confusion.

Sent from my iPhone

On Jul 31, 2013, at 12:35 AM, Andrei Savu <sa...@gmail.com> wrote:

> I think you should use Cluster.Instance.getPrivateHostname in Java and PRIVATE_HOSTNAME in bash script.
> 
> Unfortunately this discussion is a lot longer and not that portable across clouds.
> 
> On Jul 31, 2013 1:50 AM, "Russell Jurney" <ru...@gmail.com> wrote:
> >
> > Hmmmm looking a bit deeper - in the Cluster class, I see the ability to get a list of IPs per ROLE. However... I have multiple possible instances for each and every ROLE, and every role has to know its own IP/hostname. The configuration file requires this. 
> >
> > I looked at how the Hadoop configs work, and they assume one instance of certain types of nodes. Is this a limitation in druid - or can I just use something simple, like `hostname` - although I'm not sure how to get it back into my configuration builder in Java?
> >
> >
> > On Tue, Jul 30, 2013 at 3:32 PM, Russell Jurney <ru...@gmail.com> wrote:
> >>
> >> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I call that in my ActionHandler and then rely on those variables in other scripts?
> >>
> >>
> >> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com> wrote:
> >>>
> >>> You have only one network interface on ec2. The public IP / hostname are not exposed as devices. You can only bind to the private network. 
> >>>
> >>> All the properties Cluster.Instance are exposed as environment variables:
> >>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
> >>>
> >>> -- Andrei
> >>>
> >>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <ru...@gmail.com> wrote:
> >>>>
> >>>> I need to feed the hostname of the node/role being booted, and feed it into a configuration file to tell the service which interface to bind to. I'm probably a knucklehead, but I can't find this in examples.
> >>>>
> >>>> How do I find the hostname of a node, to feed to configuration?
> >>>>
> >>>> -- 
> >>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com
> >>>
> >>>
> >>
> >>
> >>
> >> -- 
> >> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com
> >
> >
> >
> >
> > -- 
> > Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
Will do, but the challenge is being able to lookup Cluster.Instance when every Role has multiple nodes. This seems not possible. As you mention, I can write my config in Java, then use PRIVATE_HOSTNAME in sed or something.

Thanks,

Sent from my iPhone

On Jul 31, 2013, at 12:35 AM, Andrei Savu <sa...@gmail.com> wrote:

> I think you should use Cluster.Instance.getPrivateHostname in Java and PRIVATE_HOSTNAME in bash script.
> 
> Unfortunately this discussion is a lot longer and not that portable across clouds.
> 
> On Jul 31, 2013 1:50 AM, "Russell Jurney" <ru...@gmail.com> wrote:
> >
> > Hmmmm looking a bit deeper - in the Cluster class, I see the ability to get a list of IPs per ROLE. However... I have multiple possible instances for each and every ROLE, and every role has to know its own IP/hostname. The configuration file requires this. 
> >
> > I looked at how the Hadoop configs work, and they assume one instance of certain types of nodes. Is this a limitation in druid - or can I just use something simple, like `hostname` - although I'm not sure how to get it back into my configuration builder in Java?
> >
> >
> > On Tue, Jul 30, 2013 at 3:32 PM, Russell Jurney <ru...@gmail.com> wrote:
> >>
> >> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I call that in my ActionHandler and then rely on those variables in other scripts?
> >>
> >>
> >> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com> wrote:
> >>>
> >>> You have only one network interface on ec2. The public IP / hostname are not exposed as devices. You can only bind to the private network. 
> >>>
> >>> All the properties Cluster.Instance are exposed as environment variables:
> >>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
> >>>
> >>> -- Andrei
> >>>
> >>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <ru...@gmail.com> wrote:
> >>>>
> >>>> I need to feed the hostname of the node/role being booted, and feed it into a configuration file to tell the service which interface to bind to. I'm probably a knucklehead, but I can't find this in examples.
> >>>>
> >>>> How do I find the hostname of a node, to feed to configuration?
> >>>>
> >>>> -- 
> >>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com
> >>>
> >>>
> >>
> >>
> >>
> >> -- 
> >> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com
> >
> >
> >
> >
> > -- 
> > Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Andrei Savu <sa...@gmail.com>.
I think you should use Cluster.Instance.getPrivateHostname in Java and
PRIVATE_HOSTNAME in bash script.

Unfortunately this discussion is a lot longer and not that portable across
clouds.

On Jul 31, 2013 1:50 AM, "Russell Jurney" <ru...@gmail.com> wrote:
>
> Hmmmm looking a bit deeper - in the Cluster class, I see the ability to
get a list of IPs per ROLE. However... I have multiple possible instances
for each and every ROLE, and every role has to know its own IP/hostname.
The configuration file requires this.
>
> I looked at how the Hadoop configs work, and they assume one instance of
certain types of nodes. Is this a limitation in druid - or can I just use
something simple, like `hostname` - although I'm not sure how to get it
back into my configuration builder in Java?
>
>
> On Tue, Jul 30, 2013 at 3:32 PM, Russell Jurney <ru...@gmail.com>
wrote:
>>
>> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
call that in my ActionHandler and then rely on those variables in other
scripts?
>>
>>
>> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com>
wrote:
>>>
>>> You have only one network interface on ec2. The public IP / hostname
are not exposed as devices. You can only bind to the private network.
>>>
>>> All the properties Cluster.Instance are exposed as environment
variables:
>>>
https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>>>
>>> -- Andrei
>>>
>>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <
russell.jurney@gmail.com> wrote:
>>>>
>>>> I need to feed the hostname of the node/role being booted, and feed it
into a configuration file to tell the service which interface to bind to.
I'm probably a knucklehead, but I can't find this in examples.
>>>>
>>>> How do I find the hostname of a node, to feed to configuration?
>>>>
>>>> --
>>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com
datasyndrome.com
>>>
>>>
>>
>>
>>
>> --
>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com
datasyndrome.com
>
>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com
datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
Hmmmm looking a bit deeper - in the Cluster class, I see the ability to get
a list of IPs per ROLE. However... I have multiple possible instances for
each and every ROLE, and every role has to know its own IP/hostname. The
configuration file requires this.

I looked at how the Hadoop configs work, and they assume one instance of
certain types of nodes. Is this a limitation in druid - or can I just use
something simple, like `hostname` - although I'm not sure how to get it
back into my configuration builder in Java?


On Tue, Jul 30, 2013 at 3:32 PM, Russell Jurney <ru...@gmail.com>wrote:

> I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
> call that in my ActionHandler and then rely on those variables in other
> scripts?
>
>
> On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com>wrote:
>
>> You have only one network interface on ec2. The public IP / hostname are
>> not exposed as devices. You can only bind to the private network.
>>
>> All the properties Cluster.Instance are exposed as environment variables:
>>
>> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>>
>> -- Andrei
>>
>> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <
>> russell.jurney@gmail.com> wrote:
>>
>>> I need to feed the hostname of the node/role being booted, and feed it
>>> into a configuration file to tell the service which interface to bind to.
>>> I'm probably a knucklehead, but I can't find this in examples.
>>>
>>> How do I find the hostname of a node, to feed to configuration?
>>>
>>> --
>>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome
>>> .com
>>>
>>
>>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
> com
>



-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Russell Jurney <ru...@gmail.com>.
I see that PUBLIC_IP/PRIVATE_IP gets set in configure_hostnames - can I
call that in my ActionHandler and then rely on those variables in other
scripts?


On Tue, Jul 30, 2013 at 3:24 PM, Andrei Savu <sa...@gmail.com> wrote:

> You have only one network interface on ec2. The public IP / hostname are
> not exposed as devices. You can only bind to the private network.
>
> All the properties Cluster.Instance are exposed as environment variables:
>
> https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java
>
> -- Andrei
>
> On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney <russell.jurney@gmail.com
> > wrote:
>
>> I need to feed the hostname of the node/role being booted, and feed it
>> into a configuration file to tell the service which interface to bind to.
>> I'm probably a knucklehead, but I can't find this in examples.
>>
>> How do I find the hostname of a node, to feed to configuration?
>>
>> --
>> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
>> com
>>
>
>


-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: How to find hostname of the node being booted?

Posted by Andrei Savu <sa...@gmail.com>.
You have only one network interface on ec2. The public IP / hostname are
not exposed as devices. You can only bind to the private network.

All the properties Cluster.Instance are exposed as environment variables:
https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/Cluster.java

-- Andrei

On Wed, Jul 31, 2013 at 12:08 AM, Russell Jurney
<ru...@gmail.com>wrote:

> I need to feed the hostname of the node/role being booted, and feed it
> into a configuration file to tell the service which interface to bind to.
> I'm probably a knucklehead, but I can't find this in examples.
>
> How do I find the hostname of a node, to feed to configuration?
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.
> com
>