You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-520
This commit is contained in:
@ -58,6 +58,9 @@ fi
|
|||||||
|
|
||||||
lockdir=`$InstallDir/bin/getConfig Installation LockFileDirectory`
|
lockdir=`$InstallDir/bin/getConfig Installation LockFileDirectory`
|
||||||
|
|
||||||
|
#get temp directory
|
||||||
|
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
checkInstallSetup() {
|
checkInstallSetup() {
|
||||||
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation InitialInstallFlag`
|
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation InitialInstallFlag`
|
||||||
if [ $InitialInstallFlag != "y" ]; then
|
if [ $InitialInstallFlag != "y" ]; then
|
||||||
@ -99,14 +102,14 @@ start() {
|
|||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
echo "Starting MariaDB Columnstore Database Platform"
|
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 &
|
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"
|
||||||
touch /tmp/StopColumnstore
|
touch ${tmpDir}/StopColumnstore
|
||||||
pkill ProcMon
|
pkill ProcMon
|
||||||
pkill ProcMgr
|
pkill ProcMgr
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@ -8,20 +8,20 @@
|
|||||||
|
|
||||||
# check log for error
|
# check log for error
|
||||||
checkForError() {
|
checkForError() {
|
||||||
grep "ERROR 1045" /tmp/mariadb-command-line.log > /tmp/error.check
|
grep "ERROR 1045" ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||||
echo "ERROR - PASSWORD: check log file: /tmp/mariadb-command-line.log"
|
echo "ERROR - PASSWORD: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||||
rm -f /tmp/error.check
|
rm -f ${tmpdir}/error.check
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep ERROR /tmp/mariadb-command-line.log > /tmp/error.check
|
grep ERROR ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||||
echo "ERROR: check log file: /tmp/mariadb-command-line.log"
|
echo "ERROR: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||||
rm -f /tmp/error.check
|
rm -f ${tmpdir}/error.check
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/error.check
|
rm -f ${tmpdir}/error.check
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
@ -37,27 +37,29 @@ for arg in "$@"; do
|
|||||||
prefix=`dirname $installdir`
|
prefix=`dirname $installdir`
|
||||||
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
||||||
port="`echo $arg | awk -F= '{print $2}'`"
|
port="`echo $arg | awk -F= '{print $2}'`"
|
||||||
|
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||||
|
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
test -f $installdir/post/functions && . $installdir/post/functions
|
test -f $installdir/post/functions && . $installdir/post/functions
|
||||||
|
|
||||||
|
|
||||||
>/tmp/mariadb-command-line.log
|
>${tmpdir}/mariadb-command-line.log
|
||||||
|
|
||||||
#
|
#
|
||||||
# Run command
|
# Run command
|
||||||
#
|
#
|
||||||
echo "Run command" >>/tmp/mariadb-command-line.log
|
echo "Run command" >>${tmpdir}/mariadb-command-line.log
|
||||||
cat >/tmp/mariadb-command-line.sql <<EOD
|
cat >${tmpdir}/mariadb-command-line.sql <<EOD
|
||||||
$command;
|
$command;
|
||||||
EOD
|
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 \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||||
--user=root \
|
--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
|
checkForError
|
||||||
|
|
||||||
|
@ -55,6 +55,9 @@ fi
|
|||||||
PMwithUM=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMwithUM`
|
PMwithUM=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMwithUM`
|
||||||
ServerTypeInstall=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
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`
|
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
|
||||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||||
echo "Amazon setup on Module"
|
echo "Amazon setup on Module"
|
||||||
@ -121,40 +124,40 @@ MySQLRep=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLRep`
|
|||||||
if [ $MySQLRep = "y" ]; then
|
if [ $MySQLRep = "y" ]; then
|
||||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||||
echo "Run Upgrade on my.cnf on Module"
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||||
mysqlPort=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLPort`
|
mysqlPort=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLPort`
|
||||||
echo "Run Mysql Port update on my.cnf on Module"
|
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
|
fi
|
||||||
|
|
||||||
# if um, run mysql install scripts
|
# if um, run mysql install scripts
|
||||||
if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $ServerTypeInstall = "2" ]; then
|
if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $ServerTypeInstall = "2" ]; then
|
||||||
echo "Run post-mysqld-install"
|
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
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Run post-mysql-install"
|
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
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $user == "root" ]; then
|
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
|
if [ $? -ne 0 ]; then
|
||||||
# try setup again
|
# 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
|
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
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -16,9 +16,9 @@ set PASSWORD [lindex $argv 1]
|
|||||||
set COMMAND [lindex $argv 2]
|
set COMMAND [lindex $argv 2]
|
||||||
set DEBUG [lindex $argv 3]
|
set DEBUG [lindex $argv 3]
|
||||||
|
|
||||||
exec whoami >/tmp/whoami.tmp
|
exec whoami >whoami.tmp
|
||||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
set USERNAME [exec cat whoami.tmp]
|
||||||
exec rm -f /tmp/whoami.tmp
|
exec rm -f whoami.tmp
|
||||||
|
|
||||||
set UNM [lindex $argv 4]
|
set UNM [lindex $argv 4]
|
||||||
if { $UNM != "" && $UNM != "-" } {
|
if { $UNM != "" && $UNM != "-" } {
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
# Argument 2 - Remote Server root password
|
# Argument 2 - Remote Server root password
|
||||||
# Argument 3 - Command
|
# Argument 3 - Command
|
||||||
set timeout 10
|
set timeout 10
|
||||||
exec whoami >/tmp/whoami.tmp
|
exec whoami > whoami.tmp
|
||||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
set USERNAME [exec cat whoami.tmp]
|
||||||
exec rm -f /tmp/whoami.tmp
|
exec rm -f whoami.tmp
|
||||||
set SERVER [lindex $argv 0]
|
set SERVER [lindex $argv 0]
|
||||||
set PASSWORD [lindex $argv 1]
|
set PASSWORD [lindex $argv 1]
|
||||||
set FILE [lindex $argv 2]
|
set FILE [lindex $argv 2]
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
# Argument 2 - Remote Server root password
|
# Argument 2 - Remote Server root password
|
||||||
# Argument 3 - Command
|
# Argument 3 - Command
|
||||||
set timeout 30
|
set timeout 30
|
||||||
exec whoami >/tmp/whoami.tmp
|
exec whoami >whoami.tmp
|
||||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
set USERNAME [exec cat whoami.tmp]
|
||||||
exec rm -f /tmp/whoami.tmp
|
exec rm -f whoami.tmp
|
||||||
set SERVER [lindex $argv 0]
|
set SERVER [lindex $argv 0]
|
||||||
set PASSWORD [lindex $argv 1]
|
set PASSWORD [lindex $argv 1]
|
||||||
set FILE [lindex $argv 2]
|
set FILE [lindex $argv 2]
|
||||||
|
@ -45,9 +45,12 @@ if [ $vflg -gt 0 ]; then
|
|||||||
echo "starting $exename $args with sleep=$sopt and tries=$topt"
|
echo "starting $exename $args with sleep=$sopt and tries=$topt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#get temp directory
|
||||||
|
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
while [ $keep_going -ne 0 ]; do
|
while [ $keep_going -ne 0 ]; do
|
||||||
$exename $args
|
$exename $args
|
||||||
if [ -e /tmp/StopColumnstore ]; then
|
if [ -e ${tmpDir}/StopColumnstore ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ $topt -gt 0 -a $retries -ge $topt ]; then
|
if [ $topt -gt 0 -a $retries -ge $topt ]; then
|
||||||
|
@ -47,6 +47,9 @@ fi
|
|||||||
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog
|
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog
|
||||||
columnstoreSyslogFile7=$installdir/bin/columnstoreSyslog7
|
columnstoreSyslogFile7=$installdir/bin/columnstoreSyslog7
|
||||||
|
|
||||||
|
#get temp directory
|
||||||
|
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
checkSyslog() {
|
checkSyslog() {
|
||||||
#check which syslog daemon is being used
|
#check which syslog daemon is being used
|
||||||
#first check which is running
|
#first check which is running
|
||||||
@ -101,16 +104,16 @@ 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
|
||||||
rsyslogd -v > /tmp/rsyslog.ver
|
rsyslogd -v > ${tmpDir}/rsyslog.ver
|
||||||
cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l`
|
cnt=`grep "rsyslogd 7" ${tmpDir}/rsyslog.ver | wc -l`
|
||||||
if [ $cnt -gt 0 ]; then
|
if [ $cnt -gt 0 ]; then
|
||||||
rsyslog7=1
|
rsyslog7=1
|
||||||
fi
|
fi
|
||||||
cnt=`grep "rsyslogd 8" /tmp/rsyslog.ver | wc -l`
|
cnt=`grep "rsyslogd 8" ${tmpDir}/rsyslog.ver | wc -l`
|
||||||
if [ $cnt -gt 0 ]; then
|
if [ $cnt -gt 0 ]; then
|
||||||
rsyslog7=1
|
rsyslog7=1
|
||||||
fi
|
fi
|
||||||
cnt=`grep "rsyslogd 9" /tmp/rsyslog.ver | wc -l`
|
cnt=`grep "rsyslogd 9" ${tmpDir}/rsyslog.ver | wc -l`
|
||||||
if [ $cnt -gt 0 ]; then
|
if [ $cnt -gt 0 ]; then
|
||||||
rsyslog7=1
|
rsyslog7=1
|
||||||
fi
|
fi
|
||||||
|
@ -621,15 +621,17 @@ void ALARMManager::getActiveAlarm(AlarmList& alarmList) const
|
|||||||
*****************************************************************************************/
|
*****************************************************************************************/
|
||||||
void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||||
{
|
{
|
||||||
string alarmFile = "/tmp/alarms";
|
|
||||||
|
string alarmFile = startup::StartUp::tmpDir() + "/alarms";
|
||||||
|
|
||||||
//make 1 alarm log file made up of archive and current alarm.log
|
//make 1 alarm log file made up of archive and current alarm.log
|
||||||
(void)system("touch /tmp/alarms");
|
string cmd = "touch " + alarmFile;
|
||||||
|
|
||||||
string cmd = ("ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > /tmp/alarmlogfiles");
|
|
||||||
(void)system(cmd.c_str());
|
(void)system(cmd.c_str());
|
||||||
|
|
||||||
string fileName = "/tmp/alarmlogfiles";
|
cmd = "ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > " + alarmFile;
|
||||||
|
(void)system(cmd.c_str());
|
||||||
|
|
||||||
|
string fileName = startup::StartUp::tmpDir() + "/alarmlogfiles";
|
||||||
|
|
||||||
ifstream oldFile (fileName.c_str());
|
ifstream oldFile (fileName.c_str());
|
||||||
|
|
||||||
@ -641,7 +643,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
|||||||
while (oldFile.getline(line, 200))
|
while (oldFile.getline(line, 200))
|
||||||
{
|
{
|
||||||
buf = line;
|
buf = line;
|
||||||
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> /tmp/alarms";
|
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> " + alarmFile;
|
||||||
(void)system(cmd.c_str());
|
(void)system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,7 +651,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
|||||||
unlink (fileName.c_str());
|
unlink (fileName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = "cat " + ALARM_FILE + " >> /tmp/alarms";
|
cmd = "cat " + ALARM_FILE + " >> " + alarmFile;
|
||||||
(void)system(cmd.c_str());
|
(void)system(cmd.c_str());
|
||||||
|
|
||||||
int fd = open(alarmFile.c_str(), O_RDONLY);
|
int fd = open(alarmFile.c_str(), O_RDONLY);
|
||||||
|
@ -14,7 +14,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_bulklogReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/${MODULE}_bulklogReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -27,6 +30,6 @@ if test -d $INSTALLDIR/data/bulk ; then
|
|||||||
egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err 2>/dev/null
|
egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
} > /tmp/${MODULE}_bulklogReport.txt
|
} > ${tmpDir}/${MODULE}_bulklogReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -57,6 +57,7 @@ ChildModule childmodule;
|
|||||||
string rootPassword = "";
|
string rootPassword = "";
|
||||||
string debug_flag = "0";
|
string debug_flag = "0";
|
||||||
string mysqlpw = " ";
|
string mysqlpw = " ";
|
||||||
|
string tmpDir;
|
||||||
|
|
||||||
int runningThreads = 0;
|
int runningThreads = 0;
|
||||||
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@ -139,11 +140,11 @@ void childReportThread(threadInfo_t& st)
|
|||||||
cout << "Error with running remote_command.sh, exiting..." << endl;
|
cout << "Error with running remote_command.sh, exiting..." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + rootPassword + " /tmp/" + outputFile + " > /dev/null 2>&1";
|
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + rootPassword + " " + tmpDir + "/" + outputFile + " > /dev/null 2>&1";
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0)
|
if (WEXITSTATUS(rtnCode) != 0)
|
||||||
cout << "ERROR: failed to retrieve /tmp/" << outputFile << " from " + remoteHostName << endl;
|
cout << "ERROR: failed to retrieve " << tmpDir << "/" << outputFile << " from " + remoteHostName << endl;
|
||||||
|
|
||||||
pthread_mutex_lock( &mutex1 );
|
pthread_mutex_lock( &mutex1 );
|
||||||
runningThreads--;
|
runningThreads--;
|
||||||
@ -198,7 +199,7 @@ void reportThread(string reporttype)
|
|||||||
string cmd = installDir + "/bin/logReport.sh " + localModule + " " + installDir;
|
string cmd = installDir + "/bin/logReport.sh " + localModule + " " + installDir;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
cmd = "mv -f /tmp/" + localModule + "_logReport.tar.gz .";
|
cmd = "mv -f " + tmpDir + "/" + localModule + "_logReport.tar.gz .";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
cmd = "tar -zcf " + localModule + "_mysqllogReport.tar.gz " + installDir + "/mysql/db/*.err* 2>/dev/null";
|
cmd = "tar -zcf " + localModule + "_mysqllogReport.tar.gz " + installDir + "/mysql/db/*.err* 2>/dev/null";
|
||||||
@ -234,7 +235,7 @@ void reportThread(string reporttype)
|
|||||||
|
|
||||||
cmd = installDir + "/bin/" + reportType + "Report.sh " + localModule + " " + installDir;
|
cmd = installDir + "/bin/" + reportType + "Report.sh " + localModule + " " + installDir;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
cmd = " mv -f /tmp/" + localModule + "_" + reportType + "Report.txt .";
|
cmd = " mv -f " + tmpDir + "/" + localModule + "_" + reportType + "Report.txt .";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
if (reportType == "config" )
|
if (reportType == "config" )
|
||||||
@ -431,6 +432,8 @@ int main(int argc, char* argv[])
|
|||||||
cout << "ERROR: Problem accessing Columnstore configuration file" << endl;
|
cout << "ERROR: Problem accessing Columnstore configuration file" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpDir = startup::StartUp::tmpDir();
|
||||||
|
|
||||||
for ( int i = 1; i < argc; i++ )
|
for ( int i = 1; i < argc; i++ )
|
||||||
{
|
{
|
||||||
@ -842,14 +845,15 @@ int main(int argc, char* argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check if mysql is supported and get info
|
// check if mysql is supported and get info
|
||||||
|
string logFile = tmpDir + "/idbmysql.log";
|
||||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-extra-file=" + installDir + "/mysql/my.cnf -u root ";
|
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-extra-file=" + installDir + "/mysql/my.cnf -u root ";
|
||||||
string cmd = columnstoreMysql + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
string cmd = columnstoreMysql + " -e 'status' > " + logFile + " 2>&1";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
//check for mysql password set
|
//check for mysql password set
|
||||||
string pwprompt = " ";
|
string pwprompt = " ";
|
||||||
|
|
||||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") )
|
if (oam.checkLogStatus(logFile, "ERROR 1045") )
|
||||||
{
|
{
|
||||||
cout << "NOTE: MariaDB Columnstore root user password is set" << endl;
|
cout << "NOTE: MariaDB Columnstore root user password is set" << endl;
|
||||||
|
|
||||||
@ -903,10 +907,10 @@ int main(int argc, char* argv[])
|
|||||||
//check for mysql password set
|
//check for mysql password set
|
||||||
pwprompt = "--password=" + mysqlpw;
|
pwprompt = "--password=" + mysqlpw;
|
||||||
|
|
||||||
string cmd = columnstoreMysql + pwprompt + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
string cmd = columnstoreMysql + pwprompt + " -e 'status' > " + logFile + " 2>&1";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") )
|
if (oam.checkLogStatus(logFile, "ERROR 1045") )
|
||||||
{
|
{
|
||||||
cout << "FAILED: Failed login using MariaDB Columnstore root user password '" << mysqlpw << "'" << endl;
|
cout << "FAILED: Failed login using MariaDB Columnstore root user password '" << mysqlpw << "'" << endl;
|
||||||
FAILED = true;
|
FAILED = true;
|
||||||
@ -1048,7 +1052,7 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
cout << "Get hadoop report data" << endl;
|
cout << "Get hadoop report data" << endl;
|
||||||
string cmd = installDir + "/bin/hadoopReport.sh " + localModule + " " + installDir + "\n";
|
string cmd = installDir + "/bin/hadoopReport.sh " + localModule + " " + installDir + "\n";
|
||||||
cmd += " mv -f /tmp/hadoopReport.txt .";
|
cmd += " mv -f " + tmpDir + "/hadoopReport.txt .";
|
||||||
FILE* pipe = popen(cmd.c_str(), "r");
|
FILE* pipe = popen(cmd.c_str(), "r");
|
||||||
|
|
||||||
if (!pipe)
|
if (!pipe)
|
||||||
|
@ -14,7 +14,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_configReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/${MODULE}_configReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
echo " "
|
echo " "
|
||||||
@ -79,6 +82,6 @@ echo "################# top -b -n 1 #################"
|
|||||||
echo " "
|
echo " "
|
||||||
top -b -n 1
|
top -b -n 1
|
||||||
|
|
||||||
} > /tmp/${MODULE}_configReport.txt
|
} > ${tmpDir}/${MODULE}_configReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -13,7 +13,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/hdfsReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/hdfsReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
echo
|
echo
|
||||||
@ -58,6 +61,6 @@ echo
|
|||||||
echo "################# hdfs fsck $INSTALLDIR #################"
|
echo "################# hdfs fsck $INSTALLDIR #################"
|
||||||
echo
|
echo
|
||||||
hadoop fsck $INSTALLDIR 2>/dev/null
|
hadoop fsck $INSTALLDIR 2>/dev/null
|
||||||
} > /tmp/hadoopReport.txt
|
} > ${tmpDir}/hadoopReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -14,7 +14,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_hardwareReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/${MODULE}_hardwareReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
echo " "
|
echo " "
|
||||||
@ -76,6 +79,6 @@ echo "################# ifconfig -a #################"
|
|||||||
echo " "
|
echo " "
|
||||||
ifconfig -a 2>/dev/null
|
ifconfig -a 2>/dev/null
|
||||||
|
|
||||||
} > /tmp/${MODULE}_hardwareReport.txt
|
} > ${tmpDir}/${MODULE}_hardwareReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -14,8 +14,11 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_logReport.tar.gz
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
tar -zcf /tmp/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1
|
rm -f ${tmpDir}/${MODULE}_logReport.tar.gz
|
||||||
|
|
||||||
|
tar -zcf ${tmpDir}/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -14,7 +14,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_resourceReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/${MODULE}_resourceReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
echo " "
|
echo " "
|
||||||
@ -63,6 +66,6 @@ echo "################# bin/editem -i #################"
|
|||||||
echo " "
|
echo " "
|
||||||
$INSTALLDIR/bin/editem -i 2>/dev/null
|
$INSTALLDIR/bin/editem -i 2>/dev/null
|
||||||
|
|
||||||
} > /tmp/${MODULE}_resourceReport.txt
|
} > ${tmpDir}/${MODULE}_resourceReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -14,7 +14,10 @@ else
|
|||||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/${MODULE}_softwareReport.txt
|
#get temp directory
|
||||||
|
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||||
|
|
||||||
|
rm -f ${tmpDir}/${MODULE}_softwareReport.txt
|
||||||
|
|
||||||
{
|
{
|
||||||
echo " "
|
echo " "
|
||||||
@ -35,6 +38,6 @@ echo "################# mcsadmin getStorageConfig #################"
|
|||||||
echo " "
|
echo " "
|
||||||
$INSTALLDIR/bin/mcsadmin getStorageConfig
|
$INSTALLDIR/bin/mcsadmin getStorageConfig
|
||||||
|
|
||||||
} > /tmp/${MODULE}_softwareReport.txt
|
} > ${tmpDir}/${MODULE}_softwareReport.txt
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -11097,7 +11097,7 @@ int ProcessManager::mountDBRoot(std::string dbrootID)
|
|||||||
//send msg to ProcMon if not local module
|
//send msg to ProcMon if not local module
|
||||||
if ( config.moduleName() == moduleName )
|
if ( config.moduleName() == moduleName )
|
||||||
{
|
{
|
||||||
string tmpMount = tmpLogDir + "/mount.txt";
|
string tmpMount = tmpLogDir + "/mount.log";
|
||||||
string cmd = "export LC_ALL=C;mount " + startup::StartUp::installDir() + "/data" + dbrootID + " > " + tmpMount;
|
string cmd = "export LC_ALL=C;mount " + startup::StartUp::installDir() + "/data" + dbrootID + " > " + tmpMount;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
|
@ -5203,7 +5203,7 @@ int ProcessMonitor::runMariaDBCommandLine(std::string command)
|
|||||||
if ( MySQLPort.empty() )
|
if ( MySQLPort.empty() )
|
||||||
MySQLPort = "3306";
|
MySQLPort = "3306";
|
||||||
|
|
||||||
string cmd = startup::StartUp::installDir() + "/bin/mariadb-command-line.sh --installdir=" + startup::StartUp::installDir() + " --command='" + command + "' --port=" + MySQLPort + " > " + tmpLogDir + "/mariadb-command-line.sh.log 2>&1";
|
string cmd = startup::StartUp::installDir() + "/bin/mariadb-command-line.sh --installdir=" + startup::StartUp::installDir() + " --command='" + command + "' --port=" + MySQLPort + "--tmpdir=" + tmpLogDir + " > " + tmpLogDir + "/mariadb-command-line.sh.log 2>&1";
|
||||||
|
|
||||||
log.writeLog(__LINE__, "cmd = " + cmd, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "cmd = " + cmd, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user