Quantcast

Tomcat on macOS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tomcat on macOS

Israel Timoteo
Hi all,

My environment is Tomcat 8.5.12, Java 1.8.0_112 running on macOS 10.12 and planning to update Tomcat to 8.5.15.

I’m wondering if I can get comments from the community for my questions below?


1) What tools is the community using for simultaneous applications deployment on several servers, let’s say more than 20?

2) Would having the logs located outside of the Tomcat home directory, if possible, affect Tomcat operation?

3) Are there any recommendations/best practices for installing and running Tomcat 8.5.15 on macOS 10.12?

4) Is JAVA_OPTS required?



Thanks for your comments.

Israel



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Thad Humphries-2
On Wed, May 17, 2017 at 9:25 PM, Israel Timoteo <[hidden email]> wrote:

> Hi all,
>
> My environment is Tomcat 8.5.12, Java 1.8.0_112 running on macOS 10.12 and
> planning to update Tomcat to 8.5.15.
>
> I’m wondering if I can get comments from the community for my questions
> below?
>
>
> 1) What tools is the community using for simultaneous applications
> deployment on several servers, let’s say more than 20?
>
> 2) Would having the logs located outside of the Tomcat home directory, if
> possible, affect Tomcat operation?
>
> 3) Are there any recommendations/best practices for installing and running
> Tomcat 8.5.15 on macOS 10.12?
>

On #2 and #3, setup up separate CATALINA_HOME and CATALINA_BASE directories
as described in RUNNING.txt. This will keep logs out of CATALINA_HOME and
make upgrading to new releases of Tomcat fairly easy.

My Macs aren't production, so you may need to adapt this. I unpack Tomcat
releases to /Library/Tomcat. I remove all but ./bin and ./lib, and rename
./conf to ./conf-ORIG. I diff this ./conf-ORIG with the ./conf-ORIG from
the last release, making tweaks to my $CATALINA_BASE/conf files as
required. Then I create a link

    $ cd /Library/Tomcat
    $ tar zxvf ~/Downloads/apache-tomcat-8.5.11.tar.gz
... // remove subdirectories...
    $ rm catalina
    $ ln -s /Library/Tomcat/apache-tomcat-8.5.11 catalina

and in ~/.bash_profile `export CATALINA_HOME=/Library/Tomcat/catalina` (I
also set CATALINA_HOME and CATALINA_BASE in my org.apache.tomcat plist).
Now restart Tomcat.


>
> 4) Is JAVA_OPTS required?
>
>
>
> Thanks for your comments.
>
> Israel
>
>
>
>


--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Israel Timoteo
Thank Thad!


Any comments from the community for ...

1) What tools is the community using for simultaneous applications deployment on several servers, let’s say more than 20?

4) Is JAVA_OPTS required?





____________
Israel Timoteo

> On May 18, 2017, at 6:53 AM, Thad Humphries <[hidden email]> wrote:
>
> On Wed, May 17, 2017 at 9:25 PM, Israel Timoteo <[hidden email] <mailto:[hidden email]>> wrote:
>
>> Hi all,
>>
>> My environment is Tomcat 8.5.12, Java 1.8.0_112 running on macOS 10.12 and
>> planning to update Tomcat to 8.5.15.
>>
>> I’m wondering if I can get comments from the community for my questions
>> below?
>>
>>
>> 1) What tools is the community using for simultaneous applications
>> deployment on several servers, let’s say more than 20?
>>
>> 2) Would having the logs located outside of the Tomcat home directory, if
>> possible, affect Tomcat operation?
>>
>> 3) Are there any recommendations/best practices for installing and running
>> Tomcat 8.5.15 on macOS 10.12?
>>
>
> On #2 and #3, setup up separate CATALINA_HOME and CATALINA_BASE directories
> as described in RUNNING.txt. This will keep logs out of CATALINA_HOME and
> make upgrading to new releases of Tomcat fairly easy.
>
> My Macs aren't production, so you may need to adapt this. I unpack Tomcat
> releases to /Library/Tomcat. I remove all but ./bin and ./lib, and rename
> ./conf to ./conf-ORIG. I diff this ./conf-ORIG with the ./conf-ORIG from
> the last release, making tweaks to my $CATALINA_BASE/conf files as
> required. Then I create a link
>
>    $ cd /Library/Tomcat
>    $ tar zxvf ~/Downloads/apache-tomcat-8.5.11.tar.gz
> ... // remove subdirectories...
>    $ rm catalina
>    $ ln -s /Library/Tomcat/apache-tomcat-8.5.11 catalina
>
> and in ~/.bash_profile `export CATALINA_HOME=/Library/Tomcat/catalina` (I
> also set CATALINA_HOME and CATALINA_BASE in my org.apache.tomcat plist).
> Now restart Tomcat.
>
>
>>
>> 4) Is JAVA_OPTS required?
>>
>>
>>
>> Thanks for your comments.
>>
>> Israel
>>
>>
>>
>>
>
>
> --
> "Hell hath no limits, nor is circumscrib'd In one self-place; but where we
> are is hell, And where hell is, there must we ever be" --Christopher
> Marlowe, *Doctor Faustus* (v. 121-24)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Israel,

On 5/18/17 10:52 AM, Israel Timoteo wrote:
> Any comments from the community for ...
>
> 1) What tools is the community using for simultaneous applications
> deployment on several servers, let’s say more than 20?

I am using neither of these strategies, but...

a. FarmWebDeployer [1]
b. Auto-deploy + scp

Why in the world are you deploying a web application to 20+
macos-based servers? Or do you have a Macos client and 20+
non-macos-based servers?

> 4) Is JAVA_OPTS required?

JAVA_OPTS is only required if you require any java opts. Do you
require such options? Usually, when people set JAVA_OPTS they really
want to set CATALINA_OPTS instead.

Hope that helps,
- -chris

