EhCache Start and Stop scripts
Here are the custom scripts for start and stop operations.
gethostname.sh
HOST_NAME=`cat /proc/sys/kernel/hostname | cut -d'.' -f1`
echo $HOST_NAME
profile_terracotta
TERRACOTTA_HOME=/opt/terracotta-3.4/terracotta-ee-3.4.0
JAVA_HOME=/opt/jdk1.6.0_22
export TERRACOTTA_HOME JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin:$SCRIPTS:$TERRACOTTA_HOME/bin
host=`gethostname.sh`
node=""
usr=admin
pwd=""
if [ "$host" = myhost1 ]
then
node=primary
pwd=test1
elif [ "$host" = myhost2 ]
then
node=secondary
pwd=test2
fi
start_terracotta.sh
source profile_terracotta
nohup $TERRACOTTA_HOME/bin/start-tc-server.sh -f /opt/terracotta-3.4/config/tc-config.xml > /opt/terracotta-3.4/startuplogs/startup.log &
sleep 10
cat /opt/terracotta-3.4/startuplogs/startup.log
ps -ef | grep java
stop_terracotta.sh
source profile_terracotta
$TERRACOTTA_HOME/bin/stop-tc-server.sh -f /opt/terracotta-3.4/config/tc-config.xml -n $node -u $usr -w $pwd
rm -Rf /opt/terracotta-3.4/server-logs/.terra*
rm -Rf /opt/terracotta-3.4/server-logs
rm -Rf /opt/terracotta-3.4/server-data
rm -Rf /opt/terracotta-3.4/server-statistics
rm -Rf /opt/terracotta-3.4/startuplogs/*
sleep 10
ps -ef | grep java
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home