mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-16 02:01:41 +08:00
WIP
This commit is contained in:
Binary file not shown.
@@ -28,10 +28,12 @@ relay_log = mysql-relay-bin
|
||||
report-host = 127.0.0.1
|
||||
report-port = PORT
|
||||
server-id = PORT
|
||||
#local_infile = ON
|
||||
#default_authentication_plugin=mysql_native_password
|
||||
|
||||
# fkc test
|
||||
binlog_format = STATEMENT
|
||||
performance_schema = ON
|
||||
#performance_schema = ON
|
||||
#performance-schema-instrument='wait/lock/metadata/sql/mdl=ON'
|
||||
#performance-schema-instrument='transaction=ON'
|
||||
secure-file-priv =
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
start_ts=$(date +%s)
|
||||
|
||||
PIDFILE="/tmp/PORT/data/mysql_sandboxPORT.pid"
|
||||
SOCKETFILE="/tmp/PORT/mysql_sandboxPORT.sock"
|
||||
PIDFILE="TMP_DIR/PORT/data/mysql_sandboxPORT.pid"
|
||||
SOCKETFILE="TMP_DIR/PORT/mysql_sandboxPORT.sock"
|
||||
BASEDIR="PERCONA_TOOLKIT_SANDBOX"
|
||||
|
||||
sandbox_is_alive() {
|
||||
@@ -11,14 +11,14 @@ sandbox_is_alive() {
|
||||
[ -f $PIDFILE -a -S $SOCKETFILE ] || return 1
|
||||
|
||||
# And that PID file must have a PID.
|
||||
local pid=$(cat /tmp/PORT/data/mysql_sandboxPORT.pid 2>/dev/null)
|
||||
local pid=$(cat TMP_DIR/PORT/data/mysql_sandboxPORT.pid 2>/dev/null)
|
||||
[ "$pid" ] || return 1
|
||||
|
||||
# Second, MySQL is truly alive when it respond to a ping.
|
||||
# It's not enough that the mysqld process is running because
|
||||
# InnoDB can take time to create ibdata1, etc. So MySQL is
|
||||
# only alive when it responds to queries.
|
||||
$BASEDIR/bin/mysqladmin --defaults-file="/tmp/PORT/my.sandbox.cnf" ping >/dev/null 2>&1
|
||||
$BASEDIR/bin/mysqladmin --defaults-file="TMP_DIR/PORT/my.sandbox.cnf" ping >/dev/null 2>&1
|
||||
[ $? -eq 0 ] || return 1
|
||||
echo "return 0"
|
||||
|
||||
@@ -42,7 +42,7 @@ if [ -f "$PIDFILE" -o -S "$SOCKETFILE" ]; then
|
||||
fi
|
||||
|
||||
# Sandbox exists but is not running. Clear it and then start it.
|
||||
/tmp/PORT/stop >/dev/null 2>&1
|
||||
TMP_DIR/PORT/stop >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
echo -n "Starting MySQL test server on port PORT... "
|
||||
@@ -51,11 +51,11 @@ echo -n "Starting MySQL test server on port PORT... "
|
||||
cwd=$PWD
|
||||
cd $BASEDIR
|
||||
|
||||
init_file="/tmp/PORT/mysql-init"
|
||||
init_file="TMP_DIR/PORT/mysql-init"
|
||||
if [ -e $init_file ]; then
|
||||
$BASEDIR/MYSQLD --defaults-file=/tmp/PORT/my.sandbox.cnf -u root --init-file $init_file &
|
||||
$BASEDIR/MYSQLD --defaults-file=TMP_DIR/PORT/my.sandbox.cnf -u root --init-file $init_file &
|
||||
else
|
||||
$BASEDIR/MYSQLD --defaults-file=/tmp/PORT/my.sandbox.cnf > /dev/null 2>&1 &
|
||||
$BASEDIR/MYSQLD --defaults-file=TMP_DIR/PORT/my.sandbox.cnf > /dev/null 2>&1 &
|
||||
fi
|
||||
cd $PWD
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
start_ts=$(date +%s)
|
||||
|
||||
PIDFILE="/tmp/PORT/data/mysql_sandboxPORT.pid"
|
||||
SOCKETFILE="/tmp/PORT/mysql_sandboxPORT.sock"
|
||||
PIDFILE="TMP_DIR/PORT/data/mysql_sandboxPORT.pid"
|
||||
SOCKETFILE="TMP_DIR/PORT/mysql_sandboxPORT.sock"
|
||||
BASEDIR="PERCONA_TOOLKIT_SANDBOX"
|
||||
|
||||
sandbox_is_alive() {
|
||||
@@ -11,14 +11,14 @@ sandbox_is_alive() {
|
||||
[ -f $PIDFILE -a -S $SOCKETFILE ] || return 1
|
||||
|
||||
# And that PID file must have a PID.
|
||||
local pid=$(cat /tmp/PORT/data/mysql_sandboxPORT.pid 2>/dev/null)
|
||||
local pid=$(cat TMP_DIR/PORT/data/mysql_sandboxPORT.pid 2>/dev/null)
|
||||
[ "$pid" ] || return 1
|
||||
|
||||
# Second, MySQL is truly alive when it respond to a ping.
|
||||
# It's not enough that the mysqld process is running because
|
||||
# InnoDB can take time to create ibdata1, etc. So MySQL is
|
||||
# only alive when it responds to queries.
|
||||
$BASEDIR/bin/mysqladmin --defaults-file="/tmp/PORT/my.sandbox.cnf" ping >/dev/null 2>&1
|
||||
$BASEDIR/bin/mysqladmin --defaults-file="TMP_DIR/PORT/my.sandbox.cnf" ping >/dev/null 2>&1
|
||||
[ $? -eq 0 ] || return 1
|
||||
|
||||
return 0
|
||||
@@ -36,7 +36,7 @@ _seq() {
|
||||
echo -n "Stopping MySQL test server on port PORT... "
|
||||
|
||||
if sandbox_is_alive; then
|
||||
$BASEDIR/bin/mysqladmin --defaults-file=/tmp/PORT/my.sandbox.cnf shutdown
|
||||
$BASEDIR/bin/mysqladmin --defaults-file=TMP_DIR/PORT/my.sandbox.cnf shutdown
|
||||
fi
|
||||
|
||||
for i in $(_seq 60); do
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
BASEDIR="PERCONA_TOOLKIT_SANDBOX"
|
||||
|
||||
$BASEDIR/bin/mysql --defaults-file=/tmp/PORT/my.sandbox.cnf "$@"
|
||||
$BASEDIR/bin/mysql --defaults-file=TMP_DIR/PORT/my.sandbox.cnf "$@"
|
||||
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user