[1] http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkfAjIACgkQHPApP6U8
pFh0wQ/+K/LfMKZWQVkOtouH2IVihXol8n2tmN33GOtZMo1SJQ0YNEHsM5b0BPse
rR2iWuYH9lAbZYZaKA4CZRoUvHFL/3CfHrFhJlSnIZaqrLvJzPLoKUHrDlPiil1f
SSmKAhc6Bacv6xWFHlUOoGa5VD37sfj9Wh690kEKZhWBABOlHbZB3zJ5Vivxp8K3
l2Oht1gbpzSXX27TNlEHTv+x/4OddRq1inX5D4tI13G318PlueskKD79n5YJCXcQ
6PwlOxn7m3C0TifWrv62lUCg5CGBEYhuKfMiHOrU+s6z/bxuDKxbdZNvnHCbf3sM
he/6qGR289VXnwxmxcLkbyvf3Fr17AiE8k2RkJNfaOCh6mNmWMoNwl84KaLo51KB
VxnGK1VNlBE2jr9T0ll6YkKblgW9H1gvbWUEKKDfDHYBf85JHsWwu+LAiLjbYevH
hjeAp4rKmyjk+8NrzkWO+9gZvDgL4b6ud//sYcKq2x4VKAnP7IK3DyshccJvDolQ
JS7AcZTiWeZJKYh7XHj9XZ1IlQmVrjmitZVsiEsZNA/vR28Be/79NBcG22i5HizV
Oc0nw8BSO0eY3yuUoR90dlNyX1cPaDRHpQxac/41cxvqjHVxhc+W3qOoNGtU6lBp
3EZ0fohYMsBY3y84uEwV+iDkKLkfCiXJVHLPYebTPDCPI9ol74k=
=os19
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Mark Eggers
Chris,

On 5/19/2017 7:33 AM, Christopher Schultz wrote:

> Israel,
>
> On 5/18/17 10:52 AM, Israel Timoteo wrote:
>> Any comments from the community for ...
>
>> 1) What tools is the community using for simultaneous applications
>> deployment on several servers, let’s say more than 20?
>
> I am using neither of these strategies, but...
>
> a. FarmWebDeployer [1]
Doesn't this require a cluster (and therefore multicast)? That becomes
challenging in a cloud environment where there's no multicast easily
available.

> b. Auto-deploy + scp

This would be nice with a little scripting.

>
> Why in the world are you deploying a web application to 20+
> macos-based servers? Or do you have a Macos client and 20+
> non-macos-based servers?
>
>> 4) Is JAVA_OPTS required?
>
> JAVA_OPTS is only required if you require any java opts. Do you
> require such options? Usually, when people set JAVA_OPTS they really
> want to set CATALINA_OPTS instead.
>
> Hope that helps,
> -chris
>
> [1] http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
What I do is use Jenkins, Maven, Nexus, and a little Groovy scripting.

1. Maven with the Tomcat Maven Plugin [1]

The WAR file is customized (context.xml) based on the target environment.

2. Jenkins

The build is run by Jenkins, and the build number (with a little 0
padding via a Groovy script) is tacked onto the WAR name as app##0000nn.war.

This allows the parallel deploy feature to be used [2].

3. Nexus

This is where all of the base artifacts are stored. Nexus 2 is used
currently since Nexus 3 doesn't have the REST API needed to cleanly
interact with the Jenkins job via a Groovy script. Maybe I should learn
how to write a Nexus plugin to get lists of artifact versions via REST . . .

4. Groovy scripting

Groovy is used in Jenkins to do the following:

a. Query Nexus to get a list of artifact versions
b. Prevent non-production artifacts from landing on production platforms
c. Create the final number for parallel deployment

To expand this to multiple machines, a set of pipeline jobs could be
created.

a. Build the customized WAR for the target environment
b. Multiple jobs deploy to the servers in the target environment
c. Multiple jobs validate the deployment
d. Final job sends mail to interested parties with success / failure

I know that's a lot of infrastructure. There are certainly things that
could be done differently. Ant (with Ivy), or gradle could be used for
the builds. A different repository manager could be used (other than
Nexus). A different CI / CD system could be used (other than Jenkins).

Anything that meets at least the following requirements could be strung
together.

a. Reliable place to get the WAR file you need to deploy
b. Reliable build system that can be automated
c. Build system that can deploy to Tomcat
d. Testing that the deployment actually worked
e. Notification

The end result is that some authorized person can log into Jenkins,
select a version of an application to deploy, deploy it to the target
environment, know that it's been successful (or not), and have
notifications automatically sent out.

[1] http://tomcat.apache.org/maven-plugin.html
[2]
https://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Parallel_deployment

. . . just my (rather lengthy) 2 cents
/mde/


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Tomcat on macOS

Decker, Richard M
Mark,

> -----Original Message-----
> From: Mark Eggers [mailto:[hidden email]]
> Sent: Friday, May 19, 2017 10:44 AM
> To: Tomcat Users List <[hidden email]>
> Subject: Re: Tomcat on macOS
>
> Chris,
>
> On 5/19/2017 7:33 AM, Christopher Schultz wrote:
> > Israel,
> >
> > On 5/18/17 10:52 AM, Israel Timoteo wrote:
> >> Any comments from the community for ...
> >
> >> 1) What tools is the community using for simultaneous applications
> >> deployment on several servers, let’s say more than 20?
> >
> > I am using neither of these strategies, but...
> >
> > a. FarmWebDeployer [1]
>
> Doesn't this require a cluster (and therefore multicast)? That becomes
> challenging in a cloud environment where there's no multicast easily
> available.
>
> > b. Auto-deploy + scp
>
> This would be nice with a little scripting.
>
> >
> > Why in the world are you deploying a web application to 20+
> > macos-based servers? Or do you have a Macos client and 20+
> > non-macos-based servers?
> >
> >> 4) Is JAVA_OPTS required?
> >
> > JAVA_OPTS is only required if you require any java opts. Do you
> > require such options? Usually, when people set JAVA_OPTS they really
> > want to set CATALINA_OPTS instead.
> >
> > Hope that helps,
> > -chris
> >
> > [1]
> > http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
>
> What I do is use Jenkins, Maven, Nexus, and a little Groovy scripting.
>
> 1. Maven with the Tomcat Maven Plugin [1]
>
> The WAR file is customized (context.xml) based on the target environment.
>
> 2. Jenkins
>
> The build is run by Jenkins, and the build number (with a little 0 padding via a
> Groovy script) is tacked onto the WAR name as app##0000nn.war.

