Download - Automated Tomcat Management
![Page 2: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/2.jpg)
TOMCAT
![Page 3: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/3.jpg)
STRUCTUREbin control scripts lib common librarieswebapp instance contextlogs ...
![Page 4: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/4.jpg)
PROBLEM?
NOfor development(or simple cases)
![Page 5: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/5.jpg)
ADMIN'S PERSPECTIVEmultiple serversmultiple instances on a serverclustered environmentTomcat's lack of admin toolsnot willing to pay for tcServer
![Page 6: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/6.jpg)
TEMPLATE: common loggingcommon librariescommon resource naming (JNDI)
VS.
INSTANCE:custom WAR
because of different versionscustom logsspecific resources (e.g. in JNDI)various apps deployed on one server
![Page 7: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/7.jpg)
get the PID
ENDLESS KILLING /opt/tomcat/bin/shutdown.sh
thought it is killed :( ps aux | grep catal
once it is fine but... even in DEV it is boring
kill -9 <da_PID>
cd ../logsmv * /mnt/backup/logscd ../bin./startup.sh
![Page 8: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/8.jpg)
... AND WE FACED SUCH ISSUES
![Page 9: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/9.jpg)
TOMCAT CONTROL CENTER
![Page 11: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/11.jpg)
WHAT IS IT?
![Page 12: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/12.jpg)
CONCEPT
TEMPLATEand
(MULTIPLE) INSTANCE(S)controlled from
SINGLE POINT
![Page 13: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/13.jpg)
[SMALL] SET OF SCRIPTSstart
(start_secured)
stop_forcerestart_force
backup_logs_restart_force
statusexport_instance_info
control-instances
![Page 14: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/14.jpg)
CENTRAL RESOURCE CONTROLTomcatResources.py
automatically updates server.conf JNDI for each instanceusing central CSV files
setenvresource-db
resource-mailresource-envresource-rmi
...
![Page 15: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/15.jpg)
OH GOSH, CSV FILES?
Yeah!
... and yeah! again, I can manage it in Excel :p
![Page 16: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/16.jpg)
PROSlightweight and simpleseparate template and instancescentral management
CONSso far only on BASH-enabled systemsno Docker support yet :)(not actually a minus) no GUI
![Page 17: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/17.jpg)
![Page 18: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/18.jpg)
![Page 20: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/20.jpg)
INSTALLS TCC
PREPARES TEMPLATE(S)
PREPARES INSTANCE(S) ENV
(CAN) MONITOR WITH NEWRELIC
![Page 21: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/21.jpg)
... WISDOM ...
![Page 22: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/22.jpg)
![Page 23: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/23.jpg)
AUTOMATED TCCcd ~/chef
git submodule add https://github.com/seges/chef-cookbook-tcc.git site-cookbooks/tcc
git submodule add https://github.com/escapestudios-cookbooks/newrelic.git site-cookbooks/newrelic
![Page 24: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/24.jpg)
CREATE COOKBOOK OR RECIPE
knife cookbook create mycookie
![Page 25: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/25.jpg)
DEFINE DEFAULT ATTRIBUTES
default.tcc.user = "lgazo"default.tcc.home = "/home/lgazo"default.tcc.location = "/home/lgazo/opt/tcc"
![Page 26: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/26.jpg)
DEFINE TCC TOMCAT TEMPLATE WITHDEPENDENCIES
default['tcc']['templates'] = { "synapso" => { "type" => "tomcat7", "libs" => [ { "repo" => "maven", "artifact_id" => "org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1" }, { "repo" => "maven", "artifact_id" => "com.sun.messaging.mq:imq:4.4" }, { "repo" => "maven", "artifact_id" => "javax.mail:mail:1.4.4" }, { "repo" => "maven", "artifact_id" => "org.postgresql:postgresql:9.3-1100-jdbc41" } ] }}
![Page 27: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/27.jpg)
FINALLY DEFINE AN INSTANCEdefault['tcc']['instances'] = { "syndev" => { "template" => "synapso", "user" => "lgazo" }}
![Page 28: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/28.jpg)
AND TELL TCC COOKBOOK TO LOOK FORTEMPLATES IN OUR COOKBOOK
default['tcc']['template_cookbooks'] = "mycookie"
![Page 29: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/29.jpg)
PREPARE DATABASE IF NEEDEDinclude_recipe "database::postgresql"
postgresql_connection_info = { :host => 'localhost', :port => node['postgresql']['config']['port'], :username => 'postgres', :password => node['postgresql']['password']['postgres']}
postgresql_database_user "synapso" do connection postgresql_connection_info password node.postgresql.password.synapso action :createend
postgresql_database "synapso" do connection postgresql_connection_info owner "synapso" action :createend
postgresql_database "synapso user can create DB" do connection postgresql_connection_info sql "alter role #{node.synapso.user} with createdb" action :queryend
![Page 30: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/30.jpg)
in a server you can monitor it directly
INCLUDE TCCinclude_recipe "tcc::default"include_recipe "tcc::templates"include_recipe "tcc::instances"<font color="#333333" face="Lato, sans-serif"><span style=</span></font>
include_recipe "tcc::newrelic"
![Page 31: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/31.jpg)
AND NOW THE CONFIGURATION OFINSTANCES
into templates/default/tcc/templates/synapso/conf
default environment is named “_default”
context.xml (in current version it is not Chef environment specific)jmx.properties (in current version it is not Chef environment specific)resources-
c onnector.csvdb.csvenv.csvmail.csvrmi.csvsetenv.csv
![Page 32: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/32.jpg)
TCC MONITORING
JMXport and access configured in:
jmx.properties andsetenv.csv
NEWRELICinclude recipe tcc::newrelic
![Page 34: Automated Tomcat Management](https://reader035.vdocuments.us/reader035/viewer/2022081401/557d54b0d8b42aba3d8b459e/html5/thumbnails/34.jpg)
THANK YOU... FOR...
ATTENTION