You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-520
This commit is contained in:
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/disable-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/disable-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/disable-rep-status.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file:${tmpdir}/disable-rep-status.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -30,42 +30,44 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
>/tmp/disable-rep-status.log
|
||||
>${tmpdir}/disable-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
echo "Run stop slave command" >>${tmpdir}/disable-rep-status.log
|
||||
cat >${tmpdir}/idb_disable-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run reset slave command
|
||||
#
|
||||
echo "Run reset slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
echo "Run reset slave command" >>${tmpdir}/disable-rep-status.log
|
||||
cat >${tmpdir}/idb_disable-rep.sql <<EOD
|
||||
reset slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/master-rep-status-$hostipaddr.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/master-rep-status-$hostipaddr.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/master-rep-status-$hostipaddr.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/master-rep-status-$hostipaddr.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -29,6 +29,8 @@ for arg in "$@"; do
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--hostIP='` -eq 9 ]; then
|
||||
hostipaddr="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
@ -37,69 +39,69 @@ test -f $installdir/post/functions && . $installdir/post/functions
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/master-rep-status-$hostipaddr.log
|
||||
>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
|
||||
#
|
||||
# Create Replication User
|
||||
#
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
CREATE USER IF NOT EXISTS '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Grant table access for created user
|
||||
#
|
||||
echo "Grant table access for $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Grant table access for $repUser for node $hostipaddr" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
use mysql
|
||||
grant all on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
grant REPLICATION SLAVE on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW MASTER STATUS
|
||||
#
|
||||
echo "Run SHOW MASTER STATUS to node log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Run SHOW MASTER STATUS to node log" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
echo "Run SHOW MASTER STATUS to master status log /tmp/show-master-status.log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Run SHOW MASTER STATUS to master status log ${tmpdir}/show-master-status.log" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >${tmpdir}/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/show-master-status.log
|
||||
|
||||
|
||||
#alls good, 'OK' for success
|
||||
|
@ -167,16 +167,20 @@ mkdir -p $installdir/data/bulk/rollback >/dev/null 2>&1
|
||||
mkdir -p $installdir/data/bulk/tmpjob >/dev/null 2>&1
|
||||
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
|
||||
#get temp directory
|
||||
#get temp base directory
|
||||
tmpDir="/tmp"
|
||||
if [ $user != "root" ]; then
|
||||
tmpDir=$HOME"./tmp"
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#get columnstore temp file directory name
|
||||
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
|
||||
tmpDir=$tmpDir+$TempFileDir
|
||||
|
||||
#set base columnstore temp file directory
|
||||
$installdir/bin/setConfig -d SystemConfig SystemTempFileDir $tmpDir
|
||||
|
||||
#create columnstore temp file directory
|
||||
mkdir -p $tmpDir >/dev/null 2>&1
|
||||
|
||||
|
@ -7,16 +7,16 @@
|
||||
# check log for error
|
||||
checkForError() {
|
||||
# check for password error
|
||||
grep "ERROR 1045" ${tmpdir}/mysql_install.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "MySQL Password file missing or incorrect, check .my.cnf file"
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
$installdir/mysql/mysql-Columnstore stop
|
||||
sleep 2
|
||||
exit 2;
|
||||
fi
|
||||
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if engine columnstore exist
|
||||
|
@ -73,14 +73,7 @@ rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1\
|
||||
$installdir/bin/clearShm > /dev/null 2>&1
|
||||
|
||||
#get temp directory
|
||||
tmpDir="/tmp"
|
||||
if [ $user != "root" ]; then
|
||||
tmpDir=$HOME"./tmp"
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
|
||||
tmpDir=$tmpDir+$TempFileDir
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
# delete tmp files
|
||||
rm -rf $tmpDir
|
||||
|
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/slave-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/slave-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/slave-rep-status.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/slave-rep-status.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -35,6 +35,10 @@ for arg in "$@"; do
|
||||
masterlogpos="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
||||
port="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
@ -43,29 +47,29 @@ test -f $installdir/post/functions && . $installdir/post/functions
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/slave-rep-status.log
|
||||
>${tmpdir}/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run stop slave command" >>${tmpdir}slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run Change Master Command
|
||||
#
|
||||
echo "Run Change Master Command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run Change Master Command" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
CHANGE MASTER TO
|
||||
MASTER_HOST='$masteripaddr',
|
||||
MASTER_USER='$repUser',
|
||||
@ -76,43 +80,43 @@ CHANGE MASTER TO
|
||||
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run start slave command
|
||||
#
|
||||
echo "Run start slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run start slave command" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
start slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW SLAVE STATUS
|
||||
#
|
||||
echo "Run SHOW SLAVE STATUS to node log" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run SHOW SLAVE STATUS to node log" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
SHOW SLAVE STATUS\G
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
Reference in New Issue
Block a user