I don't mean to hijack the thread, but could you expand on this? Could you please provide examples of your Groovy scripts?

>
> This allows the parallel deploy feature to be used [2].
>
> 3. Nexus
>
> This is where all of the base artifacts are stored. Nexus 2 is used currently
> since Nexus 3 doesn't have the REST API needed to cleanly interact with the
> Jenkins job via a Groovy script. Maybe I should learn how to write a Nexus
> plugin to get lists of artifact versions via REST . . .
>
> 4. Groovy scripting
>
> Groovy is used in Jenkins to do the following:
>
> a. Query Nexus to get a list of artifact versions b. Prevent non-production
> artifacts from landing on production platforms c. Create the final number for
> parallel deployment
>
> To expand this to multiple machines, a set of pipeline jobs could be created.
>
> a. Build the customized WAR for the target environment b. Multiple jobs
> deploy to the servers in the target environment c. Multiple jobs validate the
> deployment d. Final job sends mail to interested parties with success / failure
>
> I know that's a lot of infrastructure. There are certainly things that could be
> done differently. Ant (with Ivy), or gradle could be used for the builds. A
> different repository manager could be used (other than Nexus). A different
> CI / CD system could be used (other than Jenkins).
>
> Anything that meets at least the following requirements could be strung
> together.
>
> a. Reliable place to get the WAR file you need to deploy b. Reliable build
> system that can be automated c. Build system that can deploy to Tomcat d.
> Testing that the deployment actually worked e. Notification
>
> The end result is that some authorized person can log into Jenkins, select a
> version of an application to deploy, deploy it to the target environment,
> know that it's been successful (or not), and have notifications automatically
> sent out.
>
> [1] http://tomcat.apache.org/maven-plugin.html
> [2]
> https://tomcat.apache.org/tomcat-8.0-
> doc/config/context.html#Parallel_deployment
>
> . . . just my (rather lengthy) 2 cents
> /mde/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[OT] Re: Tomcat on macOS

Mark Eggers
Richard,

On 5/19/2017 10:10 AM, Decker, Richard M wrote:

> Mark,
>
>> -----Original Message-----
>> From: Mark Eggers [mailto:[hidden email]]
>> Sent: Friday, May 19, 2017 10:44 AM
>> To: Tomcat Users List <[hidden email]>
>> Subject: Re: Tomcat on macOS
>>
>> Chris,
>>
>> On 5/19/2017 7:33 AM, Christopher Schultz wrote:
>>> Israel,
>>>
>>> On 5/18/17 10:52 AM, Israel Timoteo wrote:
>>>> Any comments from the community for ...
>>>
>>>> 1) What tools is the community using for simultaneous applications
>>>> deployment on several servers, let’s say more than 20?
>>>
>>> I am using neither of these strategies, but...
>>>
>>> a. FarmWebDeployer [1]
>>
>> Doesn't this require a cluster (and therefore multicast)? That becomes
>> challenging in a cloud environment where there's no multicast easily
>> available.
>>
>>> b. Auto-deploy + scp
>>
>> This would be nice with a little scripting.
>>
>>>
>>> Why in the world are you deploying a web application to 20+
>>> macos-based servers? Or do you have a Macos client and 20+
>>> non-macos-based servers?
>>>
>>>> 4) Is JAVA_OPTS required?
>>>
>>> JAVA_OPTS is only required if you require any java opts. Do you
>>> require such options? Usually, when people set JAVA_OPTS they really
>>> want to set CATALINA_OPTS instead.
>>>
>>> Hope that helps,
>>> -chris
>>>
>>> [1]
>>> http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
>>
>> What I do is use Jenkins, Maven, Nexus, and a little Groovy scripting.
>>
>> 1. Maven with the Tomcat Maven Plugin [1]
>>
>> The WAR file is customized (context.xml) based on the target environment.
>>
>> 2. Jenkins
>>
>> The build is run by Jenkins, and the build number (with a little 0 padding via a
>> Groovy script) is tacked onto the WAR name as app##0000nn.war.
>
> I don't mean to hijack the thread, but could you expand on this? Could you please provide examples of your Groovy scripts?
>
>>
>> This allows the parallel deploy feature to be used [2].
>>
>> 3. Nexus
>>
>> This is where all of the base artifacts are stored. Nexus 2 is used currently
>> since Nexus 3 doesn't have the REST API needed to cleanly interact with the
>> Jenkins job via a Groovy script. Maybe I should learn how to write a Nexus
>> plugin to get lists of artifact versions via REST . . .
>>
>> 4. Groovy scripting
>>
>> Groovy is used in Jenkins to do the following:
>>
>> a. Query Nexus to get a list of artifact versions b. Prevent non-production
>> artifacts from landing on production platforms c. Create the final number for
>> parallel deployment
>>
>> To expand this to multiple machines, a set of pipeline jobs could be created.
>>
>> a. Build the customized WAR for the target environment b. Multiple jobs
>> deploy to the servers in the target environment c. Multiple jobs validate the
>> deployment d. Final job sends mail to interested parties with success / failure
>>
>> I know that's a lot of infrastructure. There are certainly things that could be
>> done differently. Ant (with Ivy), or gradle could be used for the builds. A
>> different repository manager could be used (other than Nexus). A different
>> CI / CD system could be used (other than Jenkins).
>>
>> Anything that meets at least the following requirements could be strung
>> together.
>>
>> a. Reliable place to get the WAR file you need to deploy b. Reliable build
>> system that can be automated c. Build system that can deploy to Tomcat d.
>> Testing that the deployment actually worked e. Notification
>>
>> The end result is that some authorized person can log into Jenkins, select a
>> version of an application to deploy, deploy it to the target environment,
>> know that it's been successful (or not), and have notifications automatically
>> sent out.
>>
>> [1] http://tomcat.apache.org/maven-plugin.html
>> [2]
>> https://tomcat.apache.org/tomcat-8.0-
>> doc/config/context.html#Parallel_deployment
>>
>> . . . just my (rather lengthy) 2 cents
>> /mde/
>
I'll sanitize them and then send them on the list.

