You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-10 01:22:48 +03:00
This branch enforces the use of generic MariaDB server paths for their binaries and data rather than custom paths. /usr/local/mariadb/columnstore is now only for columnstore with this patch. It should be noted that this removes the auto-mounting of external MariaDB UM data storage for AWS. This is also a fix for MCOL-3510 after buildbot changes are made. Also... MCOL-3552 Use columnstore.cnf to load plugins The ColumnStore plugins now load using a columnstore.cnf instead of a SQL sequence to be more in-line with MariaDB's methods.
102 lines
2.8 KiB
Bash
Executable File
102 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# $Id: post-mysql-install 3661 2013-06-25 22:04:33Z dhill $
|
|
#
|
|
# Post-install steps for calpont-mysql install
|
|
|
|
# check log for error
|
|
checkForError() {
|
|
# check for password error
|
|
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 ${tmpdir}/error.check
|
|
$installdir/mysql/mysql-Columnstore stop
|
|
sleep 2
|
|
exit 2;
|
|
fi
|
|
|
|
rm -f ${tmpdir}/error.check
|
|
|
|
#---------------------------------------------------------------------------
|
|
# See if engine columnstore exist
|
|
#---------------------------------------------------------------------------
|
|
echo "checking for engine columnstore..."
|
|
mysql \
|
|
--user=root \
|
|
--execute='show engines;' \
|
|
calpontsys | grep -i columnstore
|
|
|
|
#
|
|
# Add compressiontype column to SYSCOLUMN if applicable
|
|
#
|
|
if [ $? -ne 0 ]; then
|
|
echo "columnstore doesn't exist"
|
|
exit 1
|
|
fi
|
|
|
|
echo "columnstore exist"
|
|
|
|
return 0;
|
|
}
|
|
|
|
prefix=/usr/local
|
|
installdir=$prefix/mariadb/columnstore
|
|
rpmmode=install
|
|
tmpdir="/tmp"
|
|
|
|
for arg in "$@"; do
|
|
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
|
|
prefix="$(echo $arg | awk -F= '{print $2}')"
|
|
installdir=$prefix/mariadb/columnstore
|
|
elif [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then
|
|
rpmmode="$(echo $arg | awk -F= '{print $2}')"
|
|
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}')"
|
|
else
|
|
echo "ignoring unknown argument: $arg" 1>&2
|
|
fi
|
|
done
|
|
|
|
USER=`whoami 2>/dev/null`
|
|
if [ $USER != "root" ]; then
|
|
ldconfig >/dev/null 2>&1
|
|
export COLUMNSTORE_INSTALL_DIR=$installdir
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib
|
|
else
|
|
ldconfig
|
|
fi
|
|
|
|
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
|
|
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g /etc/my.cnf.d/columnstore.cnf
|
|
fi
|
|
|
|
if [ -x $installdir/mysql/mysql-Columnstore ]; then
|
|
|
|
# Restart in the same way that mysqld will be started normally.
|
|
$installdir/mysql/mysql-Columnstore stop >/dev/null 2>&1
|
|
sleep 2
|
|
$installdir/mysql/mysql-Columnstore start --skip-grant-tables
|
|
|
|
sleep 5
|
|
|
|
# Install various Calpont stuff...
|
|
$installdir/mysql/install_mcs_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
|
|
checkForError
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
|
$installdir/mysql/mysql-Columnstore stop
|
|
sleep 2
|
|
exit 2;
|
|
fi
|
|
|
|
$installdir/mysql/mysql-Columnstore stop
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|