Thursday, July 5, 2018

Auto start Tomcat and CloverETL on EC2 AWS Linux AMI

In one of the previous blog posts I installed evaluation CloverETL server on Amazon's EC2 instance. This installation is useful for evaluation, quick setup and I mentioned at the end of article that you might want to set CloverETL server to start up automatically if host gets restarted.

This article will show you one way how.

Prerequisites:

Last time we installed Tomcat and deployed server war to:

/clover/CloverETLServer.4.5.1.Tomcat-8.0.30/bin

(In retrospect keeping name of version in the directory name wasn't greatest idea, that's when you will try to upgrade, but again..evaluation installation.)

Steps:


First thing I will do is to create init script:
sudo vim /etc/init.d/clover

#!/bin/bash ### BEGIN INIT INFO # Provides:        tomcat8 # Required-Start:  $network # Required-Stop:   $network # Default-Start:   2 3 4 5 # Default-Stop:    0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {  sh /clover/CloverETLServer.4.5.1.Tomcat-8.0.30/bin/startup.sh }
stop() {  sh /clover/CloverETLServer.4.5.1.Tomcat-8.0.30/bin/shutdown.sh }
case $1 in   start|stop) $1;;   restart) stop; start;;   *) echo "Run as $0 <start|stop|restart>"; exit 1;; esac


There might be different versions of init script, this one makes sure that you will run in only after network interface is set up on the instance.

Last step is to put this init script to be run after reboot. Common way to do is with update-rc.d command, but that one is not installed on Amazon Linux AMI for some reason.

Another way that worked for me was:
sudo chmod 755 /etc/init.d/clover
sudo chkconfig --level 345 clover on

After these steps Tomcat and CloverETL server should automatically after reboot of the host.

(I used heavily answers here https://askubuntu.com/questions/223944/how-to-automatically-restart-tomcat7-on-system-reboots )




5 comments:

  1. On the off chance that you have issues with re-introducing your working framework with Linux, there are various approaches to correct it. Check this site

    ReplyDelete
  2. As i invested in onto your websites still placement of completely focus rigorously a little bit submits. Comforting strategy for foreseeable future, I will be bookmarking eachtime are given families down happens set.
    friv 4 online
    abcya xyz free
    friv 2017

    ReplyDelete
  3. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.
    friv2020 free game
    abcya online free
    friv2017 free game

    ReplyDelete
  4. You fill your growing container with soil and moisten lightly. I have used old fish totes. (I used to work in a gourmet market with a fish department I managed, so theses were a dime a dozen and have many uses). Sprinkle your soaked seeds evenly across the moist soil.
    free kizi Games
    online game for kids
    friv Games online 2019

    ReplyDelete