Managing Multiple Tomcat Instances Without Containerization
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.
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
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
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
Agenda 1 Yes, Containers ARE the Future 2 How We Deploy Tomcat Today 3 Sample Scripts 4 Your Questions and Tips 3 COHESION SUMMIT
Containers are the Future WHY THIS ISN T THE ANTI-CONTAINER SESSION
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
Quote for Inspiration That which does not kill us makes us stronger. - Nietzche [Dead Guy] 6 COHESION SUMMIT
How We Deploy Tomcat Today READ THE TEXT FILE
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
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
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
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
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
Sample Scripts THE WRAPPERS THAT HELP MAKE IT WORK
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
/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
/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
/u01/app/tomcat/clean.sh #!/bin/sh rm -rf /u01/app/tomcat/$1/work/* rm -rf /u01/app/tomcat/$1/temp/* 17 COHESION SUMMIT
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
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
Questions? Tips of your own? 20 COHESION SUMMIT
Thank You! Earl Borah earl.borah@chemeketa.edu SESSION ID 2.4 21 COHESION SUMMIT