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-4483: Fix and consolidate log files and cpimport logging.
This commit is contained in:
@ -3,7 +3,6 @@ SET (DEFAULT_GROUP "mysql")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/columnstoreSyslogSetup.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstoreSyslogSetup.sh" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/columnstore-post-install.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstore-post-install" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/columnstore.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstore" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/columnstore-pre-uninstall.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstore-pre-uninstall" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/columnstoreLogRotate.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstoreLogRotate" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mariadb-columnstore.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mariadb-columnstore.service" @ONLY)
|
||||
@ -27,7 +26,6 @@ install(PROGRAMS columnstore-post-install
|
||||
columnstore_run.sh
|
||||
post-mysql-install
|
||||
post-mysqld-install
|
||||
columnstore
|
||||
columnstoreSyslogSetup.sh
|
||||
mcs-stop-controllernode.sh
|
||||
mcs-loadbrm.py
|
||||
|
@ -32,22 +32,22 @@ fi
|
||||
|
||||
checkForError() {
|
||||
# check for password error
|
||||
grep "ERROR 1045" ${tmpDir}/mysql_install.log > ${tmpDir}/error.check
|
||||
if [ `cat ${tmpDir}/error.check | wc -c` -ne 0 ]; then
|
||||
grep "ERROR 1045" ${installLogDir}/mysql_install.log > ${installLogDir}/error.check
|
||||
if [ `cat ${installLogDir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "There were authentication issues running install_mcs_mysql.sh \
|
||||
script. The log is available in ${tmpDir}/mysql_install.log. Please re-run \
|
||||
script. The log is available in ${installLogDir}/mysql_install.log. Please re-run \
|
||||
columnstore-post-install manually after solving the authentication issues."
|
||||
rm -f ${tmpDir}/error.check
|
||||
rm -f ${installLogDir}/error.check
|
||||
return 2;
|
||||
fi
|
||||
|
||||
rm -f ${tmpDir}/error.check
|
||||
rm -f ${installLogDir}/error.check
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if engine columnstore exist
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking for engine columnstore..."
|
||||
$MDB --execute="show engines" 2> ${tmpDir}/post-mysql-install.log | grep -i columnstore >> ${tmpDir}/post-mysql-install.log 2>&1
|
||||
$MDB --execute="show engines" 2> ${installLogDir}/post-mysql-install.log | grep -i columnstore >> ${installLogDir}/post-mysql-install.log 2>&1
|
||||
|
||||
#
|
||||
# Add compressiontype column to SYSCOLUMN if applicable
|
||||
@ -103,35 +103,50 @@ profileFile="/etc/profile.d/columnstoreAlias.sh"
|
||||
/bin/cp -f @ENGINE_SUPPORTDIR@/columnstoreAlias /etc/profile.d/columnstoreAlias.sh
|
||||
chmod 644 /etc/profile.d/columnstoreAlias.sh >/dev/null 2>&1
|
||||
|
||||
test -d /var/log/mariadb/columnstore || mkdir -p /var/log/mariadb/columnstore >/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/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
test -h /var/log/mariadb/columnstore/data && rm -f /var/log/mariadb/columnstore/data
|
||||
chmod 755 /var/log/mariadb/columnstore/corefiles > /dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@ || mkdir -p @ENGINE_LOGDIR@ >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/archive || mkdir @ENGINE_LOGDIR@/archive >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/corefiles || mkdir @ENGINE_LOGDIR@/corefiles >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/trace || mkdir @ENGINE_LOGDIR@/trace >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/cpimport || mkdir @ENGINE_LOGDIR@/cpimport >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/install || mkdir @ENGINE_LOGDIR@/install >/dev/null 2>&1
|
||||
test -h @ENGINE_LOGDIR@/data && rm -f @ENGINE_LOGDIR@/data
|
||||
chmod 755 @ENGINE_LOGDIR@/corefiles > /dev/null 2>&1
|
||||
chmod 777 @ENGINE_LOGDIR@/cpimport
|
||||
chmod 777 @ENGINE_LOGDIR@/install
|
||||
installLogDir=@ENGINE_LOGDIR@/install
|
||||
|
||||
# make sure trace dir is world-writable and sticky
|
||||
test -d /var/lib/columnstore/data || mkdir -p /var/lib/columnstore/data
|
||||
test -d /var/lib/columnstore/data1/systemFiles/dbrm || mkdir -p /var/lib/columnstore/data1/systemFiles/dbrm
|
||||
test -d /var/lib/columnstore/local || mkdir -p /var/lib/columnstore/local
|
||||
test -d /var/lib/columnstore/data1/systemFiles/dataTransaction || rmdir /var/lib/columnstore/data1/systemFiles/dataTransaction >/dev/null 2>&1
|
||||
test -d /var/lib/columnstore/data1/systemFiles/dataTransaction/archive || rmdir /var/lib/columnstore/data1/systemFiles/dataTransaction/archive >/dev/null 2>&1
|
||||
chmod 1755 /var/lib/columnstore/data1 >/dev/null 2>&1
|
||||
chmod -R 1755 /var/lib/columnstore/data1/systemFiles >/dev/null 2>&1
|
||||
test -d @ENGINE_DATADIR@/data || mkdir -p @ENGINE_DATADIR@/data
|
||||
test -d @ENGINE_DATADIR@/data1/systemFiles/dbrm || mkdir -p @ENGINE_DATADIR@/data1/systemFiles/dbrm
|
||||
test -d @ENGINE_DATADIR@/local || mkdir -p @ENGINE_DATADIR@/local
|
||||
test -d @ENGINE_DATADIR@/data1/systemFiles/dataTransaction || rmdir @ENGINE_DATADIR@/data1/systemFiles/dataTransaction >/dev/null 2>&1
|
||||
test -d @ENGINE_DATADIR@/data1/systemFiles/dataTransaction/archive || rmdir @ENGINE_DATADIR@/data1/systemFiles/dataTransaction/archive >/dev/null 2>&1
|
||||
chmod 1755 @ENGINE_DATADIR@/data1 >/dev/null 2>&1
|
||||
chmod -R 1755 @ENGINE_DATADIR@/data1/systemFiles >/dev/null 2>&1
|
||||
chmod 1755 @ENGINE_SYSCONFDIR@/columnstore > /dev/null 2>&1
|
||||
|
||||
#create the bulk-load dirs
|
||||
mkdir -p /var/lib/columnstore/data/bulk/data/import >/dev/null 2>&1
|
||||
mkdir -p /var/lib/columnstore/data/bulk/log >/dev/null 2>&1
|
||||
mkdir -p /var/lib/columnstore/data/bulk/job >/dev/null 2>&1
|
||||
mkdir -p /var/lib/columnstore/data/bulk/rollback >/dev/null 2>&1
|
||||
mkdir -p /var/lib/columnstore/data/bulk/tmpjob >/dev/null 2>&1
|
||||
rm -f /var/lib/columnstore/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_DATADIR@/data/bulk/data/import >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_DATADIR@/data/bulk/log >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_DATADIR@/data/bulk/job >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_DATADIR@/data/bulk/rollback >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_DATADIR@/data/bulk/tmpjob >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_LOGDIR@/data/bulk/data/import >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_LOGDIR@/data/bulk/log >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_LOGDIR@/data/bulk/job >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_LOGDIR@/data/bulk/rollback >/dev/null 2>&1
|
||||
mkdir -p @ENGINE_LOGDIR@/data/bulk/tmpjob >/dev/null 2>&1
|
||||
rm -f @ENGINE_DATADIR@/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
rm -f @ENGINE_LOGDIR@/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
chmod -R 777 @ENGINE_LOGDIR@/data
|
||||
|
||||
#get columnstore temp file directory name
|
||||
tmpDir=/tmp/columnstore_tmp_files
|
||||
tmpDir=`@ENGINE_BINDIR@/mcsGetConfig SystemConfig SystemTempFileDir`
|
||||
scratchDir=$tmpDir`@ENGINE_BINDIR@/mcsGetConfig SystemConfig hdfsRdwrScratch`
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
mkdir $scratchDir >/dev/null 2>&1
|
||||
chmod 777 $tmpDir
|
||||
chmod 777 $scratchDir
|
||||
|
||||
#create mount directories
|
||||
mkdir /mnt/tmp > /dev/null 2>&1
|
||||
@ -196,12 +211,12 @@ if [ $user = "root" ]; then
|
||||
fi
|
||||
|
||||
if [ $user = "root" ]; then
|
||||
columnstoreSyslogSetup.sh install > $tmpDir/syslog_install.log 2>&1
|
||||
columnstoreSyslogSetup.sh install > $installLogDir/syslog_install.log 2>&1
|
||||
|
||||
#check if MariaDB Columnstore system logging was setup
|
||||
cat $tmpDir/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
|
||||
cat $installLogDir/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
cat $tmpDir/syslog_install.log
|
||||
cat $installLogDir/syslog_install.log
|
||||
fi
|
||||
else
|
||||
chown $user:$user @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml
|
||||
@ -231,7 +246,7 @@ rm -f $lockdir/columnstore
|
||||
|
||||
# This was the last place of postConfigure. RIP
|
||||
|
||||
@ENGINE_SBINDIR@/install_mcs_mysql.sh --tmpdir=$tmpDir
|
||||
@ENGINE_SBINDIR@/install_mcs_mysql.sh --tmpdir=$installLogDir
|
||||
|
||||
# Restart MDB to enable plugin
|
||||
systemctl cat mariadb.service > /dev/null 2>&1
|
||||
@ -326,23 +341,22 @@ fi
|
||||
#change ownership/permissions to be able to run columnstore as non-root
|
||||
# TODO: Remove conditional once container dispatcher uses non-root by default
|
||||
if [ $(running_systemd) -eq 0 ]; then
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ /var/log/mariadb/columnstore
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ @ENGINE_LOGDIR@
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ /etc/columnstore
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ /var/lib/columnstore
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ /tmp/columnstore_tmp_files
|
||||
chmod 777 /tmp/columnstore_tmp_files
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ @ENGINE_DATADIR@
|
||||
chown -R @DEFAULT_USER@:@DEFAULT_GROUP@ $tmpDir
|
||||
chmod 777 /dev/shm
|
||||
fi
|
||||
|
||||
systemctl cat mariadb-columnstore.service > /dev/null 2>&1
|
||||
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||
mkdir -p /var/lib/columnstore/storagemanager
|
||||
chown -R mysql:mysql /var/lib/columnstore/storagemanager
|
||||
IFLAG=/var/lib/columnstore/storagemanager/storagemanager-lock
|
||||
mkdir -p @ENGINE_DATADIR@/storagemanager
|
||||
chown -R mysql:mysql @ENGINE_DATADIR@/storagemanager
|
||||
IFLAG=@ENGINE_DATADIR@/storagemanager/storagemanager-lock
|
||||
|
||||
# shared dbroot1 synchronization
|
||||
# prevents dbbuilder from processing simultaneously on two or more nodes
|
||||
exec {fd_lock}>/var/lib/columnstore/data1/dbroot1-lock
|
||||
exec {fd_lock}>@ENGINE_DATADIR@/data1/dbroot1-lock
|
||||
flock -x "$fd_lock"
|
||||
|
||||
# shared storagemanager data corruption prevention
|
||||
|
@ -49,8 +49,7 @@ if [ -n "$(pgrep -x ProcMon)" ] || [ -n "$(pgrep -x ProcMgr)" ];then
|
||||
fi
|
||||
|
||||
rm -f /etc/profile.d/columnstoreAlias.sh
|
||||
rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
|
||||
rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
|
||||
rm -f @ENGINE_LOGDIR@/*.log1 > /dev/null 2>&1
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`@ENGINE_BINDIR@/mcsGetConfig SystemConfig SystemTempFileDir`
|
||||
@ -59,11 +58,11 @@ if [[ $tmpDir = *"tmp" ]]; then
|
||||
rm -rf $tmpDir/*
|
||||
fi
|
||||
|
||||
rm -f /var/lib/columnstore/local/*.columnstore
|
||||
rm -rf /var/lib/columnstore/local/etc/
|
||||
rm -f /var/lib/columnstore/data/bulk/tmp/job/* >/dev/null 2>&1
|
||||
rm -f /var/lib/columnstore/local/moveDbrootTransactionLog
|
||||
rm -rf /var/log/mariadb/columnstore/
|
||||
rm -f @ENGINE_DATADIR@/local/*.columnstore
|
||||
rm -rf @ENGINE_DATADIR@/local/etc/
|
||||
rm -f @ENGINE_DATADIR@/data/bulk/tmp/job/* >/dev/null 2>&1
|
||||
rm -f @ENGINE_DATADIR@/local/moveDbrootTransactionLog
|
||||
rm -rf @ENGINE_LOGDIR@
|
||||
rm -rf /tmp/columnstore_tmp_files
|
||||
|
||||
lockdir=`@ENGINE_BINDIR@/mcsGetConfig Installation LockFileDirectory`
|
||||
@ -111,7 +110,7 @@ if [ -n "$systemctl" ] && [ $(running_systemd) -eq 0 ]; then
|
||||
|
||||
systemctl daemon-reload
|
||||
# remove flag to prevent clusters using shared storage from initializing columnstore more than once
|
||||
IFLAG=/var/lib/columnstore/storagemanager/storagemanager-lock
|
||||
IFLAG=@ENGINE_DATADIR@/storagemanager/storagemanager-lock
|
||||
if [ -e $IFLAG ]; then
|
||||
rm $IFLAG
|
||||
fi
|
||||
@ -137,7 +136,7 @@ fi
|
||||
rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave
|
||||
|
||||
#remove OAMdbrootCheck file
|
||||
rm -f /var/lib/columnstore/data*/OAMdbrootCheck > /dev/null 2>&1
|
||||
rm -f @ENGINE_DATADIR@/data*/OAMdbrootCheck > /dev/null 2>&1
|
||||
|
||||
rm -f /etc/rsyslog.d/49-columnstore.conf > /dev/null 2>&1
|
||||
rm -rf /tmp/columnstore_tmp_files > /dev/null 2>&1
|
||||
|
@ -1,161 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: columnstore 3704 2013-08-07 03:33:20Z bwilkinson $
|
||||
#
|
||||
# columnstore Starts MariaDB Columnstore database platform
|
||||
#
|
||||
#
|
||||
# chkconfig: 2345 99 99
|
||||
# description: MariaDB Columnstore is a database platform that utilizes Mysql
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: columnstore
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $all
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start/stop MariaDB Columnstore DW DBMS
|
||||
### END INIT INFO
|
||||
|
||||
running_systemd() {
|
||||
if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then
|
||||
echo 0
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
USER=`whoami 2>/dev/null`
|
||||
|
||||
# Source function library.
|
||||
if [ -f /etc/init.d/functions ]; then
|
||||
. /etc/init.d/functions
|
||||
fi
|
||||
|
||||
. @ENGINE_SUPPORTDIR@/columnstore_functions
|
||||
|
||||
mt=`module_type`
|
||||
mid=`module_id`
|
||||
|
||||
has_um=`@ENGINE_BINDIR@/mcsGetConfig SystemModuleConfig ModuleCount2`
|
||||
if [ "x$has_um" = x ]; then
|
||||
has_um=0
|
||||
fi
|
||||
|
||||
lockdir=`@ENGINE_BINDIR@/mcsGetConfig Installation LockFileDirectory`
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`@ENGINE_BINDIR@/mcsGetConfig SystemConfig SystemTempFileDir`
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
if [ $USER == "root" ]; then
|
||||
chmod 777 $tmpDir
|
||||
fi
|
||||
|
||||
checkInstallSetup() {
|
||||
InitialInstallFlag=`@ENGINE_BINDIR@/mcsGetConfig -c @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml Installation InitialInstallFlag`
|
||||
if [ $InitialInstallFlag != "y" ]; then
|
||||
echo "Please run the postConfigure install script, check the Installation Guide"
|
||||
echo "for additional details"
|
||||
rm -f $lockdir/columnstore
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -f $lockdir/columnstore ]; then
|
||||
echo "MariaDB Columnstore Database Platform already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Make sure ProcMon is down first
|
||||
touch ${tmpDir}/StopColumnstore
|
||||
pkill ProcMon
|
||||
pkill ProcMgr
|
||||
|
||||
(mkdir -p $lockdir && touch $lockdir/columnstore) >/dev/null 2>&1
|
||||
|
||||
#checkInstallSetup
|
||||
|
||||
CoreFileFlag=`@ENGINE_BINDIR@/mcsGetConfig -c @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml Installation CoreFileFlag`
|
||||
if [ $CoreFileFlag = "y" ]; then
|
||||
#columnstore core files
|
||||
ulimit -c unlimited > /dev/null 2>&1
|
||||
sysctl -q -w kernel.core_uses_pid=1 > /dev/null 2>&1
|
||||
sysctl -q -w kernel.core_pattern=/var/log/mariadb/columnstore/corefiles/core.%e.%p > /dev/null 2>&1
|
||||
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
moduleName="$(cat /var/lib/columnstore/local/module)"
|
||||
echo "Starting module $moduleName of MariaDB Columnstore Database Platform"
|
||||
rm -f ${tmpDir}/StopColumnstore
|
||||
exec columnstore_run.sh -l ${tmpDir} ProcMon > /dev/null 2>&1 &
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
stop() {
|
||||
moduleName="$(cat /var/lib/columnstore/local/module)"
|
||||
echo "Stopping module $moduleName of MariaDB Columnstore Database Platform"
|
||||
touch ${tmpDir}/StopColumnstore
|
||||
mcsadmin stopModule $moduleName y
|
||||
RETVAL=$?
|
||||
rm -f $lockdir/columnstore
|
||||
fuser -k 8604/tcp > /dev/null 2>&1
|
||||
# Test we are using systemd
|
||||
systemctl cat mariadb.service > /dev/null 2>&1
|
||||
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||
systemctl stop mariadb.service > /dev/null 2>&1
|
||||
else
|
||||
pkill mysqld
|
||||
fi
|
||||
pkill ProcMon
|
||||
pkill ProcMgr
|
||||
return $RETVAL
|
||||
}
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
status() {
|
||||
isrunning=0
|
||||
if [ $EUID -eq 0 ]; then
|
||||
if [ -f $lockdir/columnstore ]; then
|
||||
isrunning=1
|
||||
fi
|
||||
else
|
||||
pgrep ProcMon >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
isrunning=1
|
||||
fi
|
||||
fi
|
||||
if [ $isrunning -ne 0 ]; then
|
||||
echo "MariaDB Columnstore is running"
|
||||
else
|
||||
echo "MariaDB Columnstore is not running"
|
||||
exit 3
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
[ -f $lockdir/columnstore ] && restart || :
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
@ -3,13 +3,13 @@
|
||||
# as part of the package installation
|
||||
#
|
||||
|
||||
/var/log/mariadb/columnstore/*.log {
|
||||
@ENGINE_LOGDIR@/*.log {
|
||||
missingok
|
||||
rotate 7
|
||||
daily
|
||||
dateext
|
||||
copytruncate
|
||||
olddir /var/log/mariadb/columnstore/archive
|
||||
olddir @ENGINE_LOGDIR@/archive
|
||||
su root root
|
||||
}
|
||||
@ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml {
|
||||
|
@ -1,8 +1,8 @@
|
||||
# MariaDB Columnstore Database Platform Logging
|
||||
$FileOwner @DEFAULT_USER@
|
||||
$FileGroup @DEFAULT_GROUP@
|
||||
local1.=crit -/var/log/mariadb/columnstore/crit.log
|
||||
local1.=err -/var/log/mariadb/columnstore/err.log
|
||||
local1.=warning -/var/log/mariadb/columnstore/warning.log
|
||||
local1.=info -/var/log/mariadb/columnstore/info.log
|
||||
local1.=debug -/var/log/mariadb/columnstore/debug.log
|
||||
local1.=crit -@ENGINE_LOGDIR@/crit.log
|
||||
local1.=err -@ENGINE_LOGDIR@/err.log
|
||||
local1.=warning -@ENGINE_LOGDIR@/warning.log
|
||||
local1.=info -@ENGINE_LOGDIR@/info.log
|
||||
local1.=debug -@ENGINE_LOGDIR@/debug.log
|
||||
|
@ -50,7 +50,7 @@ columnstoreSyslogFile=@ENGINE_SUPPORTDIR@/columnstoreSyslog
|
||||
columnstoreSyslogFile7=@ENGINE_SUPPORTDIR@/columnstoreSyslog7
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`@ENGINE_BINDIR@/mcsGetConfig SystemConfig SystemTempFileDir`
|
||||
tmpDir=@ENGINE_LOGDIR@/install
|
||||
|
||||
checkSyslog() {
|
||||
#check which syslog daemon is being used
|
||||
@ -159,16 +159,16 @@ fi
|
||||
}
|
||||
|
||||
makeDir() {
|
||||
if [ ! -d /var/log/mariadb/columnstore ]; then
|
||||
mkdir -p /var/log/mariadb/columnstore >/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/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
if [ ! -d @ENGINE_LOGDIR@ ]; then
|
||||
mkdir -p @ENGINE_LOGDIR@ >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/archive || mkdir @ENGINE_LOGDIR@/archive >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/corefiles || mkdir @ENGINE_LOGDIR@/corefiles >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/trace || mkdir @ENGINE_LOGDIR@/trace >/dev/null 2>&1
|
||||
chown $username:$groupname -R /var/log/mariadb
|
||||
else
|
||||
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/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/archive || mkdir @ENGINE_LOGDIR@/archive >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/corefiles || mkdir @ENGINE_LOGDIR@/corefiles >/dev/null 2>&1
|
||||
test -d @ENGINE_LOGDIR@/trace || mkdir @ENGINE_LOGDIR@/trace >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
@ -220,19 +220,18 @@ if [ ! -z "$syslog_conf" ] ; then
|
||||
fi
|
||||
|
||||
#log install message and find the least permission that allows logging to work
|
||||
CHMOD_LIST=("750" "770" "775" "777")
|
||||
CHMOD_LIST=("755" "775" "777")
|
||||
for CHMOD in "${CHMOD_LIST[@]}"; do
|
||||
chmod $CHMOD /var/log/mariadb
|
||||
chmod $CHMOD /var/log/mariadb/columnstore
|
||||
chmod $CHMOD /var/log/mariadb/columnstore/archive
|
||||
chmod $CHMOD /var/log/mariadb/columnstore/corefiles
|
||||
chmod $CHMOD /var/log/mariadb/columnstore/trace
|
||||
chmod $CHMOD @ENGINE_LOGDIR@
|
||||
chmod $CHMOD @ENGINE_LOGDIR@/archive
|
||||
chmod $CHMOD @ENGINE_LOGDIR@/corefiles
|
||||
chmod $CHMOD @ENGINE_LOGDIR@/trace
|
||||
|
||||
. columnstore_functions
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib cplogger -i 19 "***** MariaDB Columnstore Installed *****"
|
||||
cplogger -i 19 "***** MariaDB Columnstore Installed *****"
|
||||
|
||||
if [ -f /var/log/mariadb/columnstore/info.log ]; then
|
||||
if [ -s /var/log/mariadb/columnstore/info.log ]; then
|
||||
if [ -f @ENGINE_LOGDIR@/info.log ]; then
|
||||
if [ -s @ENGINE_LOGDIR@/info.log ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
@ -290,7 +289,7 @@ check() {
|
||||
number=$RANDOM
|
||||
cplogger -i 104 "MariaDB Columnstore Log Test: $number"
|
||||
sleep 3
|
||||
egrep -qs "MariaDB Columnstore Log Test: $number" /var/log/mariadb/columnstore/info.log
|
||||
egrep -qs "MariaDB Columnstore Log Test: $number" @ENGINE_LOGDIR@/info.log
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "MariaDB Columnstore System Logging working"
|
||||
exit 0
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
# prevent nodes using shared storage manager from stepping on each other when initializing
|
||||
# flock will open up an exclusive file lock to run atomic operations
|
||||
exec {fd_lock}>/var/lib/columnstore/storagemanager/storagemanager-lock
|
||||
exec {fd_lock}>@ENGINE_DATADIR@/storagemanager/storagemanager-lock
|
||||
flock -n "$fd_lock" || exit 0
|
||||
|
||||
# pass in arg of 1 to start DBRM_Worker1
|
||||
@ -15,7 +15,7 @@ flock -n "$fd_lock" || exit 0
|
||||
/bin/systemctl start mcs-exemgr
|
||||
/bin/systemctl start mcs-dmlproc
|
||||
/bin/systemctl start mcs-ddlproc
|
||||
su -s /bin/sh -c '@ENGINE_BINDIR@/dbbuilder 7' @DEFAULT_USER@ 1> /tmp/columnstore_tmp_files/dbbuilder.log
|
||||
su -s /bin/sh -c '@ENGINE_BINDIR@/dbbuilder 7' @DEFAULT_USER@ 1> @ENGINE_LOGDIR@/install/dbbuilder.log
|
||||
|
||||
flock -u "$fd_lock"
|
||||
|
||||
|
Reference in New Issue
Block a user