1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge pull request #73 from mariadb-corporation/MCOL-435

Mcol 435
This commit is contained in:
dhall-InfiniDB
2016-12-07 10:10:22 -06:00
committed by GitHub
12 changed files with 242 additions and 135 deletions

View File

@@ -56,11 +56,11 @@ if [ "x$has_um" = x ]; then
has_um=0 has_um=0
fi fi
user=$USER
sudo=sudo
if [ -z "$user" ]; then
user=root user=root
sudo=" " SUDO=" "
if [ $USER != "root" ]; then
user=$USER
SUDO="sudo "
fi fi
checkInstallSetup() { checkInstallSetup() {
@@ -68,7 +68,7 @@ checkInstallSetup() {
if [ $InitialInstallFlag != "y" ]; then if [ $InitialInstallFlag != "y" ]; then
echo "Please run the postConfigure install script, check the Installation Guide" echo "Please run the postConfigure install script, check the Installation Guide"
echo "for additional details" echo "for additional details"
sudo rm -f /var/lock/subsys/columnstore $SUDO rm -f /var/lock/subsys/columnstore
exit 1 exit 1
fi fi
} }
@@ -81,13 +81,13 @@ start() {
exit 0 exit 0
fi fi
(sudo mkdir -p /var/lock/subsys && touch /var/lock/subsys/columnstore) >/dev/null 2>&1 ($SUDO mkdir -p /var/lock/subsys && $SUDO chmod 777 /var/lock/subsys && $SUDO touch /var/lock/subsys/columnstore) >/dev/null 2>&1
if [ -x $InstallDir/bin/columnstore.pre-start ]; then if [ -x $InstallDir/bin/columnstore.pre-start ]; then
$InstallDir/bin/columnstore.pre-start $InstallDir/bin/columnstore.pre-start
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore" echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore"
sudo rm -f /var/lock/subsys/columnstore $SUDO rm -f /var/lock/subsys/columnstore
exit 1 exit 1
fi fi
fi fi
@@ -97,7 +97,7 @@ start() {
if [ $CoreFileFlag = "y" ]; then if [ $CoreFileFlag = "y" ]; then
SUDO= SUDO=
if [ "$user" != "root" ]; then if [ "$user" != "root" ]; then
SUDO="sudo" SUDO="$SUDO"
fi fi
#columnstore core files #columnstore core files
@@ -108,21 +108,21 @@ start() {
RETVAL=0 RETVAL=0
echo "Starting MariaDB Columnstore Database Platform" echo "Starting MariaDB Columnstore Database Platform"
sudo rm -f /tmp/StopColumnstore $SUDO rm -f /tmp/StopColumnstore
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 & exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
return $RETVAL return $RETVAL
} }
stop() { stop() {
echo "Shutting down MariaDB Columnstore Database Platform" echo "Shutting down MariaDB Columnstore Database Platform"
sudo touch /tmp/StopColumnstore $SUDO touch /tmp/StopColumnstore
sudo pkill ProcMon $SUDO pkill ProcMon
sudo pkill ProcMgr $SUDO pkill ProcMgr
sleep 1 sleep 1
$InstallDir/bin/clearShm $InstallDir/bin/clearShm
RETVAL=$? RETVAL=$?
sudo rm -f /var/lock/subsys/columnstore $SUDO rm -f /var/lock/subsys/columnstore
sudo fuser -k 8604/tcp > /dev/null 2>&1 $SUDO fuser -k 8604/tcp > /dev/null 2>&1
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1 $InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
if [ -x $InstallDir/bin/columnstore.post-stop ]; then if [ -x $InstallDir/bin/columnstore.post-stop ]; then

View File

@@ -7,11 +7,11 @@
prefix=/usr/local prefix=/usr/local
installdir=$prefix/mariadb/columnstore installdir=$prefix/mariadb/columnstore
rpmmode=install rpmmode=install
user=$USER
sudo=sudo
if [ -z "$user" ]; then
user=root user=root
sudo=" " SUDO=" "
if [ $USER != "root" ]; then
user=$USER
SUDO="sudo "
fi fi
quiet=0 quiet=0
@@ -82,7 +82,7 @@ if [ -f libstdc++.so.6.0.14 ]; then
fi fi
# softlink for libperl.sp, used by cplogger # softlink for libperl.sp, used by cplogger
sudo ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1 $SUDO ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1
#setup .bashrc #setup .bashrc
if [ $user = "root" ]; then if [ $user = "root" ]; then
@@ -121,9 +121,9 @@ fi
cd / cd /
test -d /var/log/mariadb || sudo mkdir /var/log/mariadb >/dev/null 2>&1 test -d /var/log/mariadb || $SUDO mkdir /var/log/mariadb >/dev/null 2>&1
test -d /var/log/mariadb/columnstore || sudo mkdir /var/log/mariadb/columnstore >/dev/null 2>&1 test -d /var/log/mariadb/columnstore || $SUDO mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
sudo chmod -R 777 /var/log/mariadb $SUDO chmod -R 777 /var/log/mariadb
test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1 test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1 test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
@@ -161,8 +161,8 @@ mkdir /mnt/tmp > /dev/null 2>&1
mkdir /var/log/mariadb/columnstore/data/archive > /dev/null 2>&1 mkdir /var/log/mariadb/columnstore/data/archive > /dev/null 2>&1
# install Columnstore Log Rotate File # install Columnstore Log Rotate File
sudo cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1 $SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
sudo chmod 644 /etc/logrotate.d/columnstore $SUDO chmod 644 /etc/logrotate.d/columnstore
# remove mysql archive log # remove mysql archive log
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
@@ -209,17 +209,17 @@ if [ $user = "root" ]; then
chmod 777 -R /dev/shm chmod 777 -R /dev/shm
rm -f /etc/default/columnstore rm -f /etc/default/columnstore
else else
sudo chmod 777 /tmp $SUDO chmod 777 /tmp
sudo rm -fr /tmp/* > /dev/null 2>&1 $SUDO rm -fr /tmp/* > /dev/null 2>&1
sudo $installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1 $SUDO $installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
sudo chown $user:$user $installdir/etc/Columnstore.xml $SUDO chown $user:$user $installdir/etc/Columnstore.xml
sudo chmod -R 777 /dev/shm $SUDO chmod -R 777 /dev/shm
sudo chmod 777 /var/lock/subsys $SUDO chmod 777 /var/lock/subsys
sudo rm -f /var/lock/subsys/mysql-Columnstore $SUDO rm -f /var/lock/subsys/mysql-Columnstore
sudo chmod 777 /etc/fstab $SUDO chmod 777 /etc/fstab
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstore.def sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstore.def
sudo cp $installdir/bin/columnstore.def /etc/default/columnstore $SUDO cp $installdir/bin/columnstore.def /etc/default/columnstore
sed -i -e s@prefix=/usr/local@prefix=$HOME@g $installdir/bin/* sed -i -e s@prefix=/usr/local@prefix=$HOME@g $installdir/bin/*

View File

@@ -78,12 +78,12 @@ for arg in "$@"; do
fi fi
done done
#run to make sure library paths are setup
sudo ldconfig
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
sudo ldconfig
export COLUMNSTORE_INSTALL_DIR=$installdir export COLUMNSTORE_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib/mysql export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib/mysql
else
ldconfig
fi fi
if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then

View File

@@ -7,12 +7,12 @@
prefix=/usr/local prefix=/usr/local
installdir=$prefix/mariadb/columnstore installdir=$prefix/mariadb/columnstore
rpmmode=install rpmmode=install
SUDO=" "
if [ $USER != "root" ]; then
user=$USER user=$USER
sudo=sudo SUDO="sudo "
if [ -z "$user" ]; then
user=root
sudo=" "
fi fi
quiet=0 quiet=0
for arg in "$@"; do for arg in "$@"; do
@@ -45,17 +45,17 @@ $installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
# uninstall OS scripts updated by postConfigure # uninstall OS scripts updated by postConfigure
if test -f /etc/exports.columnstoreSave ; then if test -f /etc/exports.columnstoreSave ; then
$sudo mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1 $SUDO mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
else else
$sudo rm -f /etc/exports > /dev/null 2>&1 $SUDO rm -f /etc/exports > /dev/null 2>&1
fi fi
if test -f /etc/rc.d/rc.local.columnstoreSave ; then if test -f /etc/rc.d/rc.local.columnstoreSave ; then
$sudo mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1 $SUDO mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1
fi fi
if test -f /etc/rc.local.columnstoreSave ; then if test -f /etc/rc.local.columnstoreSave ; then
$sudo mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1 $SUDO mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1
fi fi
export COLUMNSTORE_INSTALL_DIR=$installdir export COLUMNSTORE_INSTALL_DIR=$installdir
@@ -63,30 +63,30 @@ export COLUMNSTORE_INSTALL_DIR=$installdir
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud` cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
if test -f /etc/fstab ; then if test -f /etc/fstab ; then
$sudo sed -i '/Columnstore\/data/d' /etc/fstab > /dev/null 2>&1 $SUDO sed -i '/Columnstore\/data/d' /etc/fstab > /dev/null 2>&1
fi fi
fi fi
#remove log file directories #remove log file directories
#rm -rf /var/log/mariadb/columnstore > /dev/null 2>&1 #rm -rf /var/log/mariadb/columnstore > /dev/null 2>&1
#rm -f $installdir/mysql/db/*.err > /dev/null 2>&1 #rm -f $installdir/mysql/db/*.err > /dev/null 2>&1
sudo rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1 $SUDO rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
sudo rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1 $SUDO rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1 rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
sudo rm -f /etc/default/columnstore $SUDO rm -f /etc/default/columnstore
# remove Mariab Columnstore Log Rotate File abd Transaction Log File # remove Mariab Columnstore Log Rotate File abd Transaction Log File
sudo rm -f /etc/logrotate.d/columnstore > /dev/null 2>&1 $SUDO rm -f /etc/logrotate.d/columnstore > /dev/null 2>&1
sudo rm -f /etc/cron.d/transactionLog > /dev/null 2>&1 $SUDO rm -f /etc/cron.d/transactionLog > /dev/null 2>&1
# delete Mariab Columnstore shared memory segments # delete Mariab Columnstore shared memory segments
$installdir/bin/clearShm > /dev/null 2>&1 $installdir/bin/clearShm > /dev/null 2>&1
# delete prat files # delete prat files
sudo rm -f /etc/cron.d/ps > /dev/null 2>&1 $SUDO rm -f /etc/cron.d/ps > /dev/null 2>&1
sudo rm -f /etc/pscollect > /dev/null 2>&1 $SUDO rm -f /etc/pscollect > /dev/null 2>&1
sudo /etc/init.d/crond reload > /dev/null 2>&1 $SUDO /etc/init.d/crond reload > /dev/null 2>&1
sudo sudo systemctl reload crond.service > /dev/null 2>&1 $SUDO $SUDO systemctl reload crond.service > /dev/null 2>&1
# delete tmp files # delete tmp files
rm -f $installdir/local/*.columnstore rm -f $installdir/local/*.columnstore
@@ -95,7 +95,7 @@ rm -rf /tmp/bucketreuse
rm -f /tmp/columnstore.txt rm -f /tmp/columnstore.txt
rm -f /tmp/dbbuilder.* rm -f /tmp/dbbuilder.*
rm -f /tmp/dbrmfiles rm -f /tmp/dbrmfiles
sudo rm -f /var/lock/subsys/columnstore $SUDO rm -f /var/lock/subsys/columnstore
rm -f /tmp/pkgcheck rm -f /tmp/pkgcheck
rm -f /tmp/upgrade-status.log.* rm -f /tmp/upgrade-status.log.*
rm -f /tmp/mount.log rm -f /tmp/mount.log
@@ -118,7 +118,7 @@ if [ -x $installdir/bin/syslogSetup.sh ]; then
if [ $user = "root" ]; then if [ $user = "root" ]; then
$installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1 $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
else else
sudo $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1 $SUDO $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
fi fi
fi fi
@@ -158,14 +158,14 @@ fi
if [ $user = "root" ]; then if [ $user = "root" ]; then
rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1 rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
else else
sudo rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1 $SUDO rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
fi fi
#remove library paths #remove library paths
if [ $installdir == "/usr/local/mariadb/columnstore" ]; then if [ $installdir == "/usr/local/mariadb/columnstore" ]; then
# remove library config file # remove library config file
sudo rm -f /etc/ld.so.conf.d/columnstore.conf $SUDO rm -f /etc/ld.so.conf.d/columnstore.conf
sudo ldconfig $SUDO ldconfig
fi fi
#cleanup .bashrc #cleanup .bashrc

View File

@@ -13,10 +13,10 @@ syslog_conf=nofile
rsyslog7=0 rsyslog7=0
user=$USER user=$USER
sudo=sudo SUDO=sudo
if [ -z "$user" ]; then if [ -z "$user" ]; then
user=root user=root
sudo=" " SUDO=" "
fi fi
@@ -70,13 +70,13 @@ if [ "$daemon" = "nodaemon" ]; then
if [ -f /etc/syslog.conf ]; then if [ -f /etc/syslog.conf ]; then
daemon="syslog" daemon="syslog"
sudo /etc/init.d/syslog start > /dev/null 2>&1 $SUDO /etc/init.d/syslog start > /dev/null 2>&1
elif [ -f /etc/rsyslog.conf ]; then elif [ -f /etc/rsyslog.conf ]; then
daemon="rsyslog" daemon="rsyslog"
sudo /etc/init.d/rsyslog start > /dev/null 2>&1 $SUDO /etc/init.d/rsyslog start > /dev/null 2>&1
elif [ -f /etc/init.d/syslog-ng ]; then elif [ -f /etc/init.d/syslog-ng ]; then
daemon="syslog-ng" daemon="syslog-ng"
sudo /etc/init.d/syslog-ng start > /dev/null 2>&1 $SUDO /etc/init.d/syslog-ng start > /dev/null 2>&1
fi fi
fi fi
@@ -100,7 +100,7 @@ if [ "$daemon" = "syslog-ng" ]; then
fi fi
elif [ "$daemon" = "rsyslog" ]; then elif [ "$daemon" = "rsyslog" ]; then
#check if rsyslog version 7 or greater #check if rsyslog version 7 or greater
sudo rsyslogd -v > /tmp/rsyslog.ver $SUDO rsyslogd -v > /tmp/rsyslog.ver
cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l` cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l`
if [ $cnt -gt 0 ]; then if [ $cnt -gt 0 ]; then
rsyslog7=1 rsyslog7=1
@@ -157,28 +157,28 @@ checkSyslog
if [ ! -z "$syslog_conf" ] ; then if [ ! -z "$syslog_conf" ] ; then
$installdir/bin/setConfig -d Installation SystemLogConfigFile ${syslog_conf} >/dev/null 2>&1 $installdir/bin/setConfig -d Installation SystemLogConfigFile ${syslog_conf} >/dev/null 2>&1
if [ "$syslog_conf" != /etc/rsyslog.d/columnstore.conf ]; then if [ "$syslog_conf" != /etc/rsyslog.d/columnstore.conf ]; then
sudo rm -f ${syslog_conf}.columnstoreSave $SUDO rm -f ${syslog_conf}.columnstoreSave
sudo cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1 $SUDO cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
sudo sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1 $SUDO sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1
fi fi
egrep -qs 'MariaDB Columnstore Database Platform Logging' ${syslog_conf} egrep -qs 'MariaDB Columnstore Database Platform Logging' ${syslog_conf}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
#set the syslog for ColumnStore logging #set the syslog for ColumnStore logging
# remove older version incase it was installed by previous build # remove older version incase it was installed by previous build
sudo rm -rf /etc/rsyslog.d/columnstore.conf $SUDO rm -rf /etc/rsyslog.d/columnstore.conf
if [ $rsyslog7 == 1 ]; then if [ $rsyslog7 == 1 ]; then
sudo rm -f /etc/rsyslog.d/49-columnstore.conf $SUDO rm -f /etc/rsyslog.d/49-columnstore.conf
sudo cp ${columnstoreSyslogFile7} ${syslog_conf} $SUDO cp ${columnstoreSyslogFile7} ${syslog_conf}
sudo chown syslog:adm /var/log/mariadb/columnstore >/dev/null 2>&1 $SUDO chown syslog:adm /var/log/mariadb/columnstore >/dev/null 2>&1
else else
sudo cp ${columnstoreSyslogFile} ${syslog_conf} $SUDO cp ${columnstoreSyslogFile} ${syslog_conf}
fi fi
fi fi
sudo etc/init.d/rsyslog restart > /dev/null 2>&1 $SUDO etc/init.d/rsyslog restart > /dev/null 2>&1
sudo /etc/init.d/syslog restart > /dev/null 2>&1 $SUDO /etc/init.d/syslog restart > /dev/null 2>&1
sudo /etc/init.d/syslog-ng restart > /dev/null 2>&1 $SUDO /etc/init.d/syslog-ng restart > /dev/null 2>&1
systemctl restart rsyslog.service > /dev/null 2>&1 systemctl restart rsyslog.service > /dev/null 2>&1
systemctl restart syslog.service > /dev/null 2>&1 systemctl restart syslog.service > /dev/null 2>&1
@@ -197,24 +197,24 @@ if [ ! -z "$syslog_conf" ] ; then
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if [ -f ${syslog_conf}.columnstoreSave ] ; then if [ -f ${syslog_conf}.columnstoreSave ] ; then
#uninstall the syslog for ColumnStore logging #uninstall the syslog for ColumnStore logging
sudo v -f ${syslog_conf} ${syslog_conf}.ColumnStoreBackup $SUDO v -f ${syslog_conf} ${syslog_conf}.ColumnStoreBackup
sudo mv -f ${syslog_conf}.columnstoreSave ${syslog_conf} >/dev/null 2>&1 $SUDO mv -f ${syslog_conf}.columnstoreSave ${syslog_conf} >/dev/null 2>&1
if [ ! -f ${syslog_conf} ] ; then if [ ! -f ${syslog_conf} ] ; then
sudo cp ${syslog_conf}.ColumnStoreBackup ${syslog_conf} $SUDO cp ${syslog_conf}.ColumnStoreBackup ${syslog_conf}
fi fi
fi fi
fi fi
sudo sed -i '/# MariaDB/,$d' ${syslog_conf} > /dev/null 2>&1 $SUDO sed -i '/# MariaDB/,$d' ${syslog_conf} > /dev/null 2>&1
else else
sudo rm -f "$syslog_conf" $SUDO rm -f "$syslog_conf"
fi fi
else else
sudo rm -f "$syslog_conf" $SUDO rm -f "$syslog_conf"
fi fi
sudo etc/init.d/rsyslog restart > /dev/null 2>&1 $SUDO etc/init.d/rsyslog restart > /dev/null 2>&1
sudo /etc/init.d/syslog restart > /dev/null 2>&1 $SUDO /etc/init.d/syslog restart > /dev/null 2>&1
sudo /etc/init.d/syslog-ng restart > /dev/null 2>&1 $SUDO /etc/init.d/syslog-ng restart > /dev/null 2>&1
systemctl restart rsyslog.service > /dev/null 2>&1 systemctl restart rsyslog.service > /dev/null 2>&1
systemctl restart syslog.service > /dev/null 2>&1 systemctl restart syslog.service > /dev/null 2>&1

View File

@@ -9271,7 +9271,7 @@ namespace oam
catch(...) catch(...)
{ {
processor.shutdown(); processor.shutdown();
throw std::runtime_error("error"); throw std::runtime_error("write error");
} }
@@ -9282,7 +9282,7 @@ namespace oam
catch(...) catch(...)
{ {
processor.shutdown(); processor.shutdown();
throw std::runtime_error("error"); throw std::runtime_error("read error");
} }
ByteStream::byte returnRequestType; ByteStream::byte returnRequestType;
@@ -9649,6 +9649,8 @@ namespace oam
return true; return true;
} }
} }
writeLog("checkSystemRunning - system reported down", LOG_TYPE_DEBUG );
return false; return false;
} }
} //namespace oam } //namespace oam

View File

@@ -518,7 +518,8 @@ namespace oam
ENABLEMYSQLREP, ENABLEMYSQLREP,
DISABLEMYSQLREP, DISABLEMYSQLREP,
GLUSTERASSIGN, GLUSTERASSIGN,
GLUSTERUNASSIGN GLUSTERUNASSIGN,
PROCESSALARM
}; };
/** @brief Process Management - Mgr to Mon request options /** @brief Process Management - Mgr to Mon request options

View File

@@ -2339,7 +2339,7 @@ int processCommand(string* arguments)
else else
{ {
cout << endl << "**** shutdownSystem Failure : " << e.what() << endl; cout << endl << "**** shutdownSystem Failure : " << e.what() << endl;
cout << "Retry using FORCEFUL option" << endl << endl; cout << " Retry running command using FORCEFUL option" << endl << endl;
} }
//hdfs / hadoop config //hdfs / hadoop config

View File

@@ -209,7 +209,6 @@ int main(int argc, char *argv[])
noPrompting = false; noPrompting = false;
string password; string password;
string cmd; string cmd;
bool disableAmazon = false;
// struct sysinfo myinfo; // struct sysinfo myinfo;
// hidden options // hidden options
@@ -277,7 +276,7 @@ int main(int argc, char *argv[])
cout << " Enter one of the options within [], if available, or" << endl; cout << " Enter one of the options within [], if available, or" << endl;
cout << " Enter a new value" << endl << endl; cout << " Enter a new value" << endl << endl;
cout << endl; cout << endl;
cout << "Usage: postConfigure [-h][-c][-u][-p][-mp][-s][-port][-i][-da]" << endl; cout << "Usage: postConfigure [-h][-c][-u][-p][-mp][-s][-port][-i]" << endl;
cout << " -h Help" << endl; cout << " -h Help" << endl;
cout << " -c Config File to use to extract configuration data, default is Columnstore.xml.rpmsave" << endl; cout << " -c Config File to use to extract configuration data, default is Columnstore.xml.rpmsave" << endl;
cout << " -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave" << endl; cout << " -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave" << endl;
@@ -287,7 +286,6 @@ int main(int argc, char *argv[])
cout << " -s Single Threaded Remote Install" << endl; cout << " -s Single Threaded Remote Install" << endl;
cout << " -port MariaDB Columnstore Port Address" << endl; cout << " -port MariaDB Columnstore Port Address" << endl;
cout << " -i Non-root Install directory, Only use for non-root installs" << endl; cout << " -i Non-root Install directory, Only use for non-root installs" << endl;
cout << " -da Disable Amazon functionality, install using Stardard Hostnames and IP Addresses" << endl;
exit (0); exit (0);
} }
else if( string("-s") == argv[i] ) else if( string("-s") == argv[i] )
@@ -352,8 +350,6 @@ int main(int argc, char *argv[])
exit (1); exit (1);
} }
} }
else if( string("-da") == argv[i] )
disableAmazon = true;
else if( string("-i") == argv[i] ) { else if( string("-i") == argv[i] ) {
i++; i++;
if (i >= argc ) { if (i >= argc ) {
@@ -365,7 +361,7 @@ int main(int argc, char *argv[])
else else
{ {
cout << " ERROR: Invalid Argument = " << argv[i] << endl; cout << " ERROR: Invalid Argument = " << argv[i] << endl;
cout << " Usage: postConfigure [-h][-c][-u][-p][-mp][-s][-port][-i][-da]" << endl; cout << " Usage: postConfigure [-h][-c][-u][-p][-mp][-s][-port][-i]" << endl;
exit (1); exit (1);
} }
} }
@@ -817,8 +813,6 @@ int main(int argc, char *argv[])
bool amazonInstall = false; bool amazonInstall = false;
string amazonSubNet = oam::UnassignedName; string amazonSubNet = oam::UnassignedName;
string cloud = oam::UnassignedName; string cloud = oam::UnassignedName;
if (!disableAmazon)
{
system("ec2-version > /tmp/amazon.log 2>&1"); system("ec2-version > /tmp/amazon.log 2>&1");
ifstream in("/tmp/amazon.log"); ifstream in("/tmp/amazon.log");
@@ -829,14 +823,13 @@ int main(int argc, char *argv[])
// not running on amazon with ec2-api-tools // not running on amazon with ec2-api-tools
amazonInstall = false; amazonInstall = false;
else else
{
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed")) if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed"))
amazonInstall = false; amazonInstall = false;
else else
amazonInstall = true; amazonInstall = true;
} }
if ( amazonInstall )
{
try { try {
cloud = sysConfig->getConfig(InstallSection, "Cloud"); cloud = sysConfig->getConfig(InstallSection, "Cloud");
} }
@@ -845,7 +838,55 @@ int main(int argc, char *argv[])
cloud = oam::UnassignedName; cloud = oam::UnassignedName;
} }
cout << endl << "Amazon EC2 Install, these files will need to be installed on the local instance:" << endl << endl; if ( cloud == "disable" )
amazonInstall = false;
if ( amazonInstall )
{
if ( cloud == oam::UnassignedName )
{
while(true) {
string enable = "y";
prompt = "Amazon AMI Tools installed, do you want to have ColumnStore utilize them [y,n] (y) > ";
pcommand = callReadline(prompt.c_str());
if (pcommand) {
if (strlen(pcommand) > 0) enable = pcommand;
callFree(pcommand);
if (enable == "n") {
amazonInstall = false;
try {
sysConfig->setConfig(InstallSection, "Cloud", "disable");
}
catch(...)
{};
break;
}
}
if ( enable != "y" )
{
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
if ( noPrompting )
exit(1);
}
break;
}
}
if ( amazonInstall )
{
try {
AmazonAccessKey = sysConfig->getConfig(InstallSection, "AmazonAccessKey");
AmazonSecretKey = sysConfig->getConfig(InstallSection, "AmazonSecretKey");
}
catch(...)
{}
cout << endl << "Amazon API Tools usage, these files will need to be installed on the local instance:" << endl << endl;
cout << " 1. File containing the Amazon Access Key" << endl; cout << " 1. File containing the Amazon Access Key" << endl;
cout << " 2. File containing the Amazon Secret Key" << endl << endl; cout << " 2. File containing the Amazon Secret Key" << endl << endl;
@@ -1003,6 +1044,8 @@ int main(int argc, char *argv[])
{} {}
} }
}
if ( pmwithum ) if ( pmwithum )
cout << endl << "NOTE: Local Query Feature is enabled" << endl; cout << endl << "NOTE: Local Query Feature is enabled" << endl;
@@ -2757,6 +2800,8 @@ int main(int argc, char *argv[])
//Write out Updated System Configuration File //Write out Updated System Configuration File
string EEPackageType; string EEPackageType;
if ( rootUser )
{
try { try {
EEPackageType = sysConfig->getConfig(InstallSection, "EEPackageType"); EEPackageType = sysConfig->getConfig(InstallSection, "EEPackageType");
} }
@@ -2765,6 +2810,9 @@ int main(int argc, char *argv[])
cout << "ERROR: Problem getting EEPackageType from the MariaDB Columnstore System Configuration file" << endl; cout << "ERROR: Problem getting EEPackageType from the MariaDB Columnstore System Configuration file" << endl;
exit(1); exit(1);
} }
}
else //nonroot, default to binary
EEPackageType = "binary";
while(true) { while(true) {
prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > "; prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > ";

View File

@@ -2628,7 +2628,44 @@ void processMSG(messageqcpp::IOSocket* cfIos)
break; break;
} }
/*
case PROCESSALARM:
{
log.writeLog(__LINE__, "MSG RECEIVED: Process Alarm Message");
ByteStream::byte alarmID;
std::string componentID;
ByteStream::byte state;
std::string ModuleName;
std::string processName;
ByteStream::byte pid;
ByteStream::byte tid;
msg >> alarmID;
msg >> componentID;
msg >> state;
msg >> ModuleName;
msg >> processName;
msg >> pid;
msg >> tid;
Alarm calAlarm;
calAlarm.setAlarmID (alarmID);
calAlarm.setComponentID (componentID);
calAlarm.setState (state);
calAlarm.setSname (ModuleName);
calAlarm.setPname (processName);
calAlarm.setPid (pid);
calAlarm.setTid (tid);
ALARMManager aManager;
aManager.processAlarmReport(calAlarm);
break;
}
*/
default: default:
log.writeLog(__LINE__, "MSG RECEIVED: Invalid type" ); log.writeLog(__LINE__, "MSG RECEIVED: Invalid type" );
break; break;
@@ -2801,6 +2838,18 @@ void processMSG(messageqcpp::IOSocket* cfIos)
processManager.restartProcessType("DDLProc"); processManager.restartProcessType("DDLProc");
processManager.restartProcessType("DMLProc"); processManager.restartProcessType("DMLProc");
sleep(1); sleep(1);
string DMLmodule = config.OAMParentName();
if ( config.ServerInstallType() != oam::INSTALL_COMBINE_DM_UM_PM ) {
string PrimaryUMModuleName;
try {
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
}
catch(...) {}
if ( !PrimaryUMModuleName.empty() )
DMLmodule = PrimaryUMModuleName;
}
// Wait for DMLProc to be ACTIVE // Wait for DMLProc to be ACTIVE
BRM::DBRM dbrm; BRM::DBRM dbrm;
state = AUTO_OFFLINE; state = AUTO_OFFLINE;
@@ -2810,7 +2859,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|| state == oam::AUTO_INIT || state == oam::AUTO_INIT
|| state == oam::ROLLBACK_INIT) || state == oam::ROLLBACK_INIT)
{ {
oam.getProcessStatus("DMLProc", config.OAMParentName(), procstat); oam.getProcessStatus("DMLProc", DMLmodule, procstat);
state = procstat.ProcessOpState; state = procstat.ProcessOpState;
if ( procstat.ProcessOpState == oam::ACTIVE) if ( procstat.ProcessOpState == oam::ACTIVE)
break; break;

View File

@@ -138,7 +138,9 @@ int main(int argc, char **argv)
if ( cloud == "amazon-ec2" ) { if ( cloud == "amazon-ec2" ) {
if(!aMonitor.amazonIPCheck()) { if(!aMonitor.amazonIPCheck()) {
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1"; log.writeLog(__LINE__, "ERROR: amazonIPCheck failed, exiting", LOG_TYPE_CRITICAL);
sleep(2);
string cmd = startup::StartUp::installDir() + "/bin/columnstore stop > /dev/null 2>&1";
system(cmd.c_str()); system(cmd.c_str());
exit(1); exit(1);
} }
@@ -377,7 +379,7 @@ int main(int argc, char **argv)
if ( config.OAMParentName() == oam::UnassignedName ) { if ( config.OAMParentName() == oam::UnassignedName ) {
cerr << endl << "OAMParentModuleName == oam::UnassignedName, exiting " << endl; cerr << endl << "OAMParentModuleName == oam::UnassignedName, exiting " << endl;
log.writeLog(__LINE__, "OAMParentModuleName == oam::UnassignedName, exiting", LOG_TYPE_CRITICAL); log.writeLog(__LINE__, "OAMParentModuleName == oam::UnassignedName, exiting", LOG_TYPE_CRITICAL);
exit (-1); exit (1);
} }
//check if module is in a DISABLED state //check if module is in a DISABLED state
@@ -562,8 +564,8 @@ int main(int argc, char **argv)
} }
catch(...) catch(...)
{ {
log.writeLog(__LINE__, "Problem getting the ParentOAMModuleName key from the Calpont System Configuration file", LOG_TYPE_ERROR); log.writeLog(__LINE__, "Problem getting the ParentOAMModuleName key from the Columnstore System Configuration file", LOG_TYPE_CRITICAL);
exit(-1); exit(1);
} }
} }
@@ -1673,7 +1675,7 @@ static void statusControlThread()
fProcStatMapreg.swap(region); fProcStatMapreg.swap(region);
fShmProcessStatus = static_cast<shmProcessStatus*>(fProcStatMapreg.get_address()); fShmProcessStatus = static_cast<shmProcessStatus*>(fProcStatMapreg.get_address());
if (fShmProcessStatus == 0) { if (fShmProcessStatus == 0) {
log.writeLog(__LINE__, "*****ProcessStatusTable shmat failed.", LOG_TYPE_ERROR); log.writeLog(__LINE__, "*****ProcessStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1); exit(1);
} }
@@ -1735,7 +1737,7 @@ static void statusControlThread()
fSysStatMapreg.swap(region2); fSysStatMapreg.swap(region2);
fShmSystemStatus = static_cast<shmDeviceStatus*>(fSysStatMapreg.get_address()); fShmSystemStatus = static_cast<shmDeviceStatus*>(fSysStatMapreg.get_address());
if (fShmSystemStatus == 0) { if (fShmSystemStatus == 0) {
log.writeLog(__LINE__, "*****SystemStatusTable shmat failed.", LOG_TYPE_ERROR); log.writeLog(__LINE__, "*****SystemStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1); exit(1);
} }
@@ -1839,7 +1841,7 @@ static void statusControlThread()
fShmNICStatus = static_cast<shmDeviceStatus*>(fNICStatMapreg.get_address()); fShmNICStatus = static_cast<shmDeviceStatus*>(fNICStatMapreg.get_address());
if (fShmNICStatus == 0) { if (fShmNICStatus == 0) {
log.writeLog(__LINE__, "*****NICStatusTable shmat failed.", LOG_TYPE_ERROR); log.writeLog(__LINE__, "*****NICStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1); exit(1);
} }
@@ -1925,7 +1927,7 @@ static void statusControlThread()
fShmExtDeviceStatus = static_cast<shmDeviceStatus*>(fExtStatMapreg.get_address()); fShmExtDeviceStatus = static_cast<shmDeviceStatus*>(fExtStatMapreg.get_address());
if (fShmExtDeviceStatus == 0) { if (fShmExtDeviceStatus == 0) {
log.writeLog(__LINE__, "*****ExtDeviceStatusTable shmat failed.", LOG_TYPE_ERROR); log.writeLog(__LINE__, "*****ExtDeviceStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1); exit(1);
} }
@@ -2003,7 +2005,7 @@ static void statusControlThread()
fShmDbrootStatus = static_cast<shmDeviceStatus*>(fdDbrootStatMapreg.get_address()); fShmDbrootStatus = static_cast<shmDeviceStatus*>(fdDbrootStatMapreg.get_address());
if (fShmDbrootStatus == 0) { if (fShmDbrootStatus == 0) {
log.writeLog(__LINE__, "*****DbrootStatusTable shmat failed.", LOG_TYPE_ERROR); log.writeLog(__LINE__, "*****DbrootStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1); exit(1);
} }

View File

@@ -2597,7 +2597,7 @@ pid_t ProcessMonitor::startProcess(string processModuleType, string processName,
//Update Process Status: Mark Process INIT state //Update Process Status: Mark Process INIT state
updateProcessInfo(processName, FAILED, newProcessID); updateProcessInfo(processName, FAILED, newProcessID);
exit(oam::API_FAILURE); return (oam::API_FAILURE);
} }
return newProcessID; return newProcessID;
@@ -2812,6 +2812,11 @@ void sendProcessThread(sendProcessInfo_t* t)
try { try {
oam.setProcessStatus(processName, config.moduleName(), state, PID); oam.setProcessStatus(processName, config.moduleName(), state, PID);
} }
catch (exception& ex)
{
string error = ex.what();
log.writeLog(__LINE__, "EXCEPTION ERROR on setProcessStatus: " + error, LOG_TYPE_ERROR);
}
catch(...) catch(...)
{ {
log.writeLog(__LINE__, "EXCEPTION ERROR on setProcessStatus: Caught unknown exception!", LOG_TYPE_ERROR ); log.writeLog(__LINE__, "EXCEPTION ERROR on setProcessStatus: Caught unknown exception!", LOG_TYPE_ERROR );