EC2 node names

14 views
Skip to first unread message

Paolo Di Tommaso

unread,
Feb 22, 2012, 11:22:35 AM2/22/12
to jcl...@googlegroups.com
Dear all, 

Is there a way to provide a naming strategy for the nodes in a cluster? 

I mean, let's suppose that I want to create a cluster with 10 nodes named like that: 

master, node01, node02, .. node09

How to do that ? 

Cheers,
Paolo

Adrian Cole

unread,
Feb 22, 2012, 3:15:23 PM2/22/12
to jcl...@googlegroups.com
Hi, paulo.

there's no nice way to do this, right now.  The logic is somewhat tangled in CreateNodesWithGroupEncodedIntoNameThenAddToSet.  Can you add an issue for this feature? 

http://code.google.com/p/jclouds/issues

Cheers,
-A


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/ZrpnVfj0HtUJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Paolo Di Tommaso

unread,
Feb 23, 2012, 7:45:40 AM2/23/12
to jcl...@googlegroups.com
Hi Adrian, 


Anyway my idea was to have a way to distinguish the nodes role in a group so that I can apply the configuration accordingly. 

For example consider the following use case:  Create and configure a cluster in which one node is the master the others are clients.  The configuration for master node has to be different form the client nodes. 

I was thinking to use the name as discriminator with the method runScriptOnNodesMatching. 

Does it make sense?   Would be better to use to separate groups to do that ? 


In general, what is the best approach to handle a use case like this with JClouds.

Thank you a lot. 

Paolo 

Adrian Cole

unread,
Feb 23, 2012, 7:51:21 AM2/23/12
to jcl...@googlegroups.com
Hi, Paolo.

Thanks for logging the issue and thinking this through.  In jclouds, the idiomatic way would be to make a group for each identically configured set of nodes.  So, you'd have a group called master with one node in it and a group called client with a variable count.

Make sense?
-A

Paolo Di Tommaso

unread,
Feb 23, 2012, 7:57:32 AM2/23/12
to jcl...@googlegroups.com
Quite clear. 

But if so how to distinguish different cluster instances? Let's suppose you have a NFS based cluster with 10 nodes and a Hadoop based cluster with 20 nodes. 

I was supposing to use the group name to do that. 


Thanks, Paolo

Adrian Cole

unread,
Feb 23, 2012, 8:04:04 AM2/23/12
to jcl...@googlegroups.com
in this case, the nodes have different roles, so they'd be easiest as different groups.

If you want the same group to have different roles inside, you'd be best using a config management solution to distinguish the difference, and utiliize its database as a part of the Predicate<NodeMetadata> used in jclouds commands.

ex. if your config management has a search, you'd say to jclouds:

runScriptOnNodesMatching(new Predicate<NodeMetadata>(){
public boolean apply(NodeMetadata in){
return configQuery.idsWithRole("NFS").contains(in.getId());
}

you can look at jclouds-chef for examples like this, or pallet, whirr, etc.

I hope this helps.
-A

Paolo Di Tommaso

unread,
Feb 23, 2012, 8:59:19 AM2/23/12
to jcl...@googlegroups.com
OK. Thanks. 

Actually I'm thinking that using the UserMetadata could be a valid alternative to have different roles inside a group. 

It is enough start the master node setting role=master as user metadata, and then create the remaining nodes with role=clients . 

Doing so this information would be showed in the AWS web console that could useful to administer the cluster. 

Thanks for your tips. 

Cheers,
Paolo

Adrian Cole

unread,
Feb 23, 2012, 9:21:20 AM2/23/12
to jcl...@googlegroups.com
yep. that would work, too. good idea.

-a

On Thu, Feb 23, 2012 at 3:59 PM, Paolo Di Tommaso

Reply all
Reply to author
Forward
0 new messages