>> Do you shutdown machine gracefully? 

Thanks for bring up this point.  AmazonEC2Client.stopInstances command is
utilized to shutdown machines. 

After reviewing the stopInstances docs, the Amazon shutdowns seem to be
uncoordinated.

"Before stopping an instance, make sure it is in a state from which it can
be restarted."

Question: 
Is there a remote command that can be given to gracefully shutdown SEDNA, or
do I need to create a backdoor command?


>> Send this script, please.  

The following is the script:

#!/bin/bash

############################################################
# Sedna Database Service
# Copyright (c) 2008 Charles Foster, http://www.cfoster.net/
#
# Start, stop, restart or query the status
# of the Sedna XML Database.
#
# This service manages the both the Sedna Governor Server
# as well as loading/unloading child database instances.
#
# You are free to modify and redistribute this script,
# providing you leave the copyright message in tact.
############################################################

# Home of The Sedna Installation
SEDNA_HOME=/home/ubuntu/sedna

# The user account which will run Sedna
USER=ubuntu

# Database instances to start/stop, separated by spaces
DBLIST="qbdb"

############################################################
# Don't edit below here, unless you know what you are doing.
############################################################

SPIDX="pidof se_gov"
DESC="Sedna XML Database Server"
IDESC="Sedna DB"
SEGOV="/etc/init.d/sedna"

. /lib/lsb/init-functions

do_start()
{
    if [ `$SPIDX` ]; then
      log_daemon_msg "$DESC already running."
    else
      log_daemon_msg "Starting $DESC"
      sudo -u $USER nohup $SEDNA_HOME/bin/se_gov > /dev/null;\
      if [ `$SPIDX` ]; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
    fi
}

do_start_dbs()
{
  for n in $DBLIST;\
  do\
    log_daemon_msg "Starting $IDESC \"$n\""
    if [ ! -d $SEDNA_HOME/data/"$n"_files ]; then
      log_end_msg 1
    else
      if sudo -u $USER nohup $SEDNA_HOME/bin/se_sm $n > /dev/null; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
    fi
  done
}

do_stop_dbs()
{
  if [ ! `$SPIDX` ]; then
    return
  fi

  for n in $DBLIST;\
  do\
    log_daemon_msg "Stopping $IDESC \"$n\""
    if [ ! -d $SEDNA_HOME/data/"$n"_files ]; then
      log_end_msg 1
    else
      if sudo -u $USER nohup $SEDNA_HOME/bin/se_smsd $n > /dev/null; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
    fi
  done
}


get_status()
{
  if [ `$SPIDX` ]; then
      $SEDNA_HOME/bin/se_rc
  else
    echo "$DESC not running."
  fi
}

do_stop()
{
    log_daemon_msg "Stopping $DESC"
    if [ ! `$SPIDX` ]; then
      log_daemon_msg "$DESC was not running in the first place."
      log_end_msg 1
    else
      sudo -u $USER nohup $SEDNA_HOME/bin/se_stop > /dev/null
      if [ ! `$SPIDX` ]; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
    fi
}

case "$1" in
  start)
      do_start
      do_start_dbs
    ;;
  status)
      get_status
    ;;
  stop)
      do_stop_dbs
      do_stop
    ;;
  restart)
      do_stop_dbs
      do_stop
      do_start
      do_start_dbs
    ;;
  *)
    echo "Usage: $SEGOV {start|stop|status|restart}" >&2
    exit 1
  ;;
esac
exit $?


From: Ivan Shcheklein [mailto:shchekl...@gmail.com] 
Sent: Sunday, November 13, 2011 4:13 AM
To: Malcolm Davis
Cc: sedna-discussion@lists.sourceforge.net
Subject: Re: [Sedna-discussion] SEDNA WaitForProcess failed

Hi Malcolm,

>From time to time, after an Amazon instances has been shutdown, SEDNA
fails to start properly.


Do you shutdown machine gracefully? 

 
I use a modified init.d script provided by Charles Foster to start and
stop SEDNA.


Send this script, please.  


Command line
Starting database recovery or hot-backup restoration...
Database recovery in progress...
SEDNA Message: FATAL ERROR
in process [720] /home/ubuntu/sedna/bin/se_sm qbDb
System error. This error means system malfunction.
Cannot create data directory for soft fault logs
Cannot create soft fault log ......


Send exact commands you run. On behalf of which user. Send also result of:

ls -lh SEDNA_HOME
ls -lh SEDNA_HOME/data
ls -lh SEDNA_HOME/cfg
 

ERROR 11/11/2011 15:30:13 (RCV qbDb pid=594) [vmm.cpp:vmm_remap:104]:
(SE1035) Memory mapping error.
INFO  11/11/2011 15:30:13 (SM qbDb pid=548)
[bm_core.cpp:bm_log_out_io_statistics:521]: IO block reads:34, writes:0
LOG   11/11/2011 15:30:13 (RCV qbDb pid=594) [tr.cpp:TRmain:514]: Session is
closed
SYS   11/11/2011 15:30:14 (GOV pid=536)
[uprocess.c:uWaitForChildProcess:495]: waitpid (code = 10): No child
processes
FATAL 11/11/2011 15:30:14 (GOV pid=536)
[gov_table.cpp:wait_erase_session:133]: Error, WaitForProcess failed


Is this log snippet right after OS start or after your attempt to start
database via command line?

 
Is there something I can do to recover from the failure?


First of all, we should understand what's going on. Output and log you sent
contain a log of strange things. BTW, probably you can give us copy of your
machine to reproduce this?

 
Is there a standard start and stop practice that should be utilized?


Yep.  se_stop or se_stop -hard to terminate immediately all running
transactions must be called to shutdown Sedna server gracefully.  

 
Is this problem resolved in the newest SEDNA RC?


Again it's hard to say since I don't understand problem right now. Though,
RC contains a lot of fixes including in recovery process. So, give it a try.
 

Ivan Shcheklein,
Sedna Team


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to