mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
34 lines
941 B
Bash
Executable file
34 lines
941 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# configurable parameters
|
|
MYSQLCLUSTER_PORT_BASE="22"
|
|
# end configurable parameters
|
|
|
|
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
|
|
echo "MYSQLCLUSTER_TOP not set or directory does not exist"
|
|
exit 1
|
|
fi
|
|
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
|
|
echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
if test "$1" = "ndb_started"
|
|
then
|
|
shift
|
|
mgmt_host=$1
|
|
shift
|
|
mgmt_port=$1
|
|
shift
|
|
if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
|
|
echo "syntax: ndb_started hostname port"
|
|
exit 1
|
|
fi
|
|
NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
|
|
echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
|
|
else
|
|
NDB_CONNECTSTRING="host=localhost:"$MYSQLCLUSTER_PORT_BASE"00;nodeid=11"
|
|
fi
|
|
export NDB_CONNECTSTRING
|
|
|
|
mysqld --default-table-type=ndbcluster --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
|