Commandserver Status und Aliase

Last Updated: Dec 15, 2017 11:48AM CET

Script zum Auslesen des Commandserver Status:

export INSTALLDIR=/opt/novastor/DataCenter
#
(echo connect \'jdbc:derby://localhost:1527/dc5\;user=dc5\;password=dc5\'\;
echo select count\(\*\) from active_job\;
echo select count\(\*\) from active_exec_plans\;
echo select count\(\*\) from executing_task_item\;
echo exit\;) > /tmp/sql.in
#
i=1
for port in 1527 32333 32334 32335 ; do
   tmp=$(netstat -anp | grep $port | grep LISTEN | awk '{print $7}')
   pid=$(echo $tmp | sed -e 's+/.*++')
   nam=$(echo $tmp | sed -e 's+.*/++')
   [ $i -eq 1 ] && nam="Derby DB"
   [ $i -eq 2 ] && nam="Open EJB"
   i=$((i+1))
   cnt=$(netstat -anp | grep $port | grep -v LISTEN | wc -l)
   cth=$(cat /proc/$pid/status | grep Threads | awk -F: '{print $2}')
   cvm=$(cat /proc/$pid/status | grep VmRSS   | awk -F: '{print $2}')
   echo "$cnt/$cth/$cvm ----------- $nam Connections/Threads/VmRSS"
done
#
echo "----------- active_job active_exec_plans executing_task_item"
export DERBY_HOME=$INSTALLDIR/db-derby
export JAVA_HOME=$INSTALLDIR/jre
$DERBY_HOME/bin/tools/ij < /tmp/sql.in | grep -v selected | grep -v '^$' | grep -v ij | grep -v -- "-----"
#
exit 0

Nützliche Aliase:

alias dbd='systemctl stop derby.service; systemctl start derby.service'
alias ejb='systemctl stop openejb.service; systemctl start openejb.service'
alias rcd='systemctl stop rcmd-dispatcher.service; systemctl start rcmd-dispatcher.service'
alias rce='systemctl stop rcmd-executor.service; systemctl start rcmd-executor.service'
alias sdc='/opt/novastor/DataCenter/db-derby/bin/tools/sql_show_dc5_activity.sh'


 
http://assets0.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete