atgendecaoracle-commerce

Correct startup sequence for Endeca components?


So I have created a startup bash script for my local endeca 11.1 environment which is running on Centos 6.6:

#!/bin/sh


ENDECA_USER=endeca
ENDECA_BASE=/usr/local/endeca
GREEN='\e[32m'
NC='\e[39m' 

source /usr/local/endeca/MDEX/6.5.1/mdex_setup_sh.ini
source /usr/local/endeca/PlatformServices/workspace/setup/installer_sh.ini


echo ER = $ENDECA_ROOT

usage() {
  echo "Usage: ${0} (start|stop)"
}

case "${1}" in
 start)
echo "Starting Endeca ..."
echo -ne "\n\n${GREEN}Starting MDEX Engine ... ${NC} \n\n"
${ENDECA_ROOT}/tools/server/bin/startup.sh
sleep 5
echo -ne "\n\n${GREEN}Starting Platform Services ... ${NC} \n\n"
${ENDECA_BASE}/PlatformServices/11.1.0/tools/server/bin/startup.sh
sleep 5
echo -ne "\n\n${GREEN}Starting Tools & Frameworks ... ${NC} \n\n"
${ENDECA_BASE}/ToolsAndFrameworks/11.1.0/server/bin/startup.sh
sleep 5
${ENDECA_BASE}/CAS/11.1.0/bin/cas-service.sh &
;;
stop)
echo "Shutting down Endeca ..."
${ENDECA_ROOT}/tools/server/bin/shutdown.sh
sleep 5
${ENDECA_BASE}/PlatformServices/11.1.0/tools/server/bin/shutdown.sh
sleep 5
${ENDECA_BASE}/ToolsAndFrameworks/11.1.0/server/bin/shutdown.sh
sleep 5
${ENDECA_BASE}/CAS/11.1.0/bin/cas-service-shutdown.sh
wait
echo "Endeca shutdown complete!"
;;
 *)
    usage
exit 2
esac

  exit $?

This script works most of the time does fail on occassions and I want to check what the correct start up sequence is for endeca and if my script needs to wait for each component to start up before I start the next?

Thanks in advance for your help.


Solution

  • Coming from a Microsoft Windows environment, only 3 of the for services you list are considered to be services and perhaps this is the issue with you startup/shutdown scripts. The MDEX isn't an explicit service. However one or more d-graphs will be running on the server where the MDEX component is installed and perhaps this is where the disconnect is.

    The PlatformServices component should be the most important one and can control stopping and starting the running d-graphs (MDEX Engines). Instead of stopping the MDEX 'service' you should rather stop the d-graphs using the runcommand.sh that exists within the individual Endeca Apps' control folder.

    So assuming you have your apps deployed in your $ENDECA_BASE and the app is called bated your script should be something like this.

    #Stop the Authoring Dgraph
    ${ENDECA_BASE}/apps/bated/control/runcommand.sh AuthoringDgraph stop
    #Stop the additional Dgraphs (as configured in your LiveDgraphCluster.xml)
    ${ENDECA_BASE}/apps/bated/control/runcommand.sh DgraphA1 stop
    

    Once these have been stopped, you can proceed to shut down the PlatformServices, ToolsAndFramework and CAS services, in any order.

    Starting up will require starting the above three services again and then again calling the runncommand.sh but this time with the start parameter. You will need to wait for the PlatformServices to be up and running properly before trying to start the d-graphs.

    Hope this helps.