Please note that I currently rely on the Active Choices plugin which has
been blacklisted due to its dependency on the Scriptler plugin.

Active Choices has the security fix, but Scriptler does not. Until this
gets fixed, you have to download Active Choices from its web site, and
Scriptler from the Jenkins project Maven repository, and then manually
install the plugins into Jenkins.

In short, I don't recommend doing this on an exposed Jenkins
installation with lax security. Our Jenkins is behind a MFA VPN and the
administrative access is constrained to a few people.

Also, please note that these Groovy scripts were hacked together:

1. First exposure to Groovy
2. First exposure to writing Groovy scripts for Jenkins

They run on Jenkins 1.x, and I don't know if they run on Jenkins 2.x
(they should).

One of these days I'll get around to cleaning them up, making them
modular and not so much of a hack.

. . . just my hackish 2 cents
/mde/



signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Mark Eggers
In reply to this post by Decker, Richard M
Folks,

Beware, the following is extremely ugly Groovy. I've changed the names
to protect the guilty (I think).

Also, the *_SVR and *_URL values are environment values stored centrally
in Jenkins. That way they can be changed easily. They also show up in
the job logs, which means with a little scripting effort I can get a
history of what versions were deployed to what server when.

Please review and laugh . . . or better yet, proffer improvements :-).

On 5/19/2017 10:10 AM, Decker, Richard M wrote:

> Mark,
>
>> -----Original Message-----
>> From: Mark Eggers [mailto:[hidden email]]
>> Sent: Friday, May 19, 2017 10:44 AM
>> To: Tomcat Users List <[hidden email]>
>> Subject: Re: Tomcat on macOS
>>
>> Chris,
>>
>> On 5/19/2017 7:33 AM, Christopher Schultz wrote:
>>> Israel,
>>>
>>> On 5/18/17 10:52 AM, Israel Timoteo wrote:
>>>> Any comments from the community for ...
>>>
>>>> 1) What tools is the community using for simultaneous applications
>>>> deployment on several servers, let’s say more than 20?
>>>
>>> I am using neither of these strategies, but...
>>>
>>> a. FarmWebDeployer [1]
>>
>> Doesn't this require a cluster (and therefore multicast)? That becomes
>> challenging in a cloud environment where there's no multicast easily
>> available.
>>
>>> b. Auto-deploy + scp
>>
>> This would be nice with a little scripting.
>>
>>>
>>> Why in the world are you deploying a web application to 20+
>>> macos-based servers? Or do you have a Macos client and 20+
>>> non-macos-based servers?
>>>
>>>> 4) Is JAVA_OPTS required?
>>>
>>> JAVA_OPTS is only required if you require any java opts. Do you
>>> require such options? Usually, when people set JAVA_OPTS they really
>>> want to set CATALINA_OPTS instead.
>>>
>>> Hope that helps,
>>> -chris
>>>
>>> [1]
>>> http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
>>
>> What I do is use Jenkins, Maven, Nexus, and a little Groovy scripting.
>>
>> 1. Maven with the Tomcat Maven Plugin [1]
>>
>> The WAR file is customized (context.xml) based on the target environment.
>>
>> 2. Jenkins
>>
>> The build is run by Jenkins, and the build number (with a little 0 padding via a
>> Groovy script) is tacked onto the WAR name as app##0000nn.war.
>
> I don't mean to hijack the thread, but could you expand on this? Could you please provide examples of your Groovy scripts?
>
>>
>> This allows the parallel deploy feature to be used [2].
>>
>> 3. Nexus
>>
>> This is where all of the base artifacts are stored. Nexus 2 is used currently
>> since Nexus 3 doesn't have the REST API needed to cleanly interact with the
>> Jenkins job via a Groovy script. Maybe I should learn how to write a Nexus
>> plugin to get lists of artifact versions via REST . . .
>>
>> 4. Groovy scripting
>>
>> Groovy is used in Jenkins to do the following:
>>
>> a. Query Nexus to get a list of artifact versions b. Prevent non-production
>> artifacts from landing on production platforms c. Create the final number for
>> parallel deployment
>>
>> To expand this to multiple machines, a set of pipeline jobs could be created.
>>
>> a. Build the customized WAR for the target environment b. Multiple jobs
>> deploy to the servers in the target environment c. Multiple jobs validate the
>> deployment d. Final job sends mail to interested parties with success / failure
>>
>> I know that's a lot of infrastructure. There are certainly things that could be
>> done differently. Ant (with Ivy), or gradle could be used for the builds. A
>> different repository manager could be used (other than Nexus). A different
>> CI / CD system could be used (other than Jenkins).
>>
>> Anything that meets at least the following requirements could be strung
>> together.
>>
>> a. Reliable place to get the WAR file you need to deploy b. Reliable build
>> system that can be automated c. Build system that can deploy to Tomcat d.
>> Testing that the deployment actually worked e. Notification
>>
>> The end result is that some authorized person can log into Jenkins, select a
>> version of an application to deploy, deploy it to the target environment,
>> know that it's been successful (or not), and have notifications automatically
>> sent out.
>>
>> [1] http://tomcat.apache.org/maven-plugin.html
>> [2]
>> https://tomcat.apache.org/tomcat-8.0-
>> doc/config/context.html#Parallel_deployment
>>
>> . . . just my (rather lengthy) 2 cents
>> /mde/
// talks to Nexus 2 servers - NOT Nexus 3
// Gets list of versions for a particular groupId and artifactId
// review and use at your own risk
  def prod =
"http://my.nexus.server.com/nexus/service/local/repositories/releases/content"
  def snap =
"http://my.nexus.server.com/nexus/service/local/repositories/snapshots/content"

  def groupId = ARTIFACT_GROUP
  def artifactId = ARTIFACT_ID
  def target = ARTIFACT_TARGET

  def versions = []

  def locationp = prod + "/" + groupId.replaceAll("\\.","/") + "/" +
artifactId
  def locations = snap + "/" + groupId.replaceAll("\\.","/") + "/" +
