DevOps Classroom Series – 12/Nov/2021

Tomcat Installation contd..

  • As link resource was giving some issue for now we have replaced with execute resource and made the changes Refer Here for the changes done Refer Here for the execute resource documentation.
  • Now we need to create a file for tomcat service at ‘/etc/systemd/system/tomcat.service’ with the following content
[Unit]
Description=Tomcat 9 servlet container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"

Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh

[Install]
WantedBy=multi-user.target
  • In chef we have files which can be used to copy static files into nodes Preview
  • Generate a file. A new folder called as files will be created in your cookbook with a file tomcat.service Preview
  • In chef we have a resource cookbook_file which is used to copy the cookbook file to a specific location on the node Refer Here
  • Refer Here for the steps till tomcat service is started.
  • Exercise-1: Try to make the cookbook work for centos 7 as well.
  • Exercies-2: Write a chef cookbook to install nop commerce on ubuntu 20.04 (leave the database part) Refer Here

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin