cancel
Showing results for 
Search instead for 
Did you mean: 

Script to Restart loader

Incortaconsulta
Cosmonaut

Hi All - Wondering, whether we can have an automated shell script to restart the loader box like every week which will help to clear my loader memory.

we have a small non-prod instance, and before every full load on my schemas, I need to restart the loader to make sure not to get an "out of memory" error. I need some solutions to overcome this manual activity.

4 REPLIES 4

bryanmedeiros
Employee
Employee

Hi @Incortaconsulta ,

You can run the following stop and start commands:

Location:  <Incorta_installation_path>/IncortaNode/

./stopService.sh loaderService

./startService.sh loaderService

Incortaconsulta
Cosmonaut

Hi Bryan - can it be automated with cronjob? usually, I do kill the currently running process id and then start the services.

 

Hi Ram,

You can use following stopstartLoader.sh , please test it first on your test cluster. If you have two nodes you will need to add it two other node also if you have Loader service on second node also.

 

> vi stopstartLoader.sh

#!/usr/bin/env bash
# **********************************************************************************************
# start/stop Loader Service Script through crontab
# - Change the location of your script below according to your location
#***********************************************************************************************

cd /u01/incorta/IncortaAnalytics/IncortaNode/
# pwd
./stopService.sh loaderService
# - sleep will sleep the execution of next startService.sh for 2 minutes ,if you # # - want remove # against it

# sleep 120
./startService.sh loaderService
exit;
# end of scirpt


vi stopstartLoader.sh
chmod 755 stopstartLoader.sh

You can test this script by

cd /u01/incorta/IncortaAnalytics/IncortaNode/
sh -x stopstartLoader.sh

crontab entry ( it will start it at 7:30 AM every Sunday)


30 7 * * sun /u01/incorta/IncortaAnalytics/IncortaNode/stopstartLoader.sh

This is basic shell script , you can add more features if you want.

 

JeffW
Employee
Employee

You may write a bash shell script to execute the commands necessary to stop and start the services.

Then you could create a cron job to schedule this script to be run at the frequency that you choose.

The commands would be something like:

<path to IncortaAnalytics>/IncortaNode/stopService.sh loaderService

<path to IncortaAnalytics>/IncortaNode/startService.sh loaderService

Note: you would want to pick a time to do this when there are not loader jobs running as a best practice.

If you are not sure of the service name you can run the command "cat <path to IncortaAnalytics>/IncortaNode/services/services.index" and read the name for loader in the output.  

You may want to implement a scripting technique to wait for a minute between commands.  Something like "sleep 60" between the 2 commands would pause the bash script for 1 minute before executing the second command.  You can easily find examples on the Internet.