artifactId

  // get all available SNAPSHOT versions
  try {
   def scontent = new XmlParser().parseText(new URL(locations).getText());
   for (contentNode in scontent.data.'content-item') {
     if (contentNode.leaf.text() != "true") {
       versions.add(contentNode.text.text())
     }
   }
  } catch (FileNotFoundException e) {
  }

  // get all available released versions
  try {
   def pcontent = new XmlParser().parseText(new URL(locationp).getText());
   for (contentNode in pcontent.data.'content-item') {
     if (contentNode.leaf.text() != "true") {
       versions.add(contentNode.text.text())
     }
   }
  } catch (FileNotFoundException e) {
  }

  // no artifacts in Nexus repository
  if ( versions.isEmpty() ) {
   versions.add("NO-VERSION")
   return versions
  }

  switch (target) {
   // production servers cannot host SNAPSHOT releases
   case ["PROD","PROD02","PROD01","PROD03","PROD04","PROD05"]:
     def pversions = []
       for (version in versions) {
         if (!version.endsWith("SNAPSHOT")) {
           pversions.add(version)
         }
       }
       versions = pversions
       // no releases in Nexus repository
       if (versions.isEmpty()) {
         versions.add("NO-VERSION")
       }
   break
   default:
   break
  }

  sversions = versions.sort().reverse()
  return sversions

// takes artifact versions and creates appropriate Maven parameters
// popcorn needed - scotch recommended - review and use at your own risk
def tname = ''
def url = ''
def svr = ''
def bn = ''
def host = ''
def vurl = ''
def ddate = new Date()

