Snowflake attributes

Hi everyone,

I am fairly experienced with Chef and always try to follow the rule to not
create ‘snowflake’ nodes and to put all attributes in a
role/environment/databag.

What if I want to setup more than one application server on the same machine?
My setup would be to create 2 chef nodes for the same machine and configure
them each separately, but I can’t use the same role because of port collisions.

Some possible solutions,

  • Create X roles if we need X servers on a single machine
  • Don’t put multiple servers on the same machine
  • Use node attributes
  • Have cookbook select free ports

The best solution to seems to be ‘Don’t put multiple servers on the same
machine’, but while I want that for other reasons then this problem it is
outside my control.

‘Create X roles if we need X servers on a single machine’ and ‘Use node
attributes’ are both obviously bad but work.

‘Have cookbook select free ports’, seems like it could have merit but could
complicate the deployment.

Any thoughts?

You can't configure multiple nodes to run on the same physical machine.
Doing so will introduce pain you can not imagine.

That being said, what you want to do isn't necessarily impossible. What you
want to do is introduce another level of abstraction and without knowing
too much about your setup I would advise looking into creating an
"application server" LWRP.

Tom Duffield — Automation Consulting Engineer

651.769.7497 – tom@opscode.com – *my:
*Linkedinhttp://www.linkedin.com/in/thomasduffield/
Twitter https://twitter.com/tomduffield

OPSCODE

CODE CAN
opscode.com http://www.opscode.com Blog http://www.opscode.com/blog/
Facebook http://www.facebook.com/opscode
Twitterhttp://www.twitter.com/opscode
YouTube http://www.youtube.com/opscode

On Tue, Oct 29, 2013 at 11:17 AM, bjbq4d@gmail.com wrote:

Hi everyone,

I am fairly experienced with Chef and always try to follow the rule to not
create 'snowflake' nodes and to put all attributes in a
role/environment/databag.

What if I want to setup more than one application server on the same
machine?
My setup would be to create 2 chef nodes for the same machine and configure
them each separately, but I can't use the same role because of port
collisions.

Some possible solutions,

  • Create X roles if we need X servers on a single machine
  • Don't put multiple servers on the same machine
  • Use node attributes
  • Have cookbook select free ports

The best solution to seems to be 'Don't put multiple servers on the same
machine', but while I want that for other reasons then this problem it is
outside my control.

'Create X roles if we need X servers on a single machine' and 'Use node
attributes' are both obviously bad but work.

'Have cookbook select free ports', seems like it could have merit but could
complicate the deployment.

Any thoughts?

Can you elaborate? I have been setting up multiple chef nodes on a single
machine for some time for things like running application X, Y, and Z or
multiple instances of application X all on the same machine.

On Tue, Oct 29, 2013 at 11:32 AM, Tom Duffield tom@opscode.com wrote:

You can't configure multiple nodes to run on the same physical machine.
Doing so will introduce pain you can not imagine.

That being said, what you want to do isn't necessarily impossible. What
you want to do is introduce another level of abstraction and without
knowing too much about your setup I would advise looking into creating an
"application server" LWRP.

Tom Duffield — Automation Consulting Engineer

651.769.7497 – tom@opscode.com – *my: *Linkedinhttp://www.linkedin.com/in/thomasduffield/
Twitter https://twitter.com/tomduffield

OPSCODE

CODE CAN
opscode.com http://www.opscode.com Bloghttp://www.opscode.com/blog/
Facebook http://www.facebook.com/opscode Twitterhttp://www.twitter.com/opscode
YouTube http://www.youtube.com/opscode

On Tue, Oct 29, 2013 at 11:17 AM, bjbq4d@gmail.com wrote:

Hi everyone,

I am fairly experienced with Chef and always try to follow the rule to not
create 'snowflake' nodes and to put all attributes in a
role/environment/databag.

What if I want to setup more than one application server on the same
machine?
My setup would be to create 2 chef nodes for the same machine and
configure
them each separately, but I can't use the same role because of port
collisions.

Some possible solutions,

  • Create X roles if we need X servers on a single machine
  • Don't put multiple servers on the same machine
  • Use node attributes
  • Have cookbook select free ports

The best solution to seems to be 'Don't put multiple servers on the same
machine', but while I want that for other reasons then this problem it is
outside my control.

'Create X roles if we need X servers on a single machine' and 'Use node
attributes' are both obviously bad but work.

'Have cookbook select free ports', seems like it could have merit but
could
complicate the deployment.

Any thoughts?

--
-Bryan

will it be possible to control both the apps from single role, where the
main role is composed of two sub roles, and each of the sub role uses the
parent port attribute to derive a new port number and then used that number
against the underlying recipe. we encounter such situations in scheduling
crons or other background jobs (e.g. performing log rotations for high
volume files on ext3), where we dont want them to run at same time. some
time its more complex and involves multi node setup (e.g. you can have
multiple cassandra nodes, and you dont want to run the repair jobs at same
time). this is not very elegant, but with sufficient specs, it works
predictably

best
ranjib

On Tue, Oct 29, 2013 at 9:17 AM, bjbq4d@gmail.com wrote:

Hi everyone,

I am fairly experienced with Chef and always try to follow the rule to not
create 'snowflake' nodes and to put all attributes in a
role/environment/databag.

What if I want to setup more than one application server on the same
machine?
My setup would be to create 2 chef nodes for the same machine and configure
them each separately, but I can't use the same role because of port
collisions.

Some possible solutions,

  • Create X roles if we need X servers on a single machine
  • Don't put multiple servers on the same machine
  • Use node attributes
  • Have cookbook select free ports

The best solution to seems to be 'Don't put multiple servers on the same
machine', but while I want that for other reasons then this problem it is
outside my control.

'Create X roles if we need X servers on a single machine' and 'Use node
attributes' are both obviously bad but work.

'Have cookbook select free ports', seems like it could have merit but could
complicate the deployment.

Any thoughts?