mariadb/mysql-test/ndb/stop_ndbcluster
unknown 6415ba8ad1 Addded test files for NDB
Updated stop_ndbcluster script


mysql-test/ndb/stop_ndbcluster:
  Allow script to run even if pidfile does not exist
  This is done so that it will try to connect to mgmtsrvr an stop all running ndb nodes.
  NOTE! It would be good if also the mgmtsrv could "stop itself"
mysql-test/r/ndb_index_ordered.result:
  Add table with two index columns to test
mysql-test/t/ndb_index_ordered.test:
  Add table with two index columns to test
2004-04-30 12:49:34 +02:00

55 lines
1,013 B
Bash
Executable file

#!/bin/sh
# Copyright (C) 2004 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file
# This scripts stops the table handler ndbcluster
bindir=`pwd`/../ndb/bin
pidfile=ndbcluster.pid
cfgfile=Ndb.cfg
while test $# -gt 0; do
case "$1" in
--port-base=*)
port_base=`echo "$1" | sed -e "s;--port-base=;;"`
;;
-- ) shift; break ;;
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
* ) break ;;
esac
shift
done
stop_default_ndbcluster() {
#if [ ! -f $pidfile ] ; then
# exit 0
#fi
if [ ! -f $cfgfile ] ; then
echo "$cfgfile missing"
exit 1
fi
ndb_host=`cat $cfgfile | sed -e "s,.*host=\(.*\)\:.*,\1,1"`
ndb_port=`cat $cfgfile | sed -e "s,.*host=$ndb_host\:\([0-9]*\).*,\1,1"`
# Start management client
exec_mgmtclient="$bindir/mgmtclient --try-reconnect=1 $ndb_host $ndb_port"
echo "$exec_mgmtclient"
echo "all stop" | $exec_mgmtclient
sleep 5
if [ -f $pidfile ] ; then
kill `cat $pidfile`
rm $pidfile
fi
}
stop_default_ndbcluster
exit 0