Multiple tomcats binary install on a single machine


#1

Hello everyone,

I’m trying to set up a box where there is three tomcats installations, all
of them full installations (and not instances) (different binary version
requirements)
I tried different things, such as creating multiple client/node on the same
machine and setting different run list.
However, I’m not sure this is supported configuration and this causes issue
as well because cookbooks will at some point try to manage the same
resources and cancel the changes from the other one.

I was thinking otherwise of forking a tomcat cookbook, replace all the
variables for example default[‘tomcat’][‘port’] to
default[‘project1’][‘tomcat’][‘port’] but that would mean integrating any
new changes to the tomcat cookbook would be very complicated. Also, if I
have three project on the same box, I’ll need to change that three times.

Is there any way to do something like this with Chef? Or should I look at
docker + chef eventually?
The same questions applies to java, if I need three different version of
java for the tomcats, then I also need to manage three replicas of the java
cookbooks.

Thanks for your inputs
Regards,

Emilien Floret

EdifiXio Grenoble, 23 Avenue Doyen Louis Weil, 38000 Grenoble
Mail : emilien.floret@edifixio.com
Tel : +33 6 16 58 37 66


#2

We rolled our own tomcat installation cookbook and we just unzip the tomcat
bundle from the Apache website into its own directory. This lets us have
multiple tomcats installed. We control the configuration of the container
in our application cookbooks. We keep all of the application specific stuff
in data bag.

Kent

On Mon, Apr 20, 2015 at 4:33 AM, Emilien Floret <emilien.floret@edifixio.com

wrote:

Hello everyone,

I’m trying to set up a box where there is three tomcats installations, all
of them full installations (and not instances) (different binary version
requirements)
I tried different things, such as creating multiple client/node on the
same machine and setting different run list.
However, I’m not sure this is supported configuration and this causes
issue as well because cookbooks will at some point try to manage the same
resources and cancel the changes from the other one.

I was thinking otherwise of forking a tomcat cookbook, replace all the
variables for example default[‘tomcat’][‘port’] to
default[‘project1’][‘tomcat’][‘port’] but that would mean integrating any
new changes to the tomcat cookbook would be very complicated. Also, if I
have three project on the same box, I’ll need to change that three times.

Is there any way to do something like this with Chef? Or should I look at
docker + chef eventually?
The same questions applies to java, if I need three different version of
java for the tomcats, then I also need to manage three replicas of the java
cookbooks.

Thanks for your inputs
Regards,

Emilien Floret

EdifiXio Grenoble, 23 Avenue Doyen Louis Weil, 38000 Grenoble
Mail : emilien.floret@edifixio.com
Tel : +33 6 16 58 37 66


#3

Hello,
Thanks for providing useful info.
Do you simply have the extraction in the tomcat cookbook or did you create
a provider that gets as argument a databag and that then does the
appropriate configuration ?

something like this in the application cookbook :

tomcat_install “tomcat” do
databag_for_install databag
end

With databag having

tomcat_port : xxx
tomcat_installpath : xxx
tomcat_jdbc : xxx

And then in the tomcat cookbook having something like

tomcatparam = data_bag_item(‘tomcat’, ‘databag’)
tomcatparam[‘port’] and using that in the server.xml template.

Or do you simply have the extraction in the tomcat cookbook and in the
application cookbook you push the configuration files as template ?

Thanks!

2015-04-20 14:45 GMT+02:00 Kent Perrier kent.perrier@gmail.com:

We rolled our own tomcat installation cookbook and we just unzip the
tomcat bundle from the Apache website into its own directory. This lets us
have multiple tomcats installed. We control the configuration of the
container in our application cookbooks. We keep all of the application
specific stuff in data bag.

Kent

On Mon, Apr 20, 2015 at 4:33 AM, Emilien Floret <
emilien.floret@edifixio.com> wrote:

Hello everyone,

I’m trying to set up a box where there is three tomcats installations,
all of them full installations (and not instances) (different binary
version requirements)
I tried different things, such as creating multiple client/node on the
same machine and setting different run list.
However, I’m not sure this is supported configuration and this causes
issue as well because cookbooks will at some point try to manage the same
resources and cancel the changes from the other one.

I was thinking otherwise of forking a tomcat cookbook, replace all the
variables for example default[‘tomcat’][‘port’] to
default[‘project1’][‘tomcat’][‘port’] but that would mean integrating any
new changes to the tomcat cookbook would be very complicated. Also, if I
have three project on the same box, I’ll need to change that three times.

Is there any way to do something like this with Chef? Or should I look at
docker + chef eventually?
The same questions applies to java, if I need three different version of
java for the tomcats, then I also need to manage three replicas of the java
cookbooks.

Thanks for your inputs
Regards,


#4

Our tomcat cookbook simply extracts the the zip archive of the tomcat
distribution in the location we want. The tomcat start-up script (so we can
set JVM parameters on an application basis) and configuration files are
templates within the application deployment cookbooks.

The parameters that change in a config file are set by pulling the data
from chef. They are set either in the attributes file for the cookbook, the
application data bag or in the environment.

On Wed, Apr 22, 2015 at 3:12 AM, Emilien Floret <emilien.floret@edifixio.com

wrote:

Hello,
Thanks for providing useful info.
Do you simply have the extraction in the tomcat cookbook or did you create
a provider that gets as argument a databag and that then does the
appropriate configuration ?

something like this in the application cookbook :

tomcat_install “tomcat” do
databag_for_install databag
end

With databag having

tomcat_port : xxx
tomcat_installpath : xxx
tomcat_jdbc : xxx

And then in the tomcat cookbook having something like

tomcatparam = data_bag_item(‘tomcat’, ‘databag’)
tomcatparam[‘port’] and using that in the server.xml template.

Or do you simply have the extraction in the tomcat cookbook and in the application cookbook you push the configuration files as template ?

Thanks!

2015-04-20 14:45 GMT+02:00 Kent Perrier kent.perrier@gmail.com:

We rolled our own tomcat installation cookbook and we just unzip the
tomcat bundle from the Apache website into its own directory. This lets us
have multiple tomcats installed. We control the configuration of the
container in our application cookbooks. We keep all of the application
specific stuff in data bag.

Kent

On Mon, Apr 20, 2015 at 4:33 AM, Emilien Floret <
emilien.floret@edifixio.com> wrote:

Hello everyone,

I’m trying to set up a box where there is three tomcats installations,
all of them full installations (and not instances) (different binary
version requirements)
I tried different things, such as creating multiple client/node on the
same machine and setting different run list.
However, I’m not sure this is supported configuration and this causes
issue as well because cookbooks will at some point try to manage the same
resources and cancel the changes from the other one.

I was thinking otherwise of forking a tomcat cookbook, replace all the
variables for example default[‘tomcat’][‘port’] to
default[‘project1’][‘tomcat’][‘port’] but that would mean integrating any
new changes to the tomcat cookbook would be very complicated. Also, if I
have three project on the same box, I’ll need to change that three times.

Is there any way to do something like this with Chef? Or should I look
at docker + chef eventually?
The same questions applies to java, if I need three different version of
java for the tomcats, then I also need to manage three replicas of the java
cookbooks.

Thanks for your inputs
Regards,