Managing Multiple Tomcat Instances Without Containerization

Slide Note
Embed
Share

Explore strategies to manage multiple Tomcat instances effectively without transitioning to containerization, discussing deployment methods, script samples, and practical tips for optimizing Tomcat setup in a non-containerized environment.


Uploaded on Sep 26, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Tomcat Without Containers managing multiple instances without taking the leap to containerization EARL BORAH, CHEMEKETA COMMUNITY COLLEGE TUE 10/13, 1:30PM (CENTRAL) SESSION ID 2.4

  2. Introduction Containers are the future but what if you re stuck in the past? How to survive flourish now without wasted effort 2 COHESION SUMMIT

  3. Agenda 1 Yes, Containers ARE the Future 2 How We Deploy Tomcat Today 3 Sample Scripts 4 Your Questions and Tips 3 COHESION SUMMIT

  4. Containers are the Future WHY THIS ISN T THE ANTI-CONTAINER SESSION

  5. Containers are the Future Infrastructure as code? DEPLOYMENT as code! More applications, more deployments, more benefit from automation Cloud environments provide simple container infrastructure Cloud environments provide cheap container infrastructure BUT What if you don t have time to learn to use containers? 5 COHESION SUMMIT

  6. Quote for Inspiration That which does not kill us makes us stronger. - Nietzche [Dead Guy] 6 COHESION SUMMIT

  7. How We Deploy Tomcat Today READ THE TEXT FILE

  8. How We Deploy Tomcat Today One application deployment per Tomcat instance Multiple Tomcat instances (even Tomcat versions) per VM Deployments to multiple VMs (redundancy) As repeatable and modular as we can practically make it No SSL on server learn to love the load balancer 8 COHESION SUMMIT

  9. How We Deploy Tomcat Today CATALINA_HOME vs CATALINA_BASE read RUNNING.txt CATALINA_HOME is for Tomcat don t touch most things here! CATALINA_HOME=/u01/app/apache-tomcat-8.5.XX $CATALINA_HOME/bin make .sh scripts executable $CATALINA_HOME/webapps delete or rename so webapps is empty CATALINA_BASE is for application instances CATALINA_BASE=/u01/app/tomcat/instanceName $CATALINA_BASE/bin is empty except for setenv.sh $CATALINA_BASE/conf is where you maintain server.xml, other config files $CATALINA_BASE/lib is where you place application-specific libraries $CATALINA_BASE/webapps is where you deploy to $CATALINA_BASE/logs, $CATALINA_BASE/temp, $CATALINA_BASE/work 9 COHESION SUMMIT

  10. How We Deploy Tomcat Today All instances [can] share the common CATALINA_HOME unzip once, use everywhere! Customizations in CATALINA_BASE unaffected by Tomcat upgrades Switching Tomcat versions (upgrade, rollback) is trivial Compare difference between baseline files (server.xml) and customized versions on-site, easily 10 COHESION SUMMIT

  11. How We Deploy Tomcat Today Performing Tomcat and Java Upgrades Java Upgrade: yum update Tomcat Upgrade: https://tomcat.apache.org Repeat Tomcat deployment steps (CATALINA_HOME section, prior slide) setenv.sh control version for each instance separately 11 COHESION SUMMIT

  12. How We Deploy Tomcat Today Port assignment is important Establishing a pattern can help with security (range of ports) and sanity We use 5-digit port numbers First digit: Environment (prod, test, development) Second digit: Purpose (shutdown, http listener, ajp listener, RMI monitoring) Third digit: Family (on-premise, SSB9, SSB8, third-party) Fourth digit: Application (AppNav, General SS9, SSB 8) Fifth digit: Instance (first instance, second instance) Not every application uses all possible ports (http OR ajp) 12 COHESION SUMMIT

  13. Sample Scripts THE WRAPPERS THAT HELP MAKE IT WORK

  14. setenv.sh (abbreviated sample) CATALINA_HOME=/u01/app/apache-tomcat-8.5.50 CATALINA_OPTS="-server -Xms2048m -Xmx4g - XX:MaxMetaspaceSize=512m" CATALINA_OPTS="${CATALINA_OPTS} - Doracle.jdbc.autoCommitSpecCompliant=false" JAVA_HOME=/usr/java/latest JAVA_OPTS="-DlogFileDir=$CATALINA_BASE/logs - Dhttps.protocols=TLSv1.1,TLSv1.2 JAVA_OPTS="${JAVA_OPTS} - Dbanner.logging.dir=$CATALINA_BASE/logs" export CATALINA_HOME CATALINA_OPTS JAVA_HOME JAVA_OPTS 14 COHESION SUMMIT

  15. /u01/app/tomcat/start.sh #!/bin/sh export CATALINA_BASE=/u01/app/tomcat/$1 source $CATALINA_BASE/bin/setenv.sh $CATALINA_HOME/bin/startup.sh 15 COHESION SUMMIT

  16. /u01/app/tomcat/stop.sh #!/bin/sh export CATALINA_BASE=/u01/app/tomcat/$1 source $CATALINA_BASE/bin/setenv.sh $CATALINA_HOME/bin/shutdown.sh 16 COHESION SUMMIT

  17. /u01/app/tomcat/clean.sh #!/bin/sh rm -rf /u01/app/tomcat/$1/work/* rm -rf /u01/app/tomcat/$1/temp/* 17 COHESION SUMMIT

  18. server.xml (abbreviated sample) <Connector port="22010" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8444" proxyName="banner-test.chemeketa.edu" proxyPort="443" scheme="https"/> 18 COHESION SUMMIT

  19. Summary Containers are the future Multiple instances per VM let you survive now with a modular solution that might help you move forward to containers 19 COHESION SUMMIT

  20. Questions? Tips of your own? 20 COHESION SUMMIT

  21. Thank You! Earl Borah earl.borah@chemeketa.edu SESSION ID 2.4 21 COHESION SUMMIT

Related


More Related Content