From 92c93523dd025a126d5ae447a93e30adeece615a Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 23 Jan 2006 10:42:02 +0100 Subject: [PATCH] added option for relative pat in ndb config added option for verbose ndb startup --- mysql-test/mysql-test-run.pl | 6 ++++-- mysql-test/mysql-test-run.sh | 15 +++++++++++---- mysql-test/ndb/ndbcluster.sh | 11 ++++++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d4c68184627..91ca78ad544 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1371,7 +1371,8 @@ sub ndbcluster_install () { "--data-dir=$opt_vardir", "--verbose=2", $ndbcluster_opts, - "--initial"], + "--initial", + "--relative-config-data-dir"], "", "", "", "") ) { mtr_error("Error ndbcluster_install"); @@ -1463,7 +1464,8 @@ sub ndbcluster_install_slave () { "--verbose=2", "--small", "--ndbd-nodes=1", - "--initial"], + "--initial", + "--relative-config-data-dir"], "", "", "", "") ) { mtr_error("Error ndbcluster_install_slave"); diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index eb111a99b93..ce5a9bab4e4 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -272,6 +272,7 @@ USE_NDBCLUSTER_ONLY=0 USE_RUNNING_NDBCLUSTER="" USE_RUNNING_NDBCLUSTER_SLAVE="" NDB_EXTRA_TEST=0 +NDB_VERBOSE=0 NDBCLUSTER_EXTRA_OPTS="" USE_PURIFY="" PURIFY_LOGS="" @@ -357,6 +358,8 @@ while test $# -gt 0; do NDBCLUSTER_EXTRA_OPTS=" " NDB_EXTRA_TEST=1 ; ;; + --ndb-verbose) + NDB_VERBOSE=2 ;; --ndb_mgm-extra-opts=*) NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;; --ndb_mgmd-extra-opts=*) @@ -1273,8 +1276,10 @@ start_ndbcluster() then NDBCLUSTER_EXTRA_OPTS="--small" fi - OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --verbose=2 --initial" - echo "Starting master ndbcluster " $OPTS + OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --verbose=$NDB_VERBOSE --initial --relative-config-data-dir" + if [ "x$NDB_VERBOSE" != "x0" ] ; then + echo "Starting master ndbcluster " $OPTS + fi ./ndb/ndbcluster $OPTS || NDB_STATUS_OK=0 if [ x$NDB_STATUS_OK != x1 ] ; then if [ x$FORCE != x1 ] ; then @@ -1504,8 +1509,10 @@ start_slave() NDBCLUSTER_EXTRA_OPTS="--small" fi - OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=2" - echo "Starting slave ndbcluster " $OPTS + OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=$NDB_VERBOSE --relative-config-data-dir" + if [ "x$NDB_VERBOSE" != "x0" ] ; then + echo "Starting slave ndbcluster " $OPTS + fi ./ndb/ndbcluster $OPTS \ || NDB_SLAVE_STATUS_OK=0 # > /dev/null 2>&1 || NDB_SLAVE_STATUS_OK=0 diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 832987c7af6..fc1d12bac53 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -52,6 +52,7 @@ initial_ndb= status_ndb= ndb_diskless=0 ndbd_nodes=2 +relative_config_data_dir= ndb_no_ord=512 ndb_no_attr=2048 @@ -99,6 +100,9 @@ while test $# -gt 0; do --data-dir=*) fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` ;; + --relative-config-data-dir) + relative_config_data_dir=1 + ;; --port=*) port=`echo "$1" | sed -e "s;--port=;;"` ;; @@ -196,6 +200,11 @@ fi # Start management server as deamon # Edit file system path and ports in config file +if [ $relative_config_data_dir ] ; then + config_fs_ndb="." +else + config_fs_ndb=$fs_ndb +fi if [ $initial_ndb ] ; then rm -rf $fs_ndb/ndb_* 2>&1 | cat > /dev/null sed \ @@ -206,7 +215,7 @@ if [ $initial_ndb ] ; then -e s,"CHOOSE_IndexMemory","$ndb_imem",g \ -e s,"CHOOSE_Diskless","$ndb_diskless",g \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ - -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \ + -e s,"CHOOSE_FILESYSTEM","$config_fs_ndb",g \ -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \ -e s,"CHOOSE_DiskPageBufferMemory","$ndb_pbmem",g \ < "$config_ini" \