// target server
if (binding.variables.containsKey('ARTIFACT_TARGET')) {
    tname = binding.variables.get('ARTIFACT_TARGET')
    switch (tname) {
    // production - prod01.server.com
    case "PROD01":
    if (binding.variables.containsKey('PROD01_URL')) {
    url = binding.variables.get('PROD01_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl ="https://prod01.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('PROD01_SVR')) {
    svr = binding.variables.get('PROD01_SVR')
    }
    break
    // production - prod02.server.com
    case "PROD02":
    if (binding.variables.containsKey('PROD02_URL')) {
    url = binding.variables.get('PROD02_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = "http://prod02.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('PROD02_SVR')) {
    svr = binding.variables.get('PROD02_SVR')
    }
    break
    // production - PROD03.server.com
    case "PROD03":
    if (binding.variables.containsKey('PROD03_URL')) {
    url = binding.variables.get('PROD03_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = "http://prod03.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('PROD03_SVR')) {
    svr = binding.variables.get('PROD03_SVR')
    }
    break
    // production - prod04.server.com
    case "PROD04":
    if (binding.variables.containsKey('PROD04_URL')) {
    url = binding.variables.get('PROD04_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = "prod04.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('PROD04_SVR')) {
    svr = binding.variables.get('PROD04_SVR')
    }
    break
    // production - prod05.server.com
    case "PROD05":
    if (binding.variables.containsKey('PROD05_URL')) {
    url = binding.variables.get('PROD05_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = "http://prod05.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('PROD05_SVR')) {
    svr = binding.variables.get('PROD05_SVR')
    }
    break
    // user acceptance test - uattest.server.com
    case "UATTEST":
    if (binding.variables.containsKey('UATTEST_URL')) {
    url = binding.variables.get('UATTEST_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = "http://uattest.server.com" + '/' +
binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('UATTEST_SVR')) {
    svr = binding.variables.get('UATTEST_SVR')
    }
    break
    // internal test - itest.server.com
    case "ITEST":
    if (binding.variables.containsKey('ITEST_URL')) {
    url = binding.variables.get('ITEST_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = host + '/' + binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('ITEST_SVR')) {
    svr = binding.variables.get('ITEST_SVR')
    }
    break
    // default is to deploy to internal test
    default:
    if (binding.variables.containsKey('ITEST_URL')) {
    url = binding.variables.get('ITEST_URL')
    host = url - ~/:\d{4}\/manager\/text/
    vurl = host + '/' + binding.variables.get('ARTIFACT_ID')
    }
    if (binding.variables.containsKey('ITEST_SVR')) {
    svr = binding.variables.get('ITEST_SVR')
    }
    break
    }
}

// build number with proper zero padding
if (binding.variables.containsKey('BUILD_NUMBER')) {
    bns = binding.variables.get('BUILD_NUMBER')
    bni = bns.toInteger()
    if (bni < 10) {
        bn = '0000' + bni.toString()
    } else if (bni < 100) {
        bn = '000' + bni.toString()
    } else if (bni < 1000) {
        bn = '00' + bni.toString()
    } else if (bni < 10000) {
        bn = '0' + bni.toString()
    } else {
        bn = bn.toString()
    }
} else {
    bn = '00001'
}

return [ TARGET_URL:url, TARGET_SERVER:svr, BN:bn, ARTIFACT_URL:vurl,
DEPLOY_DATE:ddate ]

The second script creates appropriate environment variables for the
following Maven command:

mvn -U clean package tomcat7:deploy -Dbuild.number=${BN}
-Dversion.number=${ARTIFACT_VERSION} -Ddeploy.url=${TARGET_URL}
-Ddeploy.server=${TARGET_SERVER}

The DEPLOY_DATE is used in the email notification, as is the BUILD_USER
Jenkins variable. That way, everyone knows who did bad things to a
server when.

Sorry for the line wrap.

. . . just my (ugly scripting) two cents
/mde/


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Israel Timoteo
All,

Thanks for your replies, very good information.


Christopher,

Let me share additional information about my environment:

1) All my servers, production and non-production, are hosted at two data centers (different locations) with a third-party company (A)
-Server specs: Mac mini, 16 GB memory and 1 TB HD

2)There is one Tomcat instance per server and all Tomcats are in a cluster, having HTTPD in front
-on HTTPD, mod_jk is used
-one cluster per each location, multicast is used - I do recall a presentation where not using multicast was mentioned - I need to check my notes

3) The application is developed by a third-party company (B) and uploaded to one of my non-production servers

4) When an application needs to be deployed, I connect (ssh) to the target server(s) and from there, I use scp to get the war file from the non-production server and place the war file into a particular directory; then, I have a script that moves the war file to $CATALINA_BASE and do some additional validations
-Autodeploy and Parallel deployment are used
-I explored the FarmWebDeployer option years ago but had the war file removed from the cluster when the master node was down… maybe I had a wrong configuration then.. so I will need to check this option again and experiment

5) As per the JAVA_OPTS…
-I use it for “-server -Dfile.encoding=UTF-8”
-It seems that I can add “-server -Dfile.encoding=UTF-8” to CATALINA_OPTS; I will change and test it.



I have an additional question:

1) Would there be any recommendations for not having one Tomcat instance per physical server?

____________
Israel Timoteo

> On May 19, 2017, at 2:06 PM, Mark Eggers <[hidden email]> wrote:
>
> Folks,
>
> Beware, the following is extremely ugly Groovy. I've changed the names
> to protect the guilty (I think).
>
> Also, the *_SVR and *_URL values are environment values stored centrally
> in Jenkins. That way they can be changed easily. They also show up in
> the job logs, which means with a little scripting effort I can get a
> history of what versions were deployed to what server when.
>
> Please review and laugh . . . or better yet, proffer improvements :-).
>
> On 5/19/2017 10:10 AM, Decker, Richard M wrote:
>> Mark,
>>
>>> -----Original Message-----
>>> From: Mark Eggers [mailto:[hidden email]]
>>> Sent: Friday, May 19, 2017 10:44 AM
>>> To: Tomcat Users List <[hidden email]>
>>> Subject: Re: Tomcat on macOS
>>>
>>> Chris,
>>>
>>> On 5/19/2017 7:33 AM, Christopher Schultz wrote:
>>>> Israel,
>>>>
>>>> On 5/18/17 10:52 AM, Israel Timoteo wrote:
>>>>> Any comments from the community for ...
>>>>
>>>>> 1) What tools is the community using for simultaneous applications
>>>>> deployment on several servers, let’s say more than 20?
>>>>
>>>> I am using neither of these strategies, but...
>>>>
>>>> a. FarmWebDeployer [1]
>>>
>>> Doesn't this require a cluster (and therefore multicast)? That becomes
>>> challenging in a cloud environment where there's no multicast easily
>>> available.
>>>
>>>> b. Auto-deploy + scp
>>>
>>> This would be nice with a little scripting.
>>>
>>>>
>>>> Why in the world are you deploying a web application to 20+
>>>> macos-based servers? Or do you have a Macos client and 20+
>>>> non-macos-based servers?
>>>>
>>>>> 4) Is JAVA_OPTS required?
>>>>
>>>> JAVA_OPTS is only required if you require any java opts. Do you
>>>> require such options? Usually, when people set JAVA_OPTS they really
>>>> want to set CATALINA_OPTS instead.
>>>>
>>>> Hope that helps,
>>>> -chris
>>>>
>>>> [1]
>>>> http://tomcat.apache.org/tomcat-8.0-doc/config/cluster-deployer.html
>>>
>>> What I do is use Jenkins, Maven, Nexus, and a little Groovy scripting.
>>>
>>> 1. Maven with the Tomcat Maven Plugin [1]
>>>
>>> The WAR file is customized (context.xml) based on the target environment.
>>>
>>> 2. Jenkins
>>>
>>> The build is run by Jenkins, and the build number (with a little 0 padding via a
>>> Groovy script) is tacked onto the WAR name as app##0000nn.war.
>>
>> I don't mean to hijack the thread, but could you expand on this? Could you please provide examples of your Groovy scripts?
>>
>>>
>>> This allows the parallel deploy feature to be used [2].
>>>
>>> 3. Nexus
>>>
>>> This is where all of the base artifacts are stored. Nexus 2 is used currently
>>> since Nexus 3 doesn't have the REST API needed to cleanly interact with the
>>> Jenkins job via a Groovy script. Maybe I should learn how to write a Nexus
>>> plugin to get lists of artifact versions via REST . . .
>>>
>>> 4. Groovy scripting
>>>
>>> Groovy is used in Jenkins to do the following:
>>>
>>> a. Query Nexus to get a list of artifact versions b. Prevent non-production
>>> artifacts from landing on production platforms c. Create the final number for
>>> parallel deployment
>>>
>>> To expand this to multiple machines, a set of pipeline jobs could be created.
>>>
>>> a. Build the customized WAR for the target environment b. Multiple jobs
>>> deploy to the servers in the target environment c. Multiple jobs validate the
>>> deployment d. Final job sends mail to interested parties with success / failure
>>>
>>> I know that's a lot of infrastructure. There are certainly things that could be
>>> done differently. Ant (with Ivy), or gradle could be used for the builds. A
>>> different repository manager could be used (other than Nexus). A different
>>> CI / CD system could be used (other than Jenkins).
>>>
>>> Anything that meets at least the following requirements could be strung
>>> together.
>>>
>>> a. Reliable place to get the WAR file you need to deploy b. Reliable build
>>> system that can be automated c. Build system that can deploy to Tomcat d.
>>> Testing that the deployment actually worked e. Notification
>>>
>>> The end result is that some authorized person can log into Jenkins, select a
>>> version of an application to deploy, deploy it to the target environment,
>>> know that it's been successful (or not), and have notifications automatically
>>> sent out.
>>>
>>> [1] http://tomcat.apache.org/maven-plugin.html
>>> [2]
>>> https://tomcat.apache.org/tomcat-8.0-
>>> doc/config/context.html#Parallel_deployment
>>>
>>> . . . just my (rather lengthy) 2 cents
>>> /mde/
>
> // talks to Nexus 2 servers - NOT Nexus 3
> // Gets list of versions for a particular groupId and artifactId
> // review and use at your own risk
>  def prod =
> "http://my.nexus.server.com/nexus/service/local/repositories/releases/content"
>  def snap =
> "http://my.nexus.server.com/nexus/service/local/repositories/snapshots/content"
>
>  def groupId = ARTIFACT_GROUP
>  def artifactId = ARTIFACT_ID
>  def target = ARTIFACT_TARGET
>
>  def versions = []
>
>  def locationp = prod + "/" + groupId.replaceAll("\\.","/") + "/" +
> artifactId
>  def locations = snap + "/" + groupId.replaceAll("\\.","/") + "/" +
> artifactId
>
>  // get all available SNAPSHOT versions
>  try {
>    def scontent = new XmlParser().parseText(new URL(locations).getText());
>    for (contentNode in scontent.data.'content-item') {
>      if (contentNode.leaf.text() != "true") {
>        versions.add(contentNode.text.text())
>      }
>    }
>  } catch (FileNotFoundException e) {
>  }
>
>  // get all available released versions
>  try {
>    def pcontent = new XmlParser().parseText(new URL(locationp).getText());
>    for (contentNode in pcontent.data.'content-item') {
>      if (contentNode.leaf.text() != "true") {
>        versions.add(contentNode.text.text())
>      }
>    }
>  } catch (FileNotFoundException e) {
>  }
>
>  // no artifacts in Nexus repository
>  if ( versions.isEmpty() ) {
>    versions.add("NO-VERSION")
>    return versions
>  }
>
>  switch (target) {
>    // production servers cannot host SNAPSHOT releases
>    case ["PROD","PROD02","PROD01","PROD03","PROD04","PROD05"]:
>      def pversions = []
>        for (version in versions) {
>          if (!version.endsWith("SNAPSHOT")) {
>            pversions.add(version)
>          }
>        }
>        versions = pversions
>        // no releases in Nexus repository
>        if (versions.isEmpty()) {
>          versions.add("NO-VERSION")
>        }
>    break
>    default:
>    break
>  }
>
>  sversions = versions.sort().reverse()
>  return sversions
>
> // takes artifact versions and creates appropriate Maven parameters
> // popcorn needed - scotch recommended - review and use at your own risk
> def tname = ''
> def url = ''
> def svr = ''
> def bn = ''
> def host = ''
> def vurl = ''
> def ddate = new Date()
>
> // target server
> if (binding.variables.containsKey('ARTIFACT_TARGET')) {
>    tname = binding.variables.get('ARTIFACT_TARGET')
>    switch (tname) {
>     // production - prod01.server.com
>     case "PROD01":
>     if (binding.variables.containsKey('PROD01_URL')) {
>     url = binding.variables.get('PROD01_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl ="https://prod01.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('PROD01_SVR')) {
>     svr = binding.variables.get('PROD01_SVR')
>     }
>     break
>     // production - prod02.server.com
>     case "PROD02":
>     if (binding.variables.containsKey('PROD02_URL')) {
>     url = binding.variables.get('PROD02_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = "http://prod02.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('PROD02_SVR')) {
>     svr = binding.variables.get('PROD02_SVR')
>     }
>     break
>     // production - PROD03.server.com
>     case "PROD03":
>     if (binding.variables.containsKey('PROD03_URL')) {
>     url = binding.variables.get('PROD03_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = "http://prod03.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('PROD03_SVR')) {
>     svr = binding.variables.get('PROD03_SVR')
>     }
>     break
>     // production - prod04.server.com
>     case "PROD04":
>     if (binding.variables.containsKey('PROD04_URL')) {
>     url = binding.variables.get('PROD04_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = "prod04.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('PROD04_SVR')) {
>     svr = binding.variables.get('PROD04_SVR')
>     }
>     break
>     // production - prod05.server.com
>     case "PROD05":
>     if (binding.variables.containsKey('PROD05_URL')) {
>     url = binding.variables.get('PROD05_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = "http://prod05.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('PROD05_SVR')) {
>     svr = binding.variables.get('PROD05_SVR')
>     }
>     break
>     // user acceptance test - uattest.server.com
>     case "UATTEST":
>     if (binding.variables.containsKey('UATTEST_URL')) {
>     url = binding.variables.get('UATTEST_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = "http://uattest.server.com" + '/' +
> binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('UATTEST_SVR')) {
>     svr = binding.variables.get('UATTEST_SVR')
>     }
>     break
>     // internal test - itest.server.com
>     case "ITEST":
>     if (binding.variables.containsKey('ITEST_URL')) {
>     url = binding.variables.get('ITEST_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = host + '/' + binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('ITEST_SVR')) {
>     svr = binding.variables.get('ITEST_SVR')
>     }
>     break
>     // default is to deploy to internal test
>     default:
>     if (binding.variables.containsKey('ITEST_URL')) {
>     url = binding.variables.get('ITEST_URL')
>     host = url - ~/:\d{4}\/manager\/text/
>     vurl = host + '/' + binding.variables.get('ARTIFACT_ID')
>     }
>     if (binding.variables.containsKey('ITEST_SVR')) {
>     svr = binding.variables.get('ITEST_SVR')
>     }
>     break
>    }
> }
>
> // build number with proper zero padding
> if (binding.variables.containsKey('BUILD_NUMBER')) {
>    bns = binding.variables.get('BUILD_NUMBER')
>    bni = bns.toInteger()
>    if (bni < 10) {
>        bn = '0000' + bni.toString()
>    } else if (bni < 100) {
>        bn = '000' + bni.toString()
>    } else if (bni < 1000) {
>        bn = '00' + bni.toString()
>    } else if (bni < 10000) {
>        bn = '0' + bni.toString()
>    } else {
>        bn = bn.toString()
>    }
> } else {
>    bn = '00001'
> }
>
> return [ TARGET_URL:url, TARGET_SERVER:svr, BN:bn, ARTIFACT_URL:vurl,
> DEPLOY_DATE:ddate ]
>
> The second script creates appropriate environment variables for the
> following Maven command:
>
> mvn -U clean package tomcat7:deploy -Dbuild.number=${BN}
> -Dversion.number=${ARTIFACT_VERSION} -Ddeploy.url=${TARGET_URL}
> -Ddeploy.server=${TARGET_SERVER}
>
> The DEPLOY_DATE is used in the email notification, as is the BUILD_USER
> Jenkins variable. That way, everyone knows who did bad things to a
> server when.
>
> Sorry for the line wrap.
>
> . . . just my (ugly scripting) two cents
> /mde/
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Leon Rosenberg-4
On Sat, May 20, 2017 at 8:56 AM, Israel Timoteo <[hidden email]> wrote:

>
>
> I have an additional question:
>
> 1) Would there be any recommendations for not having one Tomcat instance
> per physical server?
>

Only if your application can't utilise resources properly. If your
application fails to scale, fails to use all available cores or memory, you
should have multiple instances. Also if your total memory is insanely high,
like way above 64 Gb, you'd be better off with multiple instances. Also if
your app uses a lot of synchronisation, having multiple tomcats can help.
However, all of that is pretty improbable with a mac mini.
Rule of thumb: if you can bring your app with tomcat to near 100% CPU or
memory usage, no need for multiple instances.
HTH
Leon

P.S. kudos to you for hosting on macs ;-) Crazy but fun ;-)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat on macOS

Christopher Schultz-2
In reply to this post by Israel Timoteo
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Israel,

On 5/20/17 8:56 AM, Israel Timoteo wrote:
> 2)There is one Tomcat instance per server and all Tomcats are in a
> cluster, having HTTPD in front'> -on HTTPD, mod_jk is used> -one
> cluster per each location, multicast
is used - I do recall a
> presentation where not using multicast was mentioned - I need to
> check my notes
Unicast is possible, but much less flexible.

> 3) The application is developed by a third-party company (B) and
> uploaded to one of my non-production servers
>
> 4) When an application needs to be deployed, I connect (ssh) to
> the target server(s) and from there, I use scp to get the war file
> from the non-production server and place the war file into a
> particular directory; then, I have a script that moves the war file
> to $CATALINA_BASE and do some additional validations

You ought to be able to scp to the right place from outside the box.
If you can do that, just scp from the deployment server (just pick
one) to each of the others. Be sure to check to see which servers
successfully deployed the application. If any of the servers fail to
deploy the new version, "downgrade" the servers that succeeded by
"upgrading" them to the old version (which, presumably, will
successfully deploy the old version).

> -Autodeploy and Parallel deployment are used> -I explored the
> FarmWebDeployer option years ago but had the war file removed from
> the cluster when the master node was down… maybe I had a wrong
> configuration then.. so I will need to check this option again and
> experiment

For my money, if you've got a cluster I'd try to use the FarmWebDeployer
.

We had some conversations about the FarmWebDeployer this week at
TomcatCon. This component has always had an air of untrustworthyness
to it, and not many people have tried it for one reason or another.

Honestly, I'd like to have MORE people use it because then it could
get some real-world usage, and some real-world feedback. If it does
indeed work and is robust, then that's great. Otherwise, we (Tomcat)
should either fix the bugs and make it useful or kill it off so nobody
relies upon it.

So if you are willing to plough-through it, please do so and we'll try
to provide the best support we can.

> 5) As per the JAVA_OPTS… -I use it for “-server
> -Dfile.encoding=UTF-8” -It seems that I can add “-server
> -Dfile.encoding=UTF-8” to
CATALINA_OPTS; I will change and test it.
Macos is 64-bit and you almost certainly have a 64-bit JVM. 64-bit
JVMs are *always* running in "server mode" so that's probably not
necessary.

