It seems like one advantage of this approach, in contrast to Igor’s approach, is the simple and most common case where node = machine can have reasonable defaults. I’ll try this to see how else it compares.
From: Bryan Baugher [mailto:firstname.lastname@example.org]
Sent: Tuesday, July 31, 2012 10:07 AM
Subject: [chef] Re: Multiple application instances on a node
On Tue, Jul 31, 2012 at 8:07 AM, Ian Buchanan <email@example.com:firstname.lastname@example.org> wrote:
I’ve tried to Google and search this mailing list but I might be missing the
right term for what I’m trying to accomplish.
I want to install and configure multiple web applications on the same node.
Although I’m writing a cookbook that does more, the standard apache2 cookbook
is a sufficient example. I can run the “web_app” definition many times to get a
conf file for each web app. However, I can’t work out how to store attributes
for each application. Is there a pattern for when there are multiple of the
same “thing” on a node?
You could try creating multiple ‘nodes’ on each physical machine so that each node would have its own instance of the application. You should be able to do this by running ‘chef-client -N [node_name] -k [node_key]’.
I have done this many times with my tomcat cookbook to setup several instances of tomcat, each with their own web apps.