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-26 15:05:27 -05:00
parent f25082bc9a
commit 07e78c410b
5 changed files with 46 additions and 37 deletions

View File

@ -172,17 +172,21 @@ tmpDir="/tmp"
if [ $user != "root" ]; then if [ $user != "root" ]; then
tmpDir=$HOME"./tmp" tmpDir=$HOME"./tmp"
mkdir $tmpDir >/dev/null 2>&1 mkdir $tmpDir >/dev/null 2>&1
else
#get columnstore temp file directory name
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
tmpDir=${tmpDir}${TempFileDir}
fi fi
#get columnstore temp file directory name
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
tmpDir=${tmpDir}${TempFileDir}
#set base columnstore temp file directory #set base columnstore temp file directory
$installdir/bin/setConfig -d SystemConfig SystemTempFileDir $tmpDir $installdir/bin/setConfig -d SystemConfig SystemTempFileDir $tmpDir
#create columnstore temp file directory #get place file buffer temporary files
mkdir -p $tmpDir >/dev/null 2>&1 hdfsRdwrScratch=`$installdir/bin/getConfig SystemConfig hdfsRdwrScratch`
hdfsDir=${tmpDir}${hdfsRdwrScratch}
#create place file buffer temporary files
mkdir -p $hdfsDir >/dev/null 2>&1
#create mount directories #create mount directories
mkdir /mnt/tmp > /dev/null 2>&1 mkdir /mnt/tmp > /dev/null 2>&1

View File

@ -18,7 +18,7 @@ while getopts "vs:t:h:l" flag; do
;; ;;
t) topt=$OPTARG t) topt=$OPTARG
;; ;;
t) lopt=$OPTARG l) lopt=$OPTARG
;; ;;
h) echo $usage h) echo $usage
exit 0 exit 0

View File

@ -164,12 +164,14 @@ if [ ! -z "$syslog_conf" ] ; then
chown $user:$user /home/$user/mariadb/columnstore/etc/* chown $user:$user /home/$user/mariadb/columnstore/etc/*
fi fi
if [ "$syslog_conf" != /etc/rsyslog.d/columnstore.conf ]; then if [ "$syslog_conf" != /etc/rsyslog.d/columnstore.conf ] ||
rm -f ${syslog_conf}.columnstoreSave [ "$syslog_conf" != /etc/rsyslog.d/49-columnstore.conf ]; then
cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1 rm -f ${syslog_conf}.columnstoreSave
cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
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

View File

@ -63,6 +63,7 @@ void IDBPolicy::init( bool bEnableLogging, bool bUseRdwrMemBuffer, const string&
if ( hdfsRdwrScratch.length() > 0 ) if ( hdfsRdwrScratch.length() > 0 )
{ {
// TODO-check to make sure this directory has sufficient space, whatever that means. // TODO-check to make sure this directory has sufficient space, whatever that means.
boost::filesystem::path tmpfilepath( hdfsRdwrScratch ); boost::filesystem::path tmpfilepath( hdfsRdwrScratch );
if (boost::filesystem::exists(tmpfilepath)) if (boost::filesystem::exists(tmpfilepath))
@ -79,6 +80,8 @@ void IDBPolicy::init( bool bEnableLogging, bool bUseRdwrMemBuffer, const string&
} }
else else
{ {
cout << tmpfilepath << endl;
if (!boost::filesystem::create_directory(tmpfilepath)) if (!boost::filesystem::create_directory(tmpfilepath))
{ {
// We failed to create the scratch directory // We failed to create the scratch directory

View File

@ -35,6 +35,9 @@ using namespace boost;
using namespace config; using namespace config;
#include <iostream>
using namespace std;
namespace startup namespace startup
{ {
@ -97,36 +100,33 @@ const string StartUp::tmpDir()
#else #else
Config* sysConfig = Config::makeConfig(); //check for non-root user
const char* p = getenv("HOME");
string homedir = p;
string TempFileDir; if (homedir == "/root")
try
{ {
TempFileDir = sysConfig->getConfig("SystemConfig", "TempFileDir"); Config* sysConfig = Config::makeConfig();
string TempFileDir;
try
{
TempFileDir = sysConfig->getConfig("SystemConfig", "TempFileDir");
}
catch (...)
{}
fTmpDirp = new string("/tmp");
*fTmpDirp = homedir + TempFileDir;
} }
catch (...) else
{} {
// non-root user
fTmpDirp = new string("/tmp"); *fTmpDirp = homedir + "/.tmp";
//See if we can figure out the tmp dir in Linux...
//1. env var COLUMNSTORE_INSTALL_DIR
const char* p = 0;
p = getenv("COLUMNSTORE_INSTALL_DIR");
if (p && *p)
{
string homedir = "/";
char* p = getenv("HOME");
if (p && *p)
homedir = p;
*fTmpDirp = homedir + "/.tmp";
} }
*fTmpDirp = *fTmpDirp + TempFileDir;
#endif #endif
return *fTmpDirp; return *fTmpDirp;