mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
Debug when start-sandbox fails.
This commit is contained in:
@@ -42,10 +42,10 @@ cd $PWD
|
|||||||
|
|
||||||
echo -n "Starting MySQL test server on port PORT... "
|
echo -n "Starting MySQL test server on port PORT... "
|
||||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
||||||
sleep 1
|
|
||||||
if [ -f $PIDFILE -a -S $SOCKETFILE -a -s "/tmp/PORT/data/ibdata1" ]; then
|
if [ -f $PIDFILE -a -S $SOCKETFILE -a -s "/tmp/PORT/data/ibdata1" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in 1 2 3 4 5; do
|
for i in 1 2 3 4 5; do
|
||||||
|
@@ -9,6 +9,23 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug_sandbox() {
|
||||||
|
local port="$1"
|
||||||
|
echo
|
||||||
|
echo "MySQL processes:" >&2
|
||||||
|
ps x | grep mysql >&2
|
||||||
|
echo
|
||||||
|
if [ -d "/tmp/$port" ]; then
|
||||||
|
ls -lh /tmp/$port/* >&2
|
||||||
|
echo
|
||||||
|
cat /tmp/$port/data/mysqld.log >&2
|
||||||
|
echo
|
||||||
|
tail -n 100 /tmp/$port/data/genlog >&2
|
||||||
|
else
|
||||||
|
echo "/tmp/$port does not exist" >&2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
make_sandbox() {
|
make_sandbox() {
|
||||||
# Make the sandbox dir and extract the base files.
|
# Make the sandbox dir and extract the base files.
|
||||||
rm -rf /tmp/$port || die "can't rm /tmp/$port"
|
rm -rf /tmp/$port || die "can't rm /tmp/$port"
|
||||||
@@ -67,14 +84,14 @@ make_sandbox() {
|
|||||||
/tmp/$port/use -e 'SHOW /*!40100 ENGINE*/ INNODB STATUS' | grep 'INNODB MONITOR OUTPUT' >/dev/null 2>&1
|
/tmp/$port/use -e 'SHOW /*!40100 ENGINE*/ INNODB STATUS' | grep 'INNODB MONITOR OUTPUT' >/dev/null 2>&1
|
||||||
# grep exits 0 if lines are found
|
# grep exits 0 if lines are found
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "****** WARNING sandbox doesn't have a working InnoDB! ******" >&2
|
echo "Sandbox $type $port doesn't have InnoDB" >&2
|
||||||
cat /tmp/$port/data/mysqld.log >&2
|
debug_sandbox $port
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Sandbox $type $port failed to start." >&2
|
echo "Sandbox $type $port failed to start." >&2
|
||||||
cat /tmp/$port/data/mysqld.log >&2
|
debug_sandbox $port
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user