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 )




8 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
  5. You must be a kind people because you share your knowledge through articles. I like to read them. They are really good for everyone. Can you upload more articles? I believe that many people like me wait for your next posts.

    jogos io gratis
    play friv
    a10 free

    ReplyDelete
  6. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. auto repair Manalapan NJ

    ReplyDelete
  7. This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. auto hail repair denver

    ReplyDelete