Sunday 5 May 2013

Starting Pentaho BI Server At Boot Time On Linux (ubuntu 12.04)

You Can Start pentaho Bi - Server manually :-

Using the scripted commands start-pentaho.sh
and stop-pentaho.sh which are located in /biserver-ce directory by default.

To have the BI Server start automatically during boot time, we need to modify these two scripts and create a startup script called pentaho.

i have tested on ubuntu 12.04 LTS

Get following start up script in
your pentaho installation directory .. /biserver-ce
and that administrative-console is installed at
.. /administration-console.

  Note :-  JAVA_HOME and JRE_HOME properlly

  or you can set it manually in start-pentaho.sh and stop-pentaho.sh


Now Start Creating the Start up script

Come to
.. /etc/init.d
create a file called pentaho in /etc/init.d by typing the following:

-------------
sudo nano /etc/init.d/pentaho
--------------
 
 
 We add the following text to the file (pentaho):

===================================================
 ============

#export JRE_HOME="/usr/lib/jvm/java-1.5.0-sun/jre"
start(){
if [ "$1" == "adm" ];then
        echo "Iniciando aplicacao administration-console"
      #  cd ../administration-console
cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/administration-console      
 ./start-pac.sh& > /tmp/pentaho_console.out 2>&1 &

else
        echo "Iniciando aplicacao biserver"
cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/biserver-ce
        ./start-pentaho.sh& > /tmp/pentaho.out 2>&1


cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/administration-console
 ./start-pac.sh& > /tmp/pentaho_console.out 2>&1 &

fi

echo "ok"

}

stop(){
echo "recebi: $1"

if [ "$1" == "adm" ];then
        echo "Finalizando aplicacao administration-console"
       # cd ../administration-console
cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/administration-console
        ./stop-pac.sh&
else

        echo "Finalizando aplicacao biserver"
 cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/biserver-ce
        ./stop-pentaho.sh&

cd /home/spectrum/Desktop/spectrum/pentaho/biserver-ce-4.8.0-stable/administration-console
        ./stop-pac.sh&
fi

echo "ok"
}


case "$1" in
start)
        start $2
        ;;
stop)
        stop $2
        ;;
*)
        printf "\nUsage: $0 \n
                start | stop            : Inicia ou finaliza a aplicacao biserver\n
                start adm | stop adm    : Inicia ou finaliza o administration console\n\n"
        ;;
esac
echo "Pentaho Started ......................>OK"

exit 0
 
=======================
========================================================================================= 
 
Please note:

If you would like the scripts to run as a background task when the server starts up instead of launching in a terminal window, append an "&" to the end of the script name.  So, in the above code:
---------------------------------------
 cd /biserver-ce
/biserver-ce/start-pentaho.sh&
cd /administration-console
/administration-console/start.sh&

---------------------------------------------

Now we need to make pentaho executable and add it to the startup and shutdown runlevels.

To make our new script executable by the system we run the following command
sudo chmod +x /etc/init.d/pentaho

Finally, we add the pentaho script to the system startup and shutdown runlevels by issuing the following command.

sudo update-rc.d pentaho defaults

The Pentaho BI Server, Sample Database (Hypersonic), and administration console will now start at boot time and shut down when the system restarts or stops.
 -

=====
On some systems, you will use chkconfig instead of update-rc.d
-------
chkconfig pentaho on
---------
 

 

No comments:

Post a Comment