diff --git a/dbcon/mysql/columnstore.cnf b/dbcon/mysql/columnstore.cnf index 629401c7c..f8ceed866 100644 --- a/dbcon/mysql/columnstore.cnf +++ b/dbcon/mysql/columnstore.cnf @@ -1,6 +1,4 @@ [mysqld] -lower_case_table_names=1 - plugin-load-add=ha_columnstore.so # Enable compression by default on create, set to NONE to turn off diff --git a/dbcon/mysql/install_mcs_mysql.sh.in b/dbcon/mysql/install_mcs_mysql.sh.in index 9b8db01d2..27b76e2b0 100755 --- a/dbcon/mysql/install_mcs_mysql.sh.in +++ b/dbcon/mysql/install_mcs_mysql.sh.in @@ -1,15 +1,9 @@ #!/bin/bash -# -# $Id$ -# -rpmmode=install pwprompt=" " for arg in "$@"; do - if [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then - rpmmode="`echo $arg | awk -F= '{print $2}'`" - elif [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then + if [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then tmpdir="`echo $arg | awk -F= '{print $2}'`" else echo "ignoring unknown argument: $arg" 1>&2 diff --git a/oam/install_scripts/columnstore-post-install.in b/oam/install_scripts/columnstore-post-install.in index f7deb07b6..bad8b7a63 100755 --- a/oam/install_scripts/columnstore-post-install.in +++ b/oam/install_scripts/columnstore-post-install.in @@ -5,13 +5,43 @@ # Post-install steps for columnstore install running_systemd() { - if [ "$(ps --no-headers -o comm 1)" == "systemd" ]; then + if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then echo 0 else echo 1 fi } +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 + exit 2; + fi + + rm -f ${tmpDir}/error.check + + #--------------------------------------------------------------------------- + # See if engine columnstore exist + #--------------------------------------------------------------------------- + echo "checking for engine columnstore..." + su -s /bin/sh -c 'mysql --execute="show engines"' mysql 2> ${tmpDir}/post-mysql-install.log | 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; +} + rpmmode=install user=`whoami 2>/dev/null` @@ -174,36 +204,48 @@ mkdir $lockdir >/dev/null 2>&1 rm -f $lockdir/columnstore -#check and get amazon env variables -aws=`which aws 2>/dev/null` -if [ -z "aws" ]; then - MCSgetCredentials.sh >/dev/null 2>&1 +# This was the last place of postConfigure. RIP + +/usr/sbin/install_mcs_mysql.sh --tmpdir=$tmpDir + +# Restart MDB to enable plugin +systemctl cat mariadb.service > /dev/null 2>&1 +if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then + systemctl restart mariadb.service > /dev/null 2>&1 +else + pkill mysqld > /dev/null 2>&1 + /usr/bin/mysqld_safe & fi -postConfigure +checkForError +if [ $? -ne 0 ]; then + echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" +fi systemctl cat mariadb-columnstore.service > /dev/null 2>&1 if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then - systemctl start mariadb-columnstore - - # Wait for all columnstore to be ready, DDLProc is final process in startup order - while [ -z "$(pgrep -x DDLProc)" ]; - do - sleep 1 - done + systemctl start mcs-loadbrm + systemctl start mcs-workernode + systemctl start mcs-controllernode + systemctl start mcs-primproc + systemctl start mcs-exemgr + systemctl start mcs-storagemanager + systemctl start mcs-writeengineserver + systemctl start mcs-ddlproc + systemctl start mcs-dmlproc + + dbbuilder 7 > $tmpDir/dbbuilder.log fi -dbbuilder 7 > $tmpDir/dbbuilder.log - if [ $stop_mysqld -eq 1 ];then # Make sure we stop mariadb since it wasn't running prior to columnstore installation systemctl cat mariadb.service > /dev/null 2>&1 if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then systemctl stop mariadb.service > /dev/null 2>&1 else - pkill mysqld + pkill mysqld > /dev/null 2>&1 fi - fi + sleep 2 exit 0 diff --git a/oam/install_scripts/columnstore-pre-uninstall.in b/oam/install_scripts/columnstore-pre-uninstall.in index ae6b88690..fbabbdb75 100755 --- a/oam/install_scripts/columnstore-pre-uninstall.in +++ b/oam/install_scripts/columnstore-pre-uninstall.in @@ -17,7 +17,7 @@ systemctl cat mariadb-columnstore.service > /dev/null 2>&1 if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then systemctl stop mariadb-columnstore >/dev/null 2>&1 else - PROGS='StorageManager workernode controllernode PrimProc ExeMgr DMLProc DDLProc WriteEngineServer' + PROGS='workernode controllernode PrimProc ExeMgr DMLProc DDLProc WriteEngineServer StorageManager' kill $(pidof $PROGS) > /dev/null sleep 3 kill -9 $(pidof $PROGS) > /dev/null @@ -118,6 +118,9 @@ rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave #remove OAMdbrootCheck file rm -f /var/lib/columnstore/data*/OAMdbrootCheck > /dev/null 2>&1 +rm -f /etc/rsyslog.d/49-columnstore.conf > /dev/null 2>&1 +rm -rf /tmp/columnstore_tmp_files > /dev/null 2>&1 + #tell user to run post configure script echo " " echo "Mariab Columnstore uninstall completed"