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:
@ -58,6 +58,9 @@ fi
|
||||
|
||||
lockdir=`$InstallDir/bin/getConfig Installation LockFileDirectory`
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
checkInstallSetup() {
|
||||
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation InitialInstallFlag`
|
||||
if [ $InitialInstallFlag != "y" ]; then
|
||||
@ -99,14 +102,14 @@ start() {
|
||||
|
||||
RETVAL=0
|
||||
echo "Starting MariaDB Columnstore Database Platform"
|
||||
rm -f /tmp/StopColumnstore
|
||||
rm -f ${tmpDir}/StopColumnstore
|
||||
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
stop() {
|
||||
echo "Shutting down MariaDB Columnstore Database Platform"
|
||||
touch /tmp/StopColumnstore
|
||||
touch ${tmpDir}/StopColumnstore
|
||||
pkill ProcMon
|
||||
pkill ProcMgr
|
||||
sleep 1
|
||||
|
@ -8,20 +8,20 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep "ERROR 1045" /tmp/mariadb-command-line.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR - PASSWORD: check log file: /tmp/mariadb-command-line.log"
|
||||
rm -f /tmp/error.check
|
||||
grep "ERROR 1045" ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR - PASSWORD: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 2
|
||||
fi
|
||||
|
||||
grep ERROR /tmp/mariadb-command-line.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/mariadb-command-line.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -37,27 +37,29 @@ for arg in "$@"; do
|
||||
prefix=`dirname $installdir`
|
||||
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
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
|
||||
>/tmp/mariadb-command-line.log
|
||||
>${tmpdir}/mariadb-command-line.log
|
||||
|
||||
#
|
||||
# Run command
|
||||
#
|
||||
echo "Run command" >>/tmp/mariadb-command-line.log
|
||||
cat >/tmp/mariadb-command-line.sql <<EOD
|
||||
echo "Run command" >>${tmpdir}/mariadb-command-line.log
|
||||
cat >${tmpdir}/mariadb-command-line.sql <<EOD
|
||||
$command;
|
||||
EOD
|
||||
|
||||
cat /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log
|
||||
cat${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys < /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log 2>&1
|
||||
calpontsys < ${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -55,6 +55,9 @@ fi
|
||||
PMwithUM=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMwithUM`
|
||||
ServerTypeInstall=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
echo "Amazon setup on Module"
|
||||
@ -121,40 +124,40 @@ MySQLRep=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLRep`
|
||||
if [ $MySQLRep = "y" ]; then
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||
echo "Run Upgrade on my.cnf on Module"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade > /tmp/mycnfUpgrade.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade > ${tmpDir}/mycnfUpgrade.log 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||
mysqlPort=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLPort`
|
||||
echo "Run Mysql Port update on my.cnf on Module"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > /tmp/mycnfUpgrade_port.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > ${tmpDir}/mycnfUpgrade_port.log 2>&1
|
||||
fi
|
||||
|
||||
# if um, run mysql install scripts
|
||||
if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $ServerTypeInstall = "2" ]; then
|
||||
echo "Run post-mysqld-install"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysqld-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysqld-install.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysqld-install --installdir=$COLUMNSTORE_INSTALL_DIR > ${tmpDir}/post-mysqld-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: post-mysqld-install failed: check /tmp/post-mysqld-install.log"
|
||||
echo "ERROR: post-mysqld-install failed: check ${tmpDir}/post-mysqld-install.log"
|
||||
exit 1
|
||||
fi
|
||||
echo "Run post-mysql-install"
|
||||
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysql-install.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR > ${tmpDir}/post-mysql-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: post-mysql-install failed: check /tmp/post-mysql-install.log"
|
||||
echo "ERROR: post-mysql-install failed: check ${tmpDir}/post-mysql-install.log"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $user == "root" ]; then
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh check > /tmp/syslogSetup-check.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh check > ${tmpDir}/syslogSetup-check.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
# try setup again
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh install > /tmp/syslogSetup-install.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh install > ${tmpDir}/syslogSetup-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: syslogSetup.sh check failed: check /tmp/syslogSetup-check.log"
|
||||
echo "WARNING: syslogSetup.sh check failed: check ${tmpDir}/syslogSetup-check.log"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
@ -16,9 +16,9 @@ set PASSWORD [lindex $argv 1]
|
||||
set COMMAND [lindex $argv 2]
|
||||
set DEBUG [lindex $argv 3]
|
||||
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami >whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
|
||||
set UNM [lindex $argv 4]
|
||||
if { $UNM != "" && $UNM != "-" } {
|
||||
|
@ -7,9 +7,9 @@
|
||||
# Argument 2 - Remote Server root password
|
||||
# Argument 3 - Command
|
||||
set timeout 10
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami > whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
set SERVER [lindex $argv 0]
|
||||
set PASSWORD [lindex $argv 1]
|
||||
set FILE [lindex $argv 2]
|
||||
|
@ -7,9 +7,9 @@
|
||||
# Argument 2 - Remote Server root password
|
||||
# Argument 3 - Command
|
||||
set timeout 30
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami >whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
set SERVER [lindex $argv 0]
|
||||
set PASSWORD [lindex $argv 1]
|
||||
set FILE [lindex $argv 2]
|
||||
|
@ -45,9 +45,12 @@ if [ $vflg -gt 0 ]; then
|
||||
echo "starting $exename $args with sleep=$sopt and tries=$topt"
|
||||
fi
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
while [ $keep_going -ne 0 ]; do
|
||||
$exename $args
|
||||
if [ -e /tmp/StopColumnstore ]; then
|
||||
if [ -e ${tmpDir}/StopColumnstore ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ $topt -gt 0 -a $retries -ge $topt ]; then
|
||||
|
@ -47,6 +47,9 @@ fi
|
||||
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog
|
||||
columnstoreSyslogFile7=$installdir/bin/columnstoreSyslog7
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
checkSyslog() {
|
||||
#check which syslog daemon is being used
|
||||
#first check which is running
|
||||
@ -101,16 +104,16 @@ if [ "$daemon" = "syslog-ng" ]; then
|
||||
fi
|
||||
elif [ "$daemon" = "rsyslog" ]; then
|
||||
#check if rsyslog version 7 or greater
|
||||
rsyslogd -v > /tmp/rsyslog.ver
|
||||
cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l`
|
||||
rsyslogd -v > ${tmpDir}/rsyslog.ver
|
||||
cnt=`grep "rsyslogd 7" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
cnt=`grep "rsyslogd 8" /tmp/rsyslog.ver | wc -l`
|
||||
cnt=`grep "rsyslogd 8" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
cnt=`grep "rsyslogd 9" /tmp/rsyslog.ver | wc -l`
|
||||
cnt=`grep "rsyslogd 9" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
|
Reference in New Issue
Block a user