Consultor Eletrônico



Kbase 19408: Will Progress run on SCO Unixware & NonStop Clusters
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/08/2003
Status: Technically Reviewed

GOAL:

Will Progress run on SCO Unixware and NonStop Clusters?

FACT(s) (Environment):

Progress 9.1x

FACT(s) (Environment):

Caldera Open UNIX/SCO UnixWare

SYMPTOM(s):

NonStop Clusters (NSC)

FIX:

Progress Software Development has verified that Progress Version 9.1 runs well in a SCO Non Stop Clusters (NSC) environment, and supports, via scripts, the NSC fail-over capability.

I have attached sample scripts that need to be written to take advantage of NSC fail-over capabilities.

Procedure:
   Below is the procedure that was followed to allow Progress to correctly
failover in this environment:

1) Install Progress in /usr/dlc and specify the work directory as /home/progress.

2) Create a new "progress" user account:
       useradd -d /home/progress progress
  This is required by the configure script listed at the end of this kbase
  and is used for database location and ownership information.

3) Place all of the scripts listed at the end of this kbase
  in /etc/dbms_guard/progress :
       progress_configure - this script is used to configure the
                            failover environment.
       progress_start - this script is used to restart Progress after a
                        failover.
       env.progress.sh.template - this file is used by the configure script
                                  to setup the Progress environment after a
                                  failover.
       ka_progress - this file is used by the failover code when restarting
                     Progress.
  Note that these scripts are setup to use the "sports" database.
  If a different database is required, these files will need to be modified.

4) Set the correct file ownership and protection:
       chown adm:adm /etc/dbms_guard/progress/progress_start
       chmod 755 /etc/dbms_guard/progress/progress_start
       chown adm:adm /etc/dbms_guard/progress
     
5) Execute the configure script:
       cd /etc/dbms_guard/progress
       . ./progress_configure

6) Create the database
       cd /home/progress
       prodb sports sports

7) Create a pf file for the database in /home/progress containing:
           -db /home/progress/sports
           -S demosv2
  plus additional Progress parameters as needed.

8) Tell the "failover" software about this database:
  dbms_guard ON

9) Reboot each machine with:
   clusternode_shutdown -N node_num -g grace_peroid -y [-hr]
   ("node_self" will tell you which machine you're currently on)

10) To shutdown the failover:
   dbms_guard OFF
   _mprshut -by sports
Files:

ka_progress:
:/usr/dlc/bin/_mprosrv:::root:root::::dbms_restart:::::



env.progress.sh.template:


###################################################################
#                                                                 #
#    This file is simply a template and needs to be modified by   #
#    the Progress Database Administrator so that it exports the   #
#    appropriate Progress environment variables.                  #
#                                                                 #
#               (Change lines as deemed appropriate)              #
#                                                                 #
###################################################################

# The progress_configure script will copy this template to your
# $WORKDIR directory under the name, env.restart.sh.  You will
# need to customize it for your system so that the dbms_guard feature
# may source the file prior to cold-restarting your progress data-
# base server.  As an alternative, you may simply make env.restart.sh
# a symbolic link to a pre-existing environment file.
#
# Because these variables will be sourced within a bourne shell
# upon restart, it is vital that they be set and exported in two
# separate lines, as in the examples below.  Failure to do so will
# result in a failure to restart the database se.rver after a node
# failure.

# Define the environment variables (modify as needed)

TERM=vt100
PFFILE=/home/progress/sports.pf
DLC=/usr/dlc
DLCLOAD=$DLC/probuild
PROPATH=./:$DLC/tty:$DLC:$DLCLOAD
PROLOAD=$DLC/probuild
WRKDIR=/home/progress
PROMSGS=$DLC/promsgs
PROCFG=$DLC/progress.cfg
PATH=$PATH:$DLC/bin:$DLC
PROEXE=$DLC/bin/_progres
PROTERMCAP=$DLC/protermcap

# Now export the environment variables (modify as needed)

export DLC
export DLCLOAD
export PROPATH
export PROLOAD
export WRKDIR
export PROMSGS
export PROCFG
export PROEXE
export PROTERMCAP
export PATH
export TERM
export PFFILE
progress_configure:

#!/bin/sh
  ######################################################################
  #                                                                    #
  #   Automatically configures files, depending on how database user   #
  #   accounts are defined                                             #
  #                                                                    #
  ######################################################################

DBASE=progress
DBMS_PATH=/etc/dbms_guard