There are other environment variables you can use to set the file
encoding, but an explicit system property is probably the best way to
do it.

In your case, CATALINA_OPTS or JAVA_OPTS would be fine.

Most people use system properties for setting the size of their heaps.
They set JAVA_OPTS to "-Xmx16G" and never realize that this means that
"catalina.sh stop" will launch a JVM with a 16 GiB heap just to send
the "shutdown" command to Tomcat.

> I have an additional question:
>
> 1) Would there be any recommendations for not having one Tomcat
> instance per physical server?

I typically run 4 separate applications, and I run them in completely
separate JVMs on the same server. I do this mostly to make deployments
easier and more flexible... I can test/deploy each application
separately and upgrade either them, their supporting Tomcats, or their
supporting JVMs separately from the rest.

Leon is correct that, given a set of reliable web applications, you
should be able to run them all in one large JVM. Theoretically,
running a single JVM will give you the best resource utilization since
you don't pay a penalty for separate memory spaces for the same kinds
of things (i.e. the JVM doesn't have to take up 2x memory because of
the two processes running). In reality, (a) applications have bugs,
(b) JVMs have bugs, (c) threads sometimes have stack-overflows, and
(d) JVMs use shared memory to avoid huge amounts of memory for each
independent JVM.

I find that I get more flexibility from a multi-JVM deployment even
though my applications seem to be very well-behaved and I generally
deploy everything on the same Tomcat version and JVM version.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkgz7MACgkQHPApP6U8
pFilCA//c5KIC9nOyZ9cc3PU4RmM12HtmXeH+QSd+cDvao5MWtLWOMXoJw98FhMb
pVZ5ZTCywn6siusujnG+OHQbL866ubJTmk6A76ey4XErSPHUDtNZrmPFphwFM7pD
tbTrQTXG0MyGLLFApKyaHlDUdKARqg2qu2gtxTrtPVvtfADJpLdF6yl9dYf5qFuO
b01tCSGfn+jvy39wsYhKw+yItcRjhoDY8dEGfgVGSysuNTmlhGtp1W9Gu8y4v/K2
BEPrMMfFcEZxUvEw60lGfmeuMAgkftgLnw/CwZ/7YJrfikgIgR++psvq0KXcGefd
AzEQDoQASX7GEqZd2T4hlIIIXIbRlJBZIEoxnAxVXVc6p0S9zP+GSesZxW5A7OwC
CogexBG87N/DjQs4S5QCkzfC06kBauZKLvsKZ/3zQnaOwkMyjk1xD7Pkx8LtXBuY
MjqpFehg8kowu0Fhln0LYUcK1M2hqkarYcfgFrazQZd9jpm2IGZnY0ZgcKpuCgFw
Zgbz5PqsOY35ztNd2AKAJW80N/nSz06a39MO5NpBgmhxcYCrsOCEps/m+Jd2GfM5
r1K2PYq4aOw41IFj/QFHuzcJ7gb15pFTnJJFVVgtE4U1QNTsUu+oaldp4dSaY3ON
/4CM55L5QhQY3GIo16PNxl7XU3mVLo/eWQBPMhaqwpNnx2Eik4Y=
=MQmq
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...