1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00
This commit is contained in:
David Hill
2018-09-21 14:44:12 -05:00
parent 81e35e35eb
commit 72f514ca54
10 changed files with 138 additions and 74 deletions

View File

@ -66,6 +66,8 @@ using namespace logging;
#include "rowgroup.h" #include "rowgroup.h"
using namespace rowgroup; using namespace rowgroup;
#include "installdir.h"
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/version.hpp> #include <boost/version.hpp>
@ -92,7 +94,8 @@ throw runtime_error("CALPONT_INTERNAL_ERROR"); \
#if CSC_DEBUG #if CSC_DEBUG
namespace namespace
{ {
std::ofstream csclog("/tmp/csc.log", std::ios::app); string tmpDir = startup::StartUp::installDir() + "csc.log";
std::ofstream csclog(tmpDir, std::ios::app);
} }
#define DEBUG csclog #define DEBUG csclog
#else #else

View File

@ -54,6 +54,9 @@ using namespace messageqcpp;
using namespace BRM; using namespace BRM;
#include "installdir.h"
namespace execplan namespace execplan
{ {
@ -102,7 +105,11 @@ SessionMonitor::SessionMonitor()
if (stmp != "") if (stmp != "")
fSegmentFilename = strdup(stmp.c_str()); fSegmentFilename = strdup(stmp.c_str());
else else
fSegmentFilename = strdup("/tmp/CalpontSessionMonitorShm"); {
string tmpdir = startup::StartUp::installDir() + "CalpontSessionMonitorShm";
fSegmentFilename = strdup(tmpdir);
}
try try
{ {

View File

@ -6195,7 +6195,9 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
if (filters) if (filters)
{ {
csep->filters(filters); csep->filters(filters);
filters->drawTree("/tmp/filter1.dot"); std::string aTmpDir(startup::StartUp::tmpDir());
aTmpDir = aTmpDir + "/filter1.dot";
filters->drawTree(aTmpDir);
} }
gwi.clauseType = SELECT; gwi.clauseType = SELECT;
@ -8620,7 +8622,9 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
{ {
csep->filters(filters); csep->filters(filters);
#ifdef DEBUG_WALK_COND #ifdef DEBUG_WALK_COND
filters->drawTree("/tmp/filter1.dot"); std::string aTmpDir(startup::StartUp::tmpDir());
aTmpDir = aTmpDir + "/filter1.dot";
filters->drawTree(aTmpDir);
#endif #endif
} }

View File

@ -3056,7 +3056,9 @@ int ha_calpont_impl_rnd_init(TABLE* table)
#ifdef PLAN_HEX_FILE #ifdef PLAN_HEX_FILE
// plan serialization // plan serialization
ifstream ifs("/tmp/li1-plan.hex"); string tmpDir = aTmpDir + "/li1-plan.hex";
ifstream ifs(tmpDir);
ByteStream bs1; ByteStream bs1;
ifs >> bs1; ifs >> bs1;
ifs.close(); ifs.close();
@ -3982,6 +3984,8 @@ void ha_calpont_impl_start_bulk_insert(ha_rows rows, TABLE* table)
//set up for cpimport //set up for cpimport
std::vector<char*> Cmds; std::vector<char*> Cmds;
std::string aCmdLine(startup::StartUp::installDir()); std::string aCmdLine(startup::StartUp::installDir());
std::string aTmpDir(startup::StartUp::tmpDir());
//If local module type is not PM and Local PM query is set, error out //If local module type is not PM and Local PM query is set, error out
char escapechar[2] = ""; char escapechar[2] = "";
@ -4390,6 +4394,8 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
std::string aTmpDir(startup::StartUp::tmpDir());
if (!thd->infinidb_vtable.cal_conn_info) if (!thd->infinidb_vtable.cal_conn_info)
thd->infinidb_vtable.cal_conn_info = (void*)(new cal_connection_info()); thd->infinidb_vtable.cal_conn_info = (void*)(new cal_connection_info());
@ -4516,7 +4522,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
rc = 1; rc = 1;
ifstream dmlFile; ifstream dmlFile;
ostringstream oss; ostringstream oss;
oss << "/tmp/" << ci->tableOid << ".txt"; oss << aTmpDir << ci->tableOid << ".txt";
dmlFile.open(oss.str().c_str()); dmlFile.open(oss.str().c_str());
if (dmlFile.is_open()) if (dmlFile.is_open())
@ -4533,7 +4539,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
rc = 1; rc = 1;
ifstream dmlFile; ifstream dmlFile;
ostringstream oss; ostringstream oss;
oss << "/tmp/" << ci->tableOid << ".txt"; oss << aTmpDir << ci->tableOid << ".txt";
dmlFile.open(oss.str().c_str()); dmlFile.open(oss.str().c_str());
if (dmlFile.is_open()) if (dmlFile.is_open())
@ -4567,7 +4573,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
//get extra warning count if any //get extra warning count if any
ifstream dmlFile; ifstream dmlFile;
ostringstream oss; ostringstream oss;
oss << "/tmp/" << ci->tableOid << ".txt"; oss << aTmpDir << ci->tableOid << ".txt";
dmlFile.open(oss.str().c_str()); dmlFile.open(oss.str().c_str());
int totalWarnCount = 0; int totalWarnCount = 0;
int colWarns = 0; int colWarns = 0;
@ -5235,7 +5241,9 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE
#ifdef PLAN_HEX_FILE #ifdef PLAN_HEX_FILE
// plan serialization // plan serialization
ifstream ifs("/tmp/li1-plan.hex"); string tmpDir = aTmpDir + "/li1-plan.hex";
ifstream ifs(tmpDir);
ByteStream bs1; ByteStream bs1;
ifs >> bs1; ifs >> bs1;
ifs.close(); ifs.close();

View File

@ -17,6 +17,8 @@ for arg in "$@"; do
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`" installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir` prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
tmpdir="`echo $arg | awk -F= '{print $2}'`"
else else
echo "ignoring unknown argument: $arg" 1>&2 echo "ignoring unknown argument: $arg" 1>&2
fi fi
@ -24,7 +26,7 @@ done
df=$installdir/mysql/my.cnf df=$installdir/mysql/my.cnf
$installdir/mysql/bin/mysql --defaults-extra-file=$df --force --user=root mysql 2>/tmp/mysql_install.log <<EOD $installdir/mysql/bin/mysql --defaults-extra-file=$df --force --user=root mysql 2> ${tmpdir}mysql_install.log <<EOD
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so'; INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so'; INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so'; INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so';

View File

@ -54,6 +54,8 @@ using namespace querystats;
#include "sm.h" #include "sm.h"
#include "installdir.h"
namespace namespace
{ {
using namespace sm; using namespace sm;
@ -254,7 +256,10 @@ void sighandler(int sig_num)
FILE* p; FILE* p;
char buf[1024]; char buf[1024];
if ((p = fopen("/tmp/f1.dat", "a")) != NULL) string tmpDir = startup::StartUp::tmpDir() + "/f1.dat";
const char *cstr = tmpDir.c_str();
if ((p = fopen(cstr, "a")) != NULL)
{ {
snprintf(buf, 1024, "sighandler() hit with %d\n", sig_num); snprintf(buf, 1024, "sighandler() hit with %d\n", sig_num);
fwrite(buf, 1, strlen(buf), p); fwrite(buf, 1, strlen(buf), p);

View File

@ -267,7 +267,7 @@
<!-- enable if you want to limit how much memory may be used for hdfs read/write memory buffers. <!-- enable if you want to limit how much memory may be used for hdfs read/write memory buffers.
<hdfsRdwrBufferMaxSize>8G</hdfsRdwrBufferMaxSize> <hdfsRdwrBufferMaxSize>8G</hdfsRdwrBufferMaxSize>
--> -->
<hdfsRdwrScratch>rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path --> <hdfsRdwrScratch>/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
<TempFileDir>/columnstore_tmp_files</TempFileDir> <TempFileDir>/columnstore_tmp_files</TempFileDir>
</SystemConfig> </SystemConfig>
<SystemModuleConfig> <SystemModuleConfig>

View File

@ -7,7 +7,7 @@
# check log for error # check log for error
checkForError() { checkForError() {
# check for password error # check for password error
grep "ERROR 1045" /tmp/mysql_install.log > /tmp/error.check grep "ERROR 1045" ${tmpdir}/mysql_install.log > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "MySQL Password file missing or incorrect, check .my.cnf file" echo "MySQL Password file missing or incorrect, check .my.cnf file"
rm -f /tmp/error.check rm -f /tmp/error.check
@ -55,6 +55,8 @@ for arg in "$@"; do
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
installdir="$(echo $arg | awk -F= '{print $2}')" installdir="$(echo $arg | awk -F= '{print $2}')"
prefix=$(dirname $installdir) prefix=$(dirname $installdir)
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
tmpdir="$(echo $arg | awk -F= '{print $2}')"
else else
echo "ignoring unknown argument: $arg" 1>&2 echo "ignoring unknown argument: $arg" 1>&2
fi fi
@ -100,11 +102,11 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
sleep 5 sleep 5
# Install various Calpont stuff... # Install various Calpont stuff...
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir $installdir/mysql/install_calpont_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
checkForError checkForError
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
# retry # retry
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir $installdir/mysql/install_calpont_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
checkForError checkForError
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"

View File

@ -35,6 +35,10 @@ using namespace oam;
#include "helpers.h" #include "helpers.h"
using namespace installer;
#include "installdir.h"
extern string mysqlpw; extern string mysqlpw;
string pwprompt = " "; string pwprompt = " ";
@ -45,6 +49,7 @@ string prompt;
const char* pcommand = 0; const char* pcommand = 0;
extern string installDir; extern string installDir;
extern bool noPrompting; extern bool noPrompting;
namespace installer namespace installer
@ -247,12 +252,15 @@ void mysqlSetup()
{ {
Oam oam; Oam oam;
string cmd; string cmd;
cmd = installDir + "/bin/post-mysqld-install --installdir=" + installDir + " > /tmp/post-mysqld-install.log 2>&1";
string tmpDir = startup::StartUp::tmpDir();
cmd = installDir + "/bin/post-mysqld-install --installdir=" + installDir + " > " + tmpDir + "/post-mysqld-install.log 2>&1";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) if (WEXITSTATUS(rtnCode) != 0)
{ {
cout << "Error running post-mysqld-install, check /tmp/post-mysqld-install.log" << endl; cout << "Error running post-mysqld-install, check " << tmpDir << "/post-mysqld-install.log" << endl;
cout << "Exiting..." << endl; cout << "Exiting..." << endl;
exit (1); exit (1);
} }
@ -276,7 +284,7 @@ void mysqlSetup()
HOME = p; HOME = p;
} }
cmd = installDir + "/bin/post-mysql-install --installdir=" + installDir + " > /tmp/post-mysql-install.log";; cmd = installDir + "/bin/post-mysql-install --installdir=" + installDir + " --tmpdir=" + tmpDir + " > " + tmpDir + "/post-mysql-install.log";
rtnCode = system(cmd.c_str()); rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) == 2) if (WEXITSTATUS(rtnCode) == 2)
@ -287,7 +295,7 @@ void mysqlSetup()
} }
else if (WEXITSTATUS(rtnCode) == 1) else if (WEXITSTATUS(rtnCode) == 1)
{ {
cout << "Error running post-mysql-install, /tmp/post-mysql-install.log" << endl; cout << "Error running post-mysql-install, " + tmpDir + "/post-mysql-install.log" << endl;
cout << "Exiting..." << endl; cout << "Exiting..." << endl;
exit (1); exit (1);
} }
@ -375,7 +383,9 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
if ( returnStatus != API_SUCCESS) if ( returnStatus != API_SUCCESS)
{ {
cout << "ERROR: Error return in running the MariDB Columnstore Upgrade, check /tmp/upgrade*.logs on " << (*pt).DeviceName << endl; string tmpDir = startup::StartUp::tmpDir();
cout << "ERROR: Error return in running the MariDB Columnstore Upgrade, check " + tmpDir + "/upgrade*.logs on " << (*pt).DeviceName << endl;
return returnStatus; return returnStatus;
} }
} }
@ -404,6 +414,8 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, bool pm
SystemModuleTypeConfig systemmoduletypeconfig; SystemModuleTypeConfig systemmoduletypeconfig;
string tmpDir = startup::StartUp::tmpDir();
try try
{ {
oam.getSystemConfig(systemmoduletypeconfig); oam.getSystemConfig(systemmoduletypeconfig);
@ -478,7 +490,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, bool pm
if ( returnStatus != API_SUCCESS) if ( returnStatus != API_SUCCESS)
{ {
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master DB Distribute, check /tmp/master-dist*.logs on " << masterModule << endl; cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master DB Distribute, check " + tmpDir + "/master-dist*.logs on " << masterModule << endl;
return returnStatus; return returnStatus;
} }
@ -491,7 +503,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, bool pm
if ( returnStatus != API_SUCCESS) if ( returnStatus != API_SUCCESS)
{ {
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master replication, check /tmp/master-rep*.logs on " << masterModule << endl; cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master replication, check " + tmpDir + "master-rep*.logs on " << masterModule << endl;
return returnStatus; return returnStatus;
} }
@ -526,7 +538,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, bool pm
if ( returnStatus != API_SUCCESS) if ( returnStatus != API_SUCCESS)
{ {
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Slave replication, check /tmp/slave-rep*.logs on " << (*pt).DeviceName << endl; cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Slave replication, check " + tmpDir + "/slave-rep*.logs on " << (*pt).DeviceName << endl;
return returnStatus; return returnStatus;
} }
@ -728,12 +740,14 @@ void checkMysqlPort( std::string& mysqlPort, Config* sysConfig )
{ {
Oam oam; Oam oam;
string tmpDir = startup::StartUp::tmpDir();
while (true) while (true)
{ {
string cmd = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN > /tmp/mysqlport"; string cmd = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN > " + tmpDir + "/mysqlport";
system(cmd.c_str()); system(cmd.c_str());
string fileName = "/tmp/mysqlport"; string fileName = tmpDir + "/mysqlport";
ifstream oldFile (fileName.c_str()); ifstream oldFile (fileName.c_str());
if (oldFile) if (oldFile)
@ -813,9 +827,11 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
bool inUse = false; bool inUse = false;
string tmpDir = startup::StartUp::tmpDir();
while (true) while (true)
{ {
string localnetstat = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN > /tmp/mysqlport"; string localnetstat = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN > " + tmpDir + "/mysqlport";
string remotenetstat = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN"; string remotenetstat = "netstat -na | grep -e :" + mysqlPort + "[[:space:]] | grep LISTEN";
//first check local mysql, if needed //first check local mysql, if needed
@ -823,7 +839,7 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
( ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ) && pmwithum ) ) ( ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ) && pmwithum ) )
{ {
system(localnetstat.c_str()); system(localnetstat.c_str());
string fileName = "/tmp/mysqlport"; string fileName = tmpDir + "/mysqlport";
ifstream oldFile (fileName.c_str()); ifstream oldFile (fileName.c_str());
if (oldFile) if (oldFile)

View File

@ -80,6 +80,7 @@ using namespace config;
#include "helpers.h" #include "helpers.h"
using namespace installer; using namespace installer;
#include "installdir.h"
typedef struct DBRoot_Module_struct typedef struct DBRoot_Module_struct
{ {
@ -195,6 +196,7 @@ bool amazon_quick_install = false;
string DataFileEnvFile; string DataFileEnvFile;
string installDir; string installDir;
string tmpDir;
string HOME = "/root"; string HOME = "/root";
extern string pwprompt; extern string pwprompt;
@ -288,6 +290,7 @@ int main(int argc, char* argv[])
HOME = p; HOME = p;
} }
tmpDir = startup::StartUp::tmpDir();
for ( int i = 1; i < argc; i++ ) for ( int i = 1; i < argc; i++ )
{ {
@ -568,12 +571,14 @@ int main(int argc, char* argv[])
EEPackageType = "binary"; EEPackageType = "binary";
else else
{ {
int rtnCode = system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); string cmd = "rpm -qi mariadb-columnstore-platform > " + tmpDir + "/columnstore.txt 2>&1";
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) == 0) if (WEXITSTATUS(rtnCode) == 0)
EEPackageType = "rpm"; EEPackageType = "rpm";
else { else {
rtnCode = system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); string cmd = "dpkg -s mariadb-columnstore-platform > " + tmpDir + "/columnstore.txt 2>&1";
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) == 0) if (WEXITSTATUS(rtnCode) == 0)
EEPackageType = "deb"; EEPackageType = "deb";
@ -701,11 +706,11 @@ int main(int argc, char* argv[])
// run my.cnf upgrade script // run my.cnf upgrade script
if ( reuseConfig == "y" ) if ( reuseConfig == "y" )
{ {
cmd = installDir + "/bin/mycnfUpgrade > /tmp/mycnfUpgrade.log 2>&1"; cmd = installDir + "/bin/mycnfUpgrade > " + tmpDir + "/mycnfUpgrade.log 2>&1";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) if (WEXITSTATUS(rtnCode) != 0)
cout << "Error: Problem upgrade my.cnf, check /tmp/mycnfUpgrade.log" << endl; cout << "Error: Problem upgrade my.cnf, check " << tmpDir << "/mycnfUpgrade.log" << endl;
else else
cout << "NOTE: my.cnf file was upgraded based on my.cnf.rpmsave" << endl; cout << "NOTE: my.cnf file was upgraded based on my.cnf.rpmsave" << endl;
} }
@ -1336,19 +1341,21 @@ int main(int argc, char* argv[])
if (!multi_server_quick_install) if (!multi_server_quick_install)
{ {
system("aws --version > /tmp/amazon.log 2>&1"); string amazonLog = tmpDir + "/amazon.log";
string cmd = "aws --version > " + amazonLog + " 2>&1";
int rtnCode = system(cmd.c_str());
ifstream in("/tmp/amazon.log"); ifstream in(amazonLog);
in.seekg(0, std::ios::end); in.seekg(0, std::ios::end);
int size = in.tellg(); int size = in.tellg();
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found")) if ( size == 0 || oam.checkLogStatus(amazonLog, "not found"))
{ {
// not running on amazon with ec2-api-tools // not running on amazon with ec2-api-tools
if (amazon_quick_install) if (amazon_quick_install)
{ {
cout << "ERROR: Amazon Quick Installer was specified, bu the AMazon CLI API packages isnt installed, exiting" << endl; cout << "ERROR: Amazon Quick Installer was specified, bu the Amazon CLI API packages isnt installed, exiting" << endl;
exit(1); exit(1);
} }
@ -1356,7 +1363,7 @@ int main(int argc, char* argv[])
} }
else else
{ {
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed")) if ( size == 0 || oam.checkLogStatus(amazonLog, "not installed"))
{ {
// not running on amazon with ec2-api-tools // not running on amazon with ec2-api-tools
if (amazon_quick_install) if (amazon_quick_install)
@ -3614,7 +3621,7 @@ int main(int argc, char* argv[])
if ( remote_installer_debug == "1" ) if ( remote_installer_debug == "1" )
{ {
logfile = "/tmp/"; logfile = tmpDir;
logfile += remoteModuleName + "_" + EEPackageType + "_install.log"; logfile += remoteModuleName + "_" + EEPackageType + "_install.log";
debug_logfile = " > " + logfile; debug_logfile = " > " + logfile;
} }
@ -3921,13 +3928,15 @@ int main(int argc, char* argv[])
if (hdfs && !nonDistribute ) if (hdfs && !nonDistribute )
{ {
string postConfigurePsdhLog = tmpDir + "postConfigure.pdsh.log";
cout << endl << "----- Starting MariaDB ColumnStore Service on all Modules -----" << endl << endl; cout << endl << "----- Starting MariaDB ColumnStore Service on all Modules -----" << endl << endl;
string cmd = "pdsh -a '" + installDir + "/bin/columnstore restart' > /tmp/postConfigure.pdsh 2>&1"; string cmd = "pdsh -a '" + installDir + "/bin/columnstore restart' > " + postConfigurePsdhLog + " 2>&1";
system(cmd.c_str()); system(cmd.c_str());
if (oam.checkLogStatus("/tmp/postConfigure.pdsh", "exit") ) if (oam.checkLogStatus(postConfigurePsdhLog, "exit") )
{ {
cout << endl << "ERROR: Starting MariaDB ColumnStore Service failue, check /tmp/postConfigure.pdsh. exit..." << endl; cout << endl << "ERROR: Starting MariaDB ColumnStore Service failue, check " + postConfigurePsdhLog + ". exit..." << endl;
exit (1); exit (1);
} }
} }
@ -4013,26 +4022,27 @@ int main(int argc, char* argv[])
} }
} }
string dbbuilderLog = tmpDir + "dbbuilder.log";
if (hdfs) if (hdfs)
cmd = "bash -c '. " + installDir + "/bin/" + DataFileEnvFile + ";" + installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log'"; cmd = "bash -c '. " + installDir + "/bin/" + DataFileEnvFile + ";" + installDir + "/bin/dbbuilder 7 > " + dbbuilderLog;
else else
cmd = installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log"; cmd = installDir + "/bin/dbbuilder 7 > " + dbbuilderLog;
system(cmd.c_str()); system(cmd.c_str());
if (oam.checkLogStatus("/tmp/dbbuilder.log", "System Catalog created") ) if (oam.checkLogStatus(dbbuilderLog, "System Catalog created") )
cout << endl << "System Catalog Successfully Created" << endl; cout << endl << "System Catalog Successfully Created" << endl;
else else
{ {
if ( oam.checkLogStatus("/tmp/dbbuilder.log", "System catalog appears to exist") ) if ( oam.checkLogStatus(dbbuilderLog, "System catalog appears to exist") )
{ {
cout.flush(); cout.flush();
} }
else else
{ {
cout << endl << "System Catalog Create Failure" << endl; cout << endl << "System Catalog Create Failure" << endl;
cout << "Check latest log file in /tmp/dbbuilder.log.*" << endl; cout << "Check latest log file in " << dbbuilderLog << endl;
cout << " IMPORTANT: Once issue has been resolved, rerun postConfigure" << endl << endl; cout << " IMPORTANT: Once issue has been resolved, rerun postConfigure" << endl << endl;
exit (1); exit (1);
@ -4622,7 +4632,7 @@ bool createDbrootDirs(string DBRootStorageType)
// mount data1 and create directories if configured with storage // mount data1 and create directories if configured with storage
if ( DBRootStorageType == "external" ) if ( DBRootStorageType == "external" )
{ {
string cmd = "mount " + installDir + "/data1 > /tmp/mount.txt 2>&1"; string cmd = "mount " + installDir + "/data1 > " + tmpDir + "/mount.txt 2>&1";
system(cmd.c_str()); system(cmd.c_str());
if ( !rootUser) if ( !rootUser)
@ -4655,11 +4665,12 @@ bool pkgCheck(string columnstorePackage)
{ {
while (true) while (true)
{ {
string cmd = "ls " + columnstorePackage + " > /tmp/calpontpkgs"; string fileName = tmpDir + "/calpontpkgs";
string cmd = "ls " + columnstorePackage + " > " + fileName;
system(cmd.c_str()); system(cmd.c_str());
string pkg = columnstorePackage; string pkg = columnstorePackage;
string fileName = "/tmp/calpontpkgs";
ifstream oldFile (fileName.c_str()); ifstream oldFile (fileName.c_str());
if (oldFile) if (oldFile)
@ -4770,7 +4781,7 @@ bool storageSetup(bool amazonInstall)
cout.flush(); cout.flush();
string logdir("/var/log/mariadb/columnstore"); string logdir("/var/log/mariadb/columnstore");
if (access(logdir.c_str(), W_OK) != 0) logdir = "/tmp"; if (access(logdir.c_str(), W_OK) != 0) logdir = tmpDir;
string hdfslog = logdir + "/hdfsCheck.log1"; string hdfslog = logdir + "/hdfsCheck.log1";
@ -5087,7 +5098,8 @@ bool storageSetup(bool amazonInstall)
//check if gluster is installed //check if gluster is installed
int rtnCode = 1; int rtnCode = 1;
rtnCode = system("gluster --version > /tmp/gluster.log 2>&1"); string cmd = "gluster --version > " + tmpDir + "/gluster.log 2>&1";
rtnCode = system(cmd.c_str());
if (rtnCode == 0) if (rtnCode == 0)
{ {
@ -5099,14 +5111,17 @@ bool storageSetup(bool amazonInstall)
} }
//check if hadoop is installed //check if hadoop is installed
system("which hadoop > /tmp/hadoop.log 2>&1"); string hadoopLog = tmpDir + "/hadoop.log";
ifstream in("/tmp/hadoop.log"); cmd = "which hadoop > " + hadoopLog + " 2>&1";
system(cmd.c_str());
ifstream in(hadoopLog);
in.seekg(0, std::ios::end); in.seekg(0, std::ios::end);
int size = in.tellg(); int size = in.tellg();
if ( size == 0 || oam.checkLogStatus("/tmp/hadoop.log", "no hadoop")) if ( size == 0 || oam.checkLogStatus(hadoopLog, "no hadoop"))
// no hadoop // no hadoop
size = 0; size = 0;
else else
@ -5577,7 +5592,7 @@ bool storageSetup(bool amazonInstall)
cout.flush(); cout.flush();
string logdir("/var/log/mariadb/columnstore"); string logdir("/var/log/mariadb/columnstore");
if (access(logdir.c_str(), W_OK) != 0) logdir = "/tmp"; if (access(logdir.c_str(), W_OK) != 0) logdir = tmpDir;
string hdfslog = logdir + "/hdfsCheck.log1"; string hdfslog = logdir + "/hdfsCheck.log1";
@ -6116,14 +6131,14 @@ void remoteInstallThread(void* arg)
{ {
//failure //failure
pthread_mutex_lock(&THREAD_LOCK); pthread_mutex_lock(&THREAD_LOCK);
cout << endl << "Failure with a remote module install, check install log files in /tmp" << endl; cout << endl << "Failure with a remote module install, check install log files in " << tmpDir << endl;
exit(1); exit(1);
} }
} }
} }
pthread_mutex_lock(&THREAD_LOCK); pthread_mutex_lock(&THREAD_LOCK);
cout << endl << "Failure with a remote module install, check install log files in /tmp" << endl; cout << endl << "Failure with a remote module install, check install log files in " << tmpDir << endl;
exit(1); exit(1);
} }
@ -6681,7 +6696,9 @@ bool glusterSetup(string password)
sleep(5); sleep(5);
command = "gluster peer status >> /tmp/glusterCommands.txt 2>&1"; string glusterCommandsLog = tmpDir + "/glusterCommands.log";
command = "gluster peer status " + glusterCommandsLog + "2>&1";
status = system(command.c_str()); status = system(command.c_str());
@ -6717,13 +6734,13 @@ bool glusterSetup(string password)
pmnextbrick[pm]++; pmnextbrick[pm]++;
} }
command += "force >> /tmp/glusterCommands.txt 2>&1"; command += "force >> " + glusterCommandsLog + " 2>&1";
cout << "Gluster create and start volume dbroot" << oam.itoa(dbrootID) << "..."; cout << "Gluster create and start volume dbroot" << oam.itoa(dbrootID) << "...";
status = system(command.c_str()); status = system(command.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) != 0 )
{ {
if (oam.checkLogStatus("/tmp/glusterCommands.txt", "dbroot" + oam.itoa(dbrootID) + " already exists" )) if (oam.checkLogStatus(glusterCommandsLog, "dbroot" + oam.itoa(dbrootID) + " already exists" ))
{ {
string errmsg1; string errmsg1;
string errmsg2; string errmsg2;
@ -6752,7 +6769,7 @@ bool glusterSetup(string password)
if (rootUser) if (rootUser)
{ {
command = "gluster volume start dbroot" + oam.itoa(dbrootID) + " >> /tmp/glusterCommands.txt 2>&1"; command = "gluster volume start dbroot" + oam.itoa(dbrootID) + " >> " + glusterCommandsLog + " 2>&1";
status = system(command.c_str()); status = system(command.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) != 0 )
@ -6765,7 +6782,7 @@ bool glusterSetup(string password)
{ {
int user = getuid(); int user = getuid();
int group = getgid(); int group = getgid();
command = "gluster volume set dbroot" + oam.itoa(dbrootID) + " storage.owner-uid " + oam.itoa(user) + " >> /tmp/glusterCommands.txt 2>&1";; command = "gluster volume set dbroot" + oam.itoa(dbrootID) + " storage.owner-uid " + oam.itoa(user) + " >> " + glusterCommandsLog + " 2>&1";
status = system(command.c_str()); status = system(command.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) != 0 )
@ -6774,7 +6791,7 @@ bool glusterSetup(string password)
exit(1); exit(1);
} }
command = "gluster volume set dbroot" + oam.itoa(dbrootID) + " storage.owner-gid " + oam.itoa(group) + " >> /tmp/glusterCommands.txt 2>&1";; command = "gluster volume set dbroot" + oam.itoa(dbrootID) + " storage.owner-gid " + oam.itoa(group) + " >> " + glusterCommandsLog + " 2>&1";
status = system(command.c_str()); status = system(command.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) != 0 )
@ -6783,7 +6800,7 @@ bool glusterSetup(string password)
exit(1); exit(1);
} }
command = "gluster volume start dbroot" + oam.itoa(dbrootID) + " >> /tmp/glusterCommands.txt 2>&1"; command = "gluster volume start dbroot" + oam.itoa(dbrootID) + " >> " + glusterCommandsLog + " 2>&1";
status = system(command.c_str()); status = system(command.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) != 0 )