You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/05/27 16:41:07 UTC
[12/15] incubator-trafodion git commit: eliminated the redundant jps
command from the check scripts
eliminated the redundant jps command from the check scripts
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a5b4b963
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a5b4b963
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a5b4b963
Branch: refs/heads/master
Commit: a5b4b9631478acec7a1b6ea10752e5051db399e6
Parents: 30093ab
Author: Anuradha Hegde <he...@edev05.esgyn.local>
Authored: Wed May 25 23:34:48 2016 +0000
Committer: Anuradha Hegde <he...@edev05.esgyn.local>
Committed: Wed May 25 23:34:48 2016 +0000
----------------------------------------------------------------------
core/sqf/sql/scripts/dcscheck | 20 ++++++++++----------
core/sqf/sql/scripts/sqcheck | 29 +++++++++++++++--------------
2 files changed, 25 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a5b4b963/core/sqf/sql/scripts/dcscheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/dcscheck b/core/sqf/sql/scripts/dcscheck
index b0bc689..a478451 100755
--- a/core/sqf/sql/scripts/dcscheck
+++ b/core/sqf/sql/scripts/dcscheck
@@ -20,6 +20,7 @@
dcsznode=/$USER/dcs/master
dcstmp=/tmp/dcstmp-$USER.log
+tmpjps=/tmp/jpstmp-$USER.log
jpscmd=$JAVA_HOME/bin/jps
cfg_mxo_cnt=0
act_mxo_cnt=0
@@ -50,7 +51,6 @@ if [[ $? != 0 ]]; then
exit 3
fi
-echo
#Check if Trafodion is up and operational
sqcheck -f > $tmp_chk 2>&1
sq_stat=$?
@@ -58,6 +58,9 @@ if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
if [ -d $DCS_INSTALL_DIR ];then
+### Get the list of DcsServer and DcsMaster
+ $L_PDSH $jpscmd |/bin/egrep 'DcsMaster|DcsServer' > $tmpjps
+
### Get the configured primary node for DcsMaster
if [ -s ${DCS_INSTALL_DIR}/conf/master ]; then
primary_dcsmaster=`cat ${DCS_INSTALL_DIR}/conf/master | /bin/egrep -v '^#|^$'`
@@ -79,8 +82,8 @@ if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
fi
### Check if there are any DcsMaster and DcsServer's that are started
- actual_dcsmaster_cnt=`$L_PDSH $jpscmd |grep DcsMaster |wc -l`
- actual_dcsserver_cnt=`$L_PDSH $jpscmd |grep DcsServer |wc -l`
+ actual_dcsmaster_cnt=`cat $tmpjps |grep DcsMaster |wc -l`
+ actual_dcsserver_cnt=`cat $tmpjps |grep DcsServer |wc -l`
### Get the node where the active master is running
if [[ ! -z $CLUSTERNAME ]]; then
@@ -98,18 +101,15 @@ if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
fi
activeMaster=`$L_PDSH /sbin/ip addr show |grep $interface_to_use$ |cut -d':' -f1`
if [[ ! -z $activeMaster ]]; then
- activeDcsPid=`$L_PDSH $jpscmd |grep DcsMaster |grep $activeMaster |cut -d" " -f2 |paste -sd ' ' -`
+ activeDcsPid=`cat $tmpjps |grep DcsMaster |grep $activeMaster |cut -d" " -f2 |paste -sd ' ' -`
fi
else
- activeMaster=`$L_PDSH $jpscmd |grep DcsMaster |cut -d":" -f1 |paste -sd ' ' -`
- fi
-
- if ( [ -z $activeMaster ] && [ "$actual_dcsmaster_cnt" '>' 0 ] && [ "$actual_dcsserver_cnt" '>' 0 ] ); then
echo "Cluster Running : Non-HA"
+ activeMaster=`cat $tmpjps |grep DcsMaster |cut -d":" -f1 |paste -sd ' ' -`
fi
else
### Get the pid of the active DcsMaster
- activeDcsPid=`$L_PDSH $jpscmd |grep DcsMaster |cut -d" " -f1`
+ activeDcsPid=`cat $tmpjps |grep DcsMaster |cut -d" " -f1`
fi
@@ -162,7 +162,7 @@ if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
fi
echo
fi
- rm -f $dcstmp $tmp_chk $tmp_ps
+ rm -f $dcstmp $tmp_chk $tmp_ps $tmpjps
else
if ( [ "$actual_dcsmaster_cnt" '>' 0 ] || [ "$actual_dcsserver_cnt" '>' 0 ] ); then
echo "Partial DCS process is up and running. Please stop and restart DCS using 'dcsstop' and 'dcsstart' command..."
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a5b4b963/core/sqf/sql/scripts/sqcheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqcheck b/core/sqf/sql/scripts/sqcheck
index e55bf7c..95b2f95 100755
--- a/core/sqf/sql/scripts/sqcheck
+++ b/core/sqf/sql/scripts/sqcheck
@@ -109,7 +109,6 @@ function fillArray {
function getDcsInfo {
dcsznode=/$USER/dcs/master
- jpscmd=$JAVA_HOME/bin/jps
if [ -d $DCS_INSTALL_DIR ];then
@@ -128,13 +127,8 @@ function getDcsInfo {
fi
### Check if there are any DcsMaster and DcsServer's that are started
- if [ -e $SQ_PDSH ]; then
- actual_dcsmaster_cnt=`$SQ_PDSH $MY_NODES $jpscmd |grep DcsMaster |wc -l`
- actual_dcsserver_cnt=`$SQ_PDSH $MY_NODES $jpscmd |grep DcsServer |wc -l`
- else
- actual_dcsmaster_cnt=`$jpscmd |grep DcsMaster |wc -l`
- actual_dcsserver_cnt=`$jpscmd |grep DcsServer |wc -l`
- fi
+ actual_dcsmaster_cnt=`cat $tmpjps |grep DcsMaster |wc -l`
+ actual_dcsserver_cnt=`cat $tmpjps |grep DcsServer |wc -l`
if ( [ "$cfg_dcsserver_cnt" '!=' "$actual_dcsserver_cnt" ] ); then
let down_dcsserver_cnt=cfg_dcsserver_cnt-actual_dcsserver_cnt
@@ -151,16 +145,11 @@ function getDcsInfo {
}
function getRestInfo {
- jpscmd=$JAVA_HOME/bin/jps
if [ -d $REST_INSTALL_DIR ];then
### Check if there are any DcsMaster and DcsServer's that are started
- if [ -e $SQ_PDSH ]; then
- actual_restserver_cnt=`$SQ_PDSH $MY_NODES $jpscmd |grep TrafodionRest |wc -l`
- else
- actual_restserver_cnt=`$jpscmd |grep TrafodionRest |wc -l`
- fi
+ actual_restserver_cnt=`cat $tmpjps |grep TrafodionRest |wc -l`
let cfg_restserver_cnt=actual_restserver_cnt
if ( [ "$cfg_restserver_cnt" '!=' "$actual_restserver_cnt" ] ); then
let down_restserver_cnt=cfg_restserver_cnt-actual_restserver_cnt
@@ -171,6 +160,8 @@ function getRestInfo {
}
+jpscmd=$JAVA_HOME/bin/jps
+tmpjps=/tmp/tmpjps-$USER.log
begin_time_seconds=$(date +%s)
declare -i max_checks
@@ -370,6 +361,13 @@ fi
fi
done
fi
+
+ #Get the list of DcsMaster, DcsServer and TrafodionRest
+ if [ -e $SQ_PDSH ]; then
+ $SQ_PDSH $MY_NODES $jpscmd |egrep 'DcsMaster|DcsServer|TrafodionRest' > $tmpjps
+ else
+ $jpscmd |egrep 'DcsMaster|DcsServer|TrafodionRest' > $tmpjps
+ fi
#TrafodionRestServer
getRestInfo
@@ -383,6 +381,9 @@ fi
act_mxo_down_cnt=''
fi
+ #Cleanup the tmpjps file
+ rm -f $tmpjps
+
#RMS
let act_rms_cnt=`< $sq_tmp_ps egrep -a -i ' mxssmp| mxsscp' | wc -l`
if [ $reset_counter '==' 1 ]; then