# Make sure the user exists #############################################
if [ `cut -d: -f1 /etc/passwd|grep $DBASE|wc -l` -lt 1 ]
then
       echo Please add user $DBASE first
       exit 1
fi

# Obtain Group Number too ###############################################
DB_GRP=`cut -d: -f1-4 /etc/passwd|grep "^${DBASE}:"|cut -d: -f4`

# Make sure the home directory for user exists ##########################
DB_HOME=`grep "^${DBASE}:" /etc/passwd |cut -d: -f6`
if [ ! -d $DB_HOME ]
then
       echo Please create $DBASE home directory $DB_HOME first
       exit 1
fi

echo User $DBASE of group number $DB_GRP has home directory $DB_HOME


  ######################################################################
  #                                                                    #
  #   Create environment script $DB_HOME/env.restart.sh from template  #
  #                                                                    #
  ######################################################################

if [ -f $DB_HOME/env.restart.sh ]
then    # We do not want to clobber an existing environment file
       mv $DB_HOME/env.restart.sh $DB_HOME/env.restart.orig
       echo renaming original $DB_HOME/env.restart.sh
fi
cp $DBMS_PATH/$DBASE/env.$DBASE.sh.template $DB_HOME/env.restart.sh
chmod 644 $DB_HOME/env.restart.sh
chown $DBASE:$DB_GRP $DB_HOME/env.restart.sh


  ######################################################################
  #                                                                    #
  #   Make ka_dbms point to the right KA file with right ownerships    #
  #                                                                    #
  ######################################################################

if [ -f /etc/spawndaemon.d/ka_dbms ]
then
       rm -f /etc/spawndaemon.d/ka_dbms
fi
ln -s $DBMS_PATH/$DBASE/ka_$DBASE /etc/spawndaemon.d/ka_dbms
chown -h adm:adm /etc/spawndaemon.d/ka_dbms


  ######################################################################
  #                                                                    #
  #   Make dbms_coldstart point to right file with right ownerships    #
  #                                                                    #
  ######################################################################

if [ -x $DBMS_PATH/dbms_coldstart ]
then
       rm -f $DBMS_PATH/dbms_coldstart
fi
ln -s $DBMS_PATH/$DBASE/${DBASE}_start $DBMS_PATH/dbms_coldstart
chown -h $DBASE:$DB_GRP $DBMS_PATH/dbms_coldstart


  ######################################################################
  #                                                                    #
  #   Resolve references to $DB_HOME in dbms_coldstart script          #
  #                                                                    #
  ####################################################################.##

sed "s,\$DBASE_HOME,$DB_HOME," $DBMS_PATH/dbms_coldstart > foo
mv foo $DBMS_PATH/$DBASE/${DBASE}_start
chmod 755 $DBMS_PATH/$DBASE/${DBASE}_start
chown $DBASE:$DB_GRP $DBMS_PATH/$DBASE/${DBASE}_start

echo Configuration of dbms_guard for $DBASE is complete.
echo Next, modify environment file $DB_HOME/env.restart.sh


progress_start:

#!/bin/sh
#                 Filename: /etc/dbms_guard/progress/progress_start
###################################################################
#                                                                 #
#    This script starts up the progress Database by sourcing en-  #
#    vironment variables and invoking PROSERVE. It can be modified#
#    by the progress Database Administrator to bring up the data- #
#    base server in any other way if so desired.                  #
#                                                                 #
#        (Change or uncomment bottom code as appropriate          #
###################################################################
###################################################################
# Race-condition elimination:
#   No need to start progress instance if _mprosrv is already
#   doing that.  Check for sufficient processes and cold-start
#   if _mprosrv is not running.
###################################################################

. /home/progress/env.restart.sh

if [ -f /home/progress/sports.lk ]
then
       /usr/dlc/bin/proutil -pf $PFFILE -C holder
       if [ $? -eq 16 ]
       then
               rm -f /home/progress/sports.lk
       fi
fi

/usr/dlc/bin/proutil -pf $PFFILE -C holder
if [ $? -eq 0 ]
then
   # Define and Export Database Environment Variables
   # The progress_configure script will overwrite the line below:

   # Fire up the progress Server

   ## when monitoring brokers, use this
   /usr/dlc/bin/proserve -pf $PFFILE
fi

# Finally, prevent the cold-restart script from terminating
# so that keepalive will know when a node has failed.  Do NOT
# DELETE any lines from here to the end of the file!
while [ 1 ]
do
   sleep 90
   /usr/dlc/bin/proutil -pf $PFFILE -C holder
   if [ $? -ne 16 ]
   then
       exit 1
   fi
done
.