1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +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
fi else
#get columnstore temp file directory name #get columnstore temp file directory name
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir` TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
tmpDir=${tmpDir}${TempFileDir} tmpDir=${tmpDir}${TempFileDir}
fi
#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,7 +164,9 @@ 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 ] ||
[ "$syslog_conf" != /etc/rsyslog.d/49-columnstore.conf ]; then
rm -f ${syslog_conf}.columnstoreSave rm -f ${syslog_conf}.columnstoreSave
cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1 cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1 sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1

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,6 +100,12 @@ const string StartUp::tmpDir()
#else #else
//check for non-root user
const char* p = getenv("HOME");
string homedir = p;
if (homedir == "/root")
{
Config* sysConfig = Config::makeConfig(); Config* sysConfig = Config::makeConfig();
string TempFileDir; string TempFileDir;
@@ -109,24 +118,15 @@ const string StartUp::tmpDir()
{} {}
fTmpDirp = new string("/tmp"); fTmpDirp = new string("/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) *fTmpDirp = homedir + TempFileDir;
}
else
{ {
string homedir = "/"; // non-root user
char* p = getenv("HOME");
if (p && *p)
homedir = p;
*fTmpDirp = homedir + "/.tmp"; *fTmpDirp = homedir + "/.tmp";
} }
*fTmpDirp = *fTmpDirp + TempFileDir;
#endif #endif
return *fTmpDirp; return *fTmpDirp;