1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-520 - remove sudo work and cleanup

This commit is contained in:
David Hill
2018-09-20 09:37:07 -05:00
parent c7d3dc173e
commit bf13a50800
54 changed files with 38 additions and 15751 deletions

View File

@@ -1,7 +1,5 @@
#!/bin/bash
NO_NONROOT_SUDO=yes
export NO_NONROOT_SUDO
prefix=/usr/local
builddir=
for arg in "$@"; do

View File

@@ -65,11 +65,11 @@ if (EXISTS "/etc/debian_version")
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
endif ()
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1")
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5")
else()
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools")
endif ()
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs")

View File

@@ -1,480 +0,0 @@
#!/bin/sh
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
# MySQL daemon start/stop script.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 64 36
# description: A very fast and reliable SQL database engine.
# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
# If you install MySQL on some other places than /usr/local/Calpont/mysql, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
# - Create a /etc/my.cnf file with the following information:
# [mysqld]
# basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
# and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
# below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=/usr/local/Calpont/mysql
datadir=/usr/local/Calpont/mysql/db
# Default value, in seconds, afterwhich the script should timeout waiting
# for server start.
# Value here is overriden by value in my.cnf.
# 0 means don't wait at all
# Negative numbers mean to wait indefinitely
service_startup_timeout=30
# Lock directory for RedHat / SuSE.
lockdir='/var/lock/subsys'
lock_file_path="$lockdir/mysql-Columnstore"
# The following variables are only set for letting mysql.server find things.
# Set some defaults
mysqld_pid_file_path=
if test -z "$basedir"
then
basedir=/usr/local/Calpont/mysql
bindir=/usr/local/bin
if test -z "$datadir"
then
datadir=/var/lib/mysql
fi
sbindir=/usr/local/sbin
libexecdir=/usr/local/sbin
else
bindir="$basedir/bin"
if test -z "$datadir"
then
datadir="$basedir/data"
fi
sbindir="$basedir/sbin"
if test -f "$basedir/sbin/mysqld"
then
libexecdir="$basedir/sbin"
else
libexecdir="$basedir/libexec"
fi
fi
# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set=
#
# Use LSB init script functions for printing messages, if possible
#
lsb_functions="/lib/lsb/init-functions"
if test -f $lsb_functions ; then
. $lsb_functions
else
# Include non-LSB RedHat init functions to make systemctl redirect work
init_functions="/etc/init.d/functions"
if test -f $init_functions; then
. $init_functions
fi
log_success_msg()
{
echo " SUCCESS! $@"
}
log_failure_msg()
{
echo " ERROR! $@"
}
fi
PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH
mode=$1 # start or stop
[ $# -ge 1 ] && shift
case `echo "testing\c"`,`echo -n testing` in
*c*,-n*) echo_n= echo_c= ;;
*c*,*) echo_n=-n echo_c= ;;
*) echo_n= echo_c='\c' ;;
esac
parse_server_arguments() {
for arg do
case "$arg" in
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
bindir="$basedir/bin"
if test -z "$datadir_set"; then
datadir="$basedir/data"
fi
sbindir="$basedir/sbin"
if test -f "$basedir/sbin/mysqld"
then
libexecdir="$basedir/sbin"
else
libexecdir="$basedir/libexec"
fi
#libexecdir="$basedir/libexec"
;;
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
datadir_set=1
;;
--log-basename=*|--hostname=*|--loose-log-basename=*)
mysqld_pid_file_path=`echo "$arg.pid" | sed -e 's/^[^=]*=//'`
;;
--pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}
# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
if test -x ./bin/my_print_defaults
then
print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults
then
print_defaults="$bindir/mysql_print_defaults"
else
# Try to find basedir in /etc/my.cnf
conf=/etc/my.cnf
print_defaults=
if test -r $conf
then
subpat='^[^=]*basedir[^=]*=\(.*\)$'
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
for d in $dirs
do
d=`echo $d | sed -e 's/[ ]//g'`
if test -x "$d/bin/my_print_defaults"
then
print_defaults="$d/bin/my_print_defaults"
break
fi
if test -x "$d/bin/mysql_print_defaults"
then
print_defaults="$d/bin/mysql_print_defaults"
break
fi
done
fi
# Hope it's in the PATH ... but I doubt it
test -z "$print_defaults" && print_defaults="my_print_defaults"
fi
#
# Read defaults file from 'basedir'. If there is no defaults file there
# check if it's in the old (depricated) place (datadir) and read it from there
#
extra_args=""
if test -r "$basedir/my.cnf"
then
extra_args="-e $basedir/my.cnf"
else
if test -r "$datadir/my.cnf"
then
extra_args="-e $datadir/my.cnf"
fi
fi
parse_server_arguments `$print_defaults $extra_args --mysqld mysql.server`
parse_server_arguments "$@"
# wait for the pid file to disappear
wait_for_gone () {
pid="$1" # process ID of the program operating on the pid-file
pid_file_path="$2" # path to the PID file.
i=0
crash_protection="by checking again"
while test $i -ne $service_startup_timeout ; do
if kill -0 "$pid" 2>/dev/null; then
: # the server still runs
else
if test ! -s "$pid_file_path"; then
# no server process and no pid-file? great, we're done!
log_success_msg
return 0
fi
# pid-file exists, the server process doesn't.
# it must've crashed, and mysqld_safe will restart it
if test -n "$crash_protection"; then
crash_protection=""
sleep 5
continue # Check again.
fi
kill_by_pid
# Cannot help it
log_failure_msg "The server quit without updating PID file ($pid_file_path)."
return 1 # not waiting any more.
fi
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
done
log_failure_msg
return 1
}
wait_for_ready () {
i=0
while test $i -ne $service_startup_timeout ; do
if $bindir/mysqladmin ping --socket=/usr/local/Calpont/mysql/lib/mysql/mysql.sock >/dev/null 2>&1; then
log_success_msg
return 0
elif kill -0 $! 2>/dev/null ; then
: # mysqld_safe is still running
else
# mysqld_safe is no longer running, abort the wait loop
break
fi
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
done
log_failure_msg
return 1
}
#
# Set pid file if not given
#
if test -z "$mysqld_pid_file_path"
then
mysqld_pid_file_path=$datadir/`hostname`.pid
else
case "$mysqld_pid_file_path" in
/* ) ;;
* ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
esac
fi
# source other config files
[ -f /etc/default/mysql ] && . /etc/default/mysql
[ -f /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql
[ -f /etc/conf.d/mysql ] && . /etc/conf.d/mysql
kill_by_pid() {
# let's see if we can kill the 2 mysql procs by hand
# get the our mysql from ps
eval $(ps -ef | grep "$COLUMNSTORE_INSTALL_DIR/mysql//sbin/mysqld" | grep -v grep | head -1 | awk '{printf "pid=%d\n", $2}')
if [ -n "$pid" ]; then
ppid=$(ps -o ppid= -p $pid)
$SUDO kill -9 $ppid
kill -9 $ppid
sleep 1
$SUDO kill -9 $pid
kill -9 $pid
echo $echo_n "Force shutting down (no/bad pid file)"
log_success_msg
exit 0
fi
return
}
case "$mode" in
'start')
# Start daemon
# Safeguard (relative paths, core dumps..)
cd $basedir
echo $echo_n "Starting MySQL"
if test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "--ledir=$libexecdir" "$@" >/dev/null 2>&1 &
wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE
if test -w "$lockdir"
then
touch "$lock_file_path"
fi
exit $return_value
else
log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
fi
;;
'stop')
# Stop daemon. We use a signal here to avoid having to know the
# root password.
if test -s "$mysqld_pid_file_path"
then
mysqld_pid=`cat "$mysqld_pid_file_path"`
if (kill -0 $mysqld_pid 2>/dev/null)
then
echo $echo_n "Shutting down MySQL"
kill $mysqld_pid
# mysqld should remove the pid file when it exits, so wait for it.
wait_for_gone $mysqld_pid "$mysqld_pid_file_path"; return_value=$?
else
log_failure_msg "MySQL server process #$mysqld_pid is not running!"
rm "$mysqld_pid_file_path"
fi
# Delete lock for RedHat / SuSE
if test -f "$lock_file_path"
then
rm -f "$lock_file_path"
fi
exit $return_value
else
kill_by_pid
log_failure_msg "MySQL server PID file could not be found!"
fi
;;
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
if $0 stop "$@"; then
if ! $0 start "$@"; then
log_failure_msg "Failed to restart server."
exit 1
fi
else
log_failure_msg "Failed to stop running server, so refusing to try to start."
exit 1
fi
;;
'reload'|'force-reload')
if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path"
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
touch "$mysqld_pid_file_path"
else
log_failure_msg "MySQL PID file could not be found!"
exit 1
fi
;;
'status')
# First, check to see if pid file exists
if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path"
if kill -0 $mysqld_pid 2>/dev/null ; then
log_success_msg "MySQL running ($mysqld_pid)"
exit 0
else
log_failure_msg "MySQL is not running, but PID file exists"
exit 1
fi
else
# Try to find appropriate mysqld process
mysqld_pid=`pidof $libexecdir/mysqld`
# test if multiple pids exist
pid_count=`echo $mysqld_pid | wc -w`
if test $pid_count -gt 1 ; then
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
exit 5
elif test -z $mysqld_pid ; then
if test -f "$lock_file_path" ; then
log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
exit 2
fi
log_failure_msg "MySQL is not running"
exit 3
else
log_failure_msg "MySQL is running but PID file could not be found"
exit 4
fi
fi
;;
'configtest')
# Safeguard (relative paths, core dumps..)
cd $basedir
echo $echo_n "Testing MySQL configuration syntax"
daemon=$bindir/mysqld
if test -x $libexecdir/mysqld
then
daemon=$libexecdir/mysqld
elif test -x $sbindir/mysqld
then
daemon=$sbindir/mysqld
elif test -x `which mysqld`
then
daemon=`which mysqld`
else
log_failure_msg "Unable to locate the mysqld binary!"
exit 1
fi
help_out=`$daemon --help 2>&1`; r=$?
if test "$r" != 0 ; then
log_failure_msg "$help_out"
log_failure_msg "There are syntax errors in the server configuration. Please fix them!"
else
log_success_msg "Syntax OK"
fi
exit $r
;;
'bootstrap')
if test "$_use_systemctl" == 1 ; then
log_failure_msg "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
exit 1
fi
# Bootstrap the cluster, start the first node
# that initiate the cluster
echo $echo_n "Bootstrapping the cluster.. "
$0 start $other_args --wsrep-new-cluster
exit $?
;;
*)
# usage
basename=`basename "$0"`
echo "Usage: $basename {start|stop|restart|reload|force-reload|status|configtest|bootstrap} [ MySQL server options ]"
exit 1
;;
esac
exit 0

View File

@@ -1,13 +0,0 @@
# InfiniDB Alias Commands
#
alias mcsmysql='/usr/local/Calpont/mysql/bin/mysql --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root'
alias ma=/usr/local/Calpont/bin/mcsadmin
alias mcsadmin=/usr/local/Calpont/bin/mcsadmin
alias home='cd /usr/local/mariadb/columnstore'
alias log='cd /var/log/mariadb/columnstore/'
alias core='cd /var/log/mariadb/columnstore/corefiles'
alias tmsg='tail -f /var/log/messages'
alias tdebug='tail -f /var/log/mariadb/columnstore/debug.log'
alias tinfo='tail -f /var/log/mariadb/columnstore/info.log'
alias dbrm='cd /usr/local/Calpont/data1/systemFiles/dbrm'
alias module='cat /usr/local/Calpont/local/module'

View File

@@ -1,167 +0,0 @@
#!/usr/bin/expect
#
# $Id$
#
# Install Package on system
set timeout 30
set USERNAME "root"
set RPMVERSION " "
set PASSWORD " "
set MYSQLPASSWORD dummymysqlpw
set PACKAGE " "
set CONFIGFILE " "
set DEBUG 0
set NODEPS "-h"
set INSTALLDIR "/usr/local/mariadb/columnstore"
spawn -noecho /bin/bash
for {set i 0} {$i<[llength $argv]} {incr i} {
set arg($i) [lindex $argv $i]
}
set i 0
while true {
if { $i == [llength $argv] } { break }
if { $arg($i) == "-h" } {
send_user "\n"
send_user "'calpontInstaller.sh' performs a system install of the Calpont InfiniDB Packages\n"
send_user "from the /root/ directory. These Packages would have already been installed\n"
send_user "on the local Module.\n"
send_user "Usage: calpontInstaller.sh -v 'infinidb-version' -p 'password' -t 'package-type' -c 'config-file'-m 'mysql-password' -d\n"
send_user " infinidb-version - InfiniDB Version, i.e. 1.0.0-1\n"
send_user " password - root password on the servers being installed'\n"
send_user " package-type - Package Type being installed (rpm, deb, or binary)\n"
send_user " config-file - Optional: Columnstore.xml config file with directory location, i.e. /root/Columnstore.xml\n"
send_user " Default version is $INSTALLDIR/etc/Columnstore.xml.rpmsave\n"
send_user " mysql-password - MySQL password on the servers being installed'\n"
send_user " -d - Debug flag, output verbose information\n"
exit 0
} elseif { $arg($i) == "-v" } {
incr i
set RPMVERSION $arg($i)
} elseif { $arg($i) == "-p" } {
incr i
set PASSWORD $arg($i)
} elseif { $arg($i) == "-t" } {
incr i
set PACKAGE $arg($i)
} elseif { $arg($i) == "-c" } {
incr i
set CONFIGFILE $arg($i)
} elseif { $arg($i) == "-d" } {
set DEBUG 1
} elseif { $arg($i) == "-f" } {
set NODEPS "--nodeps"
} elseif { $arg($i) == "-m" } {
incr i
set MYSQLPASSWORD $arg($i)
} elseif { $arg($i) == "-i" } {
incr i
set INSTALLDIR $arg($i)
} elseif { $arg($i) == "-u" } {
incr i
set USERNAME $arg($i)
}
incr i
}
log_user $DEBUG
set timeout 2
send "$INSTALLDIR/bin/infinidb status\n"
expect {
"is running" { puts "InfiniDB is running, can't run calpontInstall.sh while InfiniDB is running. Exiting..\n";
exit 1
}
}
if { $CONFIGFILE == " " } {
set CONFIGFILE $INSTALLDIR/etc/Columnstore.xml.rpmsave
}
if { [catch { open $CONFIGFILE "r"} handle ] } {
puts "Calpont Config file not found: $CONFIGFILE"; exit 1
}
exec rm -f $INSTALLDIR/etc/Columnstore.xml.new > /dev/null 2>&1
exec mv -f $INSTALLDIR/etc/Columnstore.xml $INSTALLDIR/etc/Columnstore.xml.new > /dev/null 2>&1
exec /bin/cp -f $CONFIGFILE $INSTALLDIR/etc/Columnstore.xml > /dev/null 2>&1
set timeout 2
set INSTALL 2
send "$INSTALLDIR/bin/getConfig DBRM_Controller NumWorkers\n"
expect {
1 { set INSTALL 1
set PASSWORD "dummy"
set RPMVERSION "rpm" }
}
if { $INSTALL == "2" && $PASSWORD == " "} {puts "please enter the remote server root password, enter ./calpontInstaller.sh -h for additional info"; exit 1}
if { $INSTALL == "2" && $RPMVERSION == " " } {puts "please enter Package version, enter ./calpontInstaller.sh -h for additional info"; exit 1}
send_user "\n"
if { $INSTALL == "2" } {
if { $PACKAGE == "rpm" } {
set CALPONTPACKAGE1 /root/infinidb-libs-$RPMVERSION*.rpm
set CALPONTPACKAGE2 /root/infinidb-platform-$RPMVERSION*.rpm
set CALPONTPACKAGE3 /root/infinidb-enterprise-$RPMVERSION*.rpm
set CONNECTORPACKAGE1 /root/infinidb-mysql-$RPMVERSION*.rpm
set CONNECTORPACKAGE2 /root/infinidb-storage-engine-$RPMVERSION*.rpm
send_user "Installing InfiniDB Packages: $CALPONTPACKAGE1, $CALPONTPACKAGE2, $CALPONTPACKAGE3, $CONNECTORPACKAGE1, $CONNECTORPACKAGE2\n\n"
set EEPKG "rpm"
} elseif { $PACKAGE == "deb" } {
set CALPONTPACKAGE1 /root/infinidb-libs_$RPMVERSION*.deb
set CALPONTPACKAGE2 /root/infinidb-platform_$RPMVERSION*.deb
set CALPONTPACKAGE3 /root/infinidb-enterprise_$RPMVERSION*.deb
set CONNECTORPACKAGE1 /root/infinidb-mysql_$RPMVERSION*.deb
set CONNECTORPACKAGE2 /root/infinidb-storage-engine_$RPMVERSION*.deb
send_user "Installing InfiniDB Packages: $CALPONTPACKAGE1, $CALPONTPACKAGE2, $CALPONTPACKAGE3, $CONNECTORPACKAGE1, $CONNECTORPACKAGE2\n\n"
set EEPKG "deb"
} elseif { $PACKAGE == "binary" } {
set CALPONTPACKAGE /root/infinidb-ent-$RPMVERSION*bin.tar.gz
set CONNECTORPACKAGE1 "nopkg"
set CONNECTORPACKAGE2 "nopkg"
send_user "Installing InfiniDB Package: $CALPONTPACKAGE\n\n"
set EEPKG "binary"
} else {
puts "please enter Valid Package Type, enter ./calpontInstaller.sh -h for additional info"; exit 1
}
} else {
set CALPONTPACKAGE1 "dummy.rpm"
set CALPONTPACKAGE2 "dummy.rpm"
set CALPONTPACKAGE3 "dummy.rpm"
set CONNECTORPACKAGE1 "dummy.rpm"
set CONNECTORPACKAGE2 "dummy.rpm"
set EEPKG "rpm"
}
send_user "Performing InfiniDB System Install, please wait...\n"
send "$INSTALLDIR/bin/setConfig -d Installation EEPackageType $EEPKG\n"
expect {
-re {[$#] } { }
}
send_user "\n"
set timeout 600
#
# Run installer
#
send "$INSTALLDIR/bin/installer $CALPONTPACKAGE1 $CALPONTPACKAGE2 $CALPONTPACKAGE3 $CONNECTORPACKAGE1 $CONNECTORPACKAGE2 initial $PASSWORD n $NODEPS $MYSQLPASSWORD $DEBUG\n"
expect {
"InfiniDB Install Successfully Completed" { }
"ERROR" { send_user "FAILED: error returned from installer, execute with debug mode on to determine error\n" ; exit 1 }
"Enter MySQL password" { send_user "FAILED: a MySQL password is set\n" ; exit 1 }
timeout { send_user "FAILED: Timeout while running installer, execute with debug mode on to determine error\n" ; exit 1 }
}
send_user "\nCalpont Package System Install Completed\n\n"
exit 0
# vim:ts=4 sw=4:

View File

@@ -1,35 +0,0 @@
#
# Calpont Log Rotate file that gets installed in /etc/logrotate.d
# as part of the RPM installation
#
/var/log/mariadb/columnstore/*.log {
missingok
rotate 7
daily
dateext
copytruncate
olddir /var/log/mariadb/columnstore/archive
}
/var/log/mariadb/columnstore/*.log1 {
missingok
rotate 7
daily
nocreate
compress
olddir /var/log/mariadb/columnstore/archive
}
/usr/local/Calpont/etc/Columnstore.xml {
daily
dateext
copy
olddir /usr/local/Calpont/etc/
}
/usr/local/Calpont/mysql/db/*.err {
missingok
rotate 7
daily
dateext
copytruncate
olddir /usr/local/Calpont/mysql/db
}

View File

@@ -1,6 +0,0 @@
# Calpont Database Platform Logging
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

View File

@@ -1,67 +0,0 @@
# MariaDB Columnstore Database Platform Logging
source s_columnstore {
# message generated by Syslog-NG
internal();
# standard Linux log source (this is the default place for the syslog()
# function to send logs to)
unix-stream("/dev/log");
# messages from the kernel
file("/proc/kmsg" log_prefix("kernel: "));
# use the following line if you want to receive remote UDP logging messages
# (this is equivalent to the "-r" syslogd flag)
# udp();
};
filter f_local1crit { facility(local1) and level(crit); };
filter f_local1err { facility(local1) and level(err); };
filter f_local1warning { facility(local1) and level(warning); };
filter f_local1info { facility(local1) and level(info); };
filter f_local1debug { facility(local1) and level(debug); };
destination d_crit{
file("/var/log/mariadb/columnstore/crit.log");
};
destination d_err{
file("/var/log/mariadb/columnstore/err.log");
};
destination d_warning{
file("/var/log/mariadb/columnstore/warning.log");
};
destination d_info{
file("/var/log/mariadb/columnstore/info.log");
};
destination d_debug{
file("/var/log/mariadb/columnstore/debug.log");
};
log{
source(s_columnstore);
filter(f_local1crit);
destination(d_crit);
};
log{
source(s_columnstore);
filter(f_local1err);
destination(d_err);
};
log{
source(s_columnstore);
filter(f_local1warning);
destination(d_warning);
};
log{
source(s_columnstore);
filter(f_local1info);
destination(d_info);
};
log{
source(s_columnstore);
filter(f_local1debug);
destination(d_debug);
};

View File

@@ -1,7 +0,0 @@
# MariaDB Columnstore Database Platform Logging
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

View File

@@ -1,118 +0,0 @@
#!/usr/bin/expect
#
# $Id$
#
# Uninstall Package from system
set COLUMNSTORE_INSTALL_DIR "/usr/local/mariadb/columnstore"
set env(COLUMNSTORE_INSTALL_DIR) $COLUMNSTORE_INSTALL_DIR
set USERNAME $env(USER)
set PASSWORD " "
set DEBUG 0
set INFINIDBRPM1 "infinidb-libs"
set INFINIDBRPM2 "infinidb-platform"
set INFINIDBRPM3 "infinidb-enterprise"
set CONNECTORRPM1 "infinidb-mysql"
set CONNECTORRPM2 "infinidb-storage-engine"
spawn -noecho /bin/bash
for {set i 0} {$i<[llength $argv]} {incr i} {
set arg($i) [lindex $argv $i]
}
set i 0
while true {
if { $i == [llength $argv] } { break }
if { $arg($i) == "-h" } {
send_user "\n"
send_user "'calpontUninstall.sh' performs a system uninstall of the Calpont InfiniDB Packages.\n"
send_user "It will perform a shutdown of the InfiniDB software and the \n"
send_user "remove the Packages from all configured servers of the InfiniDB System.\n"
send_user "\n"
send_user "Usage: calpontUninstall.sh -p 'password' -d\n"
send_user " password - root password of the remote servers being un-installed'\n"
send_user " -d - Debug flag, output verbose information\n"
exit
} elseif { $arg($i) == "-p" } {
incr i
set PASSWORD $arg($i)
} elseif { $arg($i) == "-d" } {
set DEBUG 1
} elseif { $arg($i) == "-i" } {
incr i
set INSTALLDIR $arg($i)
} elseif { $arg($i) == "-u" } {
incr i
set USERNAME $arg($i)
}
incr i
}
log_user $DEBUG
set timeout 2
set INSTALL 2
send "$COLUMNSTORE_INSTALL_DIR/bin/getConfig DBRM_Controller NumWorkers\n"
expect {
1 { set INSTALL 1 }
}
set PACKAGE "rpm"
send "$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation EEPackageType\n"
expect {
rpm { set PACKAGE rpm }
deb { set PACKAGE deb }
binary { set PACKAGE binary }
}
set timeout 60
log_user $DEBUG
if { $INSTALL == "2" && $PASSWORD == " "} {puts "please enter the remote server root password, enter ./calpontUninstall.sh -h for additional info"; exit -1}
send_user "\nPerforming InfiniDB System Uninstall\n\n"
#
# shutdownSystem
#
send_user "Shutdown InfiniDB System "
expect -re {[$#] }
send "$COLUMNSTORE_INSTALL_DIR/bin/mcsadmin shutdownsystem y\n"
expect {
"shutdownSystem " { send_user "DONE" }
}
send_user "\n"
if { $INSTALL == "2"} {
set timeout 600
#
# Run installer
#
send_user "Run System Uninstaller "
send "$COLUMNSTORE_INSTALL_DIR/bin/installer $INFINIDBRPM1 $INFINIDBRPM2 $INFINIDBRPM3 $CONNECTORRPM1 $CONNECTORRPM2 uninstall $PASSWORD n --nodeps dummymysqlpw $DEBUG\n"
expect {
"uninstall request successful" { send_user "DONE" }
"ERROR" { send_user "FAILED" ; exit -1 }
}
send_user "\n"
}
if { $PACKAGE == "binary" } {
send "$COLUMNSTORE_INSTALL_DIR/bin/pre-uninstall\n"
expect {
-re {[$#] } { }
}
send_user "\n"
send_user "\nCalpont Package System Uninstall Completed\n\n"
exit 0
}
send_user "\nCalpont Package System Uninstall Completed\n\n"
exit 0

View File

@@ -1,82 +0,0 @@
#!/bin/bash
#
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_configReport.txt
{
echo " "
echo "******************** Configuration/Status Report for ${MODULE} ********************"
echo " "
systemctl=`which systemctl 2>/dev/null`
if [ -n "$systemctl" ]; then
echo "-- systemctl configuration --"
echo " "
echo "################# systemctl list-unit-files --type=service | grep columnstore #################"
echo " "
$SUDO systemctl list-unit-files --type=service | grep columnstore 2>/dev/null
else
chkconfig=`which chkconfig 2>/dev/null`
if [ -n "$chkconfig" ]; then
echo "-- chkconfig configuration --"
echo " "
echo "################# chkconfig --list | grep columnstore #################"
echo " "
$SUDO chkconfig --list | grep columnstore 2>/dev/null
else
updaterc=`which update-rc.d 2>/dev/null`
if [ -n "$updaterc" ]; then
echo "-- services configuration --"
echo " "
echo "################# service --status-all | grep columnstore #################"
echo " "
$SUDO service --status-all | grep columnstore 2>/dev/null
fi
fi
fi
echo " "
echo "-- fstab Configuration --"
echo " "
echo "################# cat /etc/fstab #################"
echo " "
$SUDO cat /etc/fstab 2>/dev/null
echo " "
echo "-- Server Processes --"
echo " "
echo "################# ps axu #################"
echo " "
$SUDO ps axu
echo " "
echo "-- Server Processes with resource usage --"
echo " "
echo "################# top -b -n 1 #################"
echo " "
$SUDO top -b -n 1
} > /tmp/${MODULE}_configReport.txt
exit 0

View File

@@ -1,178 +0,0 @@
#!/bin/bash
#
# $Id: infinidb 3704 2013-08-07 03:33:20Z bwilkinson $
#
# infinidb Starts Calpont InfiniDB database platform
#
#
# chkconfig: 2345 99 99
# description: Calpont InfiniDB is a database platform that utilizes Mysql
#
### BEGIN INIT INFO
# Provides: infinidb
# 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 InfiniDB DW DBMS
### END INIT INFO
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
test -f /etc/default/infinidb && . /etc/default/infinidb
fi
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
COLUMNSTORE_INSTALL_DIR=/usr/local/Calpont
fi
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
InstallDir=$COLUMNSTORE_INSTALL_DIR
if [ $InstallDir != "/usr/local/Calpont" ]; then
export PATH=$InstallDir/bin:$InstallDir/mysql/bin:/bin:/usr/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$InstallDir/lib:$InstallDir/mysql/lib/mysql
fi
#hadoop
plugin=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
if [ -n "$plugin" ]; then
setenv=`$InstallDir/bin/getConfig SystemConfig DataFileEnvFile`
. $InstallDir/bin/$setenv >/dev/null 2>&1
fi
test -f $InstallDir/post/functions && . $InstallDir/post/functions
mt=`module_type`
mid=`module_id`
has_um=`$InstallDir/bin/getConfig SystemModuleConfig ModuleCount2`
if [ "x$has_um" = x ]; then
has_um=0
fi
user=$USER
if [ -z "$user" ]; then
user=root
fi
checkInstallSetup() {
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/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 /var/lock/subsys/infinidb
exit 1
fi
}
[ -f $InstallDir/bin/ProcMon ] || exit 0
start() {
if [ -f /var/lock/subsys/infinidb ]; then
echo "InfiniDB Database Platform already running"
exit 0
fi
(mkdir -p /var/lock/subsys && touch /var/lock/subsys/infinidb) >/dev/null 2>&1
if [ -x $InstallDir/bin/infinidb.pre-start ]; then
$InstallDir/bin/infinidb.pre-start
if [ $? -ne 0 ]; then
echo "Error running InfiniDB pre-start script, not starting InfiniDB"
rm -f /var/lock/subsys/infinidb
exit 1
fi
fi
checkInstallSetup
CoreFileFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation CoreFileFlag`
if [ $CoreFileFlag = "y" ]; then
SUDO=
if [ "$user" != "root" ]; then
SUDO="sudo"
fi
#infinidb core files
$SUDO ulimit -c unlimited > /dev/null 2>&1
$SUDO sysctl -q -w kernel.core_uses_pid=1 > /dev/null 2>&1
$SUDO sysctl -q -w kernel.core_pattern=/var/log/mariadb/columnstore/corefiles/core.%e.%p > /dev/null 2>&1
fi
RETVAL=0
echo "Starting InfiniDB Database Platform"
rm -f /tmp/StopCalpont
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
return $RETVAL
}
stop() {
echo "Shutting down InfiniDB Database Platform"
touch /tmp/StopCalpont
pkill -9 ProcMon
pkill -9 ProcMgr
pkill -9 snmptrapd
sleep 1
$InstallDir/bin/clearShm
RETVAL=$?
rm -f /var/lock/subsys/infinidb
fuser -k 8604/tcp > /dev/null 2>&1
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
if [ -x $InstallDir/bin/infinidb.post-stop ]; then
$InstallDir/bin/infinidb.post-stop
fi
return $RETVAL
}
restart() {
stop
start
}
status() {
isrunning=0
if [ $EUID -eq 0 ]; then
if [ -f /var/lock/subsys/infinidb ]; 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 "InfiniDB is running"
else
echo "InfiniDB is not running"
exit 3
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/infinidb ] && restart || :
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $?

View File

@@ -1,2 +0,0 @@
/usr/local/Calpont/lib

View File

@@ -1,9 +0,0 @@
#!/bin/bash
# Copy this file to /etc/default and rename it to 'infinidb'.
# Change this line to your InfiniDB installation directory
COLUMNSTORE_INSTALL_DIR=/usr/local/Calpont
LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib/mysql
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH

View File

@@ -1,16 +0,0 @@
# $Id$
description "Starts the InfiniDB Enterprise Process Monitor"
start on runlevel 2
start on runlevel 3
stop on runlevel 0
stop on runlevel 1
stop on runlevel 4
stop on runlevel 5
stop on runlevel 6
respawn
exec /usr/local/Calpont/bin/ProcMon

View File

@@ -1,48 +0,0 @@
#!/bin/bash
#
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_softwareReport.txt
{
echo " "
echo "******************** Software Report for ${MODULE} ********************"
echo " "
echo " "
echo "-- Columnstore Package Details --"
echo " "
echo "################# mcsadmin getcolumnstoresoftwareinfo #################"
echo " "
$INSTALLDIR/bin/mcsadmin getsoftwareinfo
echo " "
echo "-- Columnstore Storage Configuration --"
echo " "
echo "################# mcsadmin getStorageConfig #################"
echo " "
$INSTALLDIR/bin/mcsadmin getStorageConfig
} > /tmp/${MODULE}_softwareReport.txt
exit 0

View File

@@ -186,7 +186,7 @@ if [ ! -z "$syslog_conf" ] ; then
fi
//set permissions
$SUDO chown $user:$group -R /var/log/mariadb > /dev/null 2>&1
chown $user:$group -R /var/log/mariadb > /dev/null 2>&1
if [ $rsyslog7 == 1 ]; then
rm -f /etc/rsyslog.d/49-columnstore.conf

View File

@@ -1,228 +0,0 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir=".">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpont-console"
CompilerConfigName="Latest Version"
ObjectDir="/home/dhall/genii/oamapps/calpont-console/">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
RunInXterm="1"
ClearProcessBuffer="1">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
ClearProcessBuffer="1"
RunInXterm="1">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpont-console"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
RunInXterm="1"
ClearProcessBuffer="1">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
ClearProcessBuffer="1"
RunInXterm="1">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="calpontConsole.cpp"/>
<F N="tdriver.cpp"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="calpontConsole.h"/>
</Folder>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters="">
<F
N="Makefile"
Type="Makefile"/>
</Folder>
</Files>
</Project>

View File

@@ -1,224 +0,0 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir=".">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpontConsole"
CompilerConfigName="Latest Version"
ObjectDir="/home/dhall/genii/oamapps/calpont-console/">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make install"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
ClearProcessBuffer="1">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpontConsole"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make install"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
ClearProcessBuffer="1">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
ClearProcessBuffer="1">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="../calpontConsole/calpontConsole.cpp"/>
<F N="tdriver.cpp"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="calpontConsole.h"/>
</Folder>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters="">
<F
N="../calpontConsole/Makefile"
Type="Makefile"/>
</Folder>
</Files>
</Project>

View File

@@ -1,48 +0,0 @@
#
# Not used
#
#
#original Makefile.am contents follow:
## Copyright (C) 2014 InfiniDB, Inc.
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 of
## the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
#
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
### Process this file with automake to produce Makefile.in
#
#AM_CPPFLAGS = $(idb_cppflags)
#AM_CFLAGS = $(idb_cflags)
#AM_CXXFLAGS = $(idb_cxxflags)
#AM_LDFLAGS = $(idb_ldflags)
#bin_PROGRAMS = calpontConsole
#calpontConsole_SOURCES = calpontConsole.cpp
#calpontConsole_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
#calpontConsole_LDFLAGS = $(idb_common_ldflags) $(idb_common_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
#
#test:
#
#coverage:
#
#leakcheck:
#
#docs:
#
#bootstrap: install-data-am
#

File diff suppressed because it is too large Load Diff

View File

@@ -1,135 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/******************************************************************************************
* $Id: calpontConsole.h 3071 2013-04-04 18:45:53Z rdempsey $
*
******************************************************************************************/
/**
* @file
*/
#ifndef CALPONTCONSOLE_H
#define CALPONTCONSOLE_H
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <limits.h>
#include <sstream>
#include <exception>
#include <stdexcept>
#include <vector>
#include <stdio.h>
#include <ctype.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <readline/readline.h>
#include <readline/history.h>
#include <time.h>
#include <pthread.h>
#include <errno.h>
#include "liboamcpp.h"
#include "configcpp.h"
#include "alarmmanager.h"
#include "alarmglobal.h"
#include "calpontsystemcatalog.h"
#include "brmtypes.h"
const int CmdSize = 80;
const int ArgNum = 10;
const int DescNumMax = 10;
const int cmdNum = 68;
const std::string DEFAULT_LOG_FILE = "/var/log/mariadb/columnstore/uiCommands.log";
std::ofstream logFile;
/**
* write the command to the log file
*/
void writeLog(std::string command);
/** @brief location of the Process Configuration file
*/
const std::string ConsoleCmdsFile = "ConsoleCmds.xml";
void getFlags(const std::string* arguments, oam::GRACEFUL_FLAG& gracefulTemp, oam::ACK_FLAG& ackTemp, oam::CC_SUSPEND_ANSWER& suspendAnswer, bool& bNeedsConfirm, std::string* password = NULL);
int confirmPrompt(std::string warningCommand);
std::string dataPrompt(std::string promptCommand);
int processCommand(std::string*);
int ProcessSupportCommand(int CommandID, std::string arguments[]);
void printAlarmSummary();
void printCriticalAlarms();
void checkRepeat(std::string*, int);
void printSystemStatus();
void printProcessStatus(std::string port = "ProcStatusControl");
void printModuleCpuUsers(oam::TopProcessCpuUsers topprocesscpuusers);
void printModuleCpu(oam::ModuleCpu modulecpu);
void printModuleMemoryUsers(oam::TopProcessMemoryUsers topprocessmemoryusers);
void printModuleMemory(oam::ModuleMemory modulememory);
void printModuleDisk(oam::ModuleDisk moduledisk);
void printModuleResources(oam::TopProcessCpuUsers topprocesscpuusers, oam::ModuleCpu modulecpu, oam::TopProcessMemoryUsers topprocessmemoryusers, oam::ModuleMemory modulememory, oam::ModuleDisk moduledisk);
void printState(int state, std::string addInfo);
std::string getParentOAMModule();
bool checkForDisabledModules();
oam::CC_SUSPEND_ANSWER AskSuspendQuestion(int CmdID);
class to_lower
{
public:
char operator() (char c) const // notice the return type
{
return tolower(c);
}
};
/** @brief Hidden Support commands in lower-case
*/
const std::string supportCmds[] = { "helpsupport",
"stopprocess",
"startprocess",
"restartprocess",
"killpid",
"rebootsystem",
"rebootnode",
"stopdbrmprocess",
"startdbrmprocess",
"restartdbrmprocess",
"setsystemstartupstate",
"stopprimprocs",
"startprimprocs",
"restartprimprocs",
"stopexemgrs",
"startexemgrs",
"restartexemgrs",
"getprocessstatusstandby",
"distributeconfigfile",
"getpmdbrootconfig",
"getdbrootpmconfig",
"getsystemdbrootconfig",
"checkdbfunctional",
"getsystemreadflags",
"setsystemqueryready",
""
};
#endif

View File

@@ -1,380 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/***************************************************************************
* $Id: tdriver.cpp 3072 2013-04-04 19:04:45Z rdempsey $
*
* dhill@srvengcm1.calpont.com
*
* Purpose: Calpont Console tester
*
***************************************************************************/
#include <stdexcept>
#include <iostream>
using namespace std;
#include <boost/scoped_ptr.hpp>
using namespace boost;
#include <cppunit/extensions/HelperMacros.h>
class GeneralCmdsTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( GeneralCmdsTest );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test3 );
CPPUNIT_TEST( test4 );
CPPUNIT_TEST( test5 );
CPPUNIT_TEST( test6 );
CPPUNIT_TEST( test7 );
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole help > tdriver.output");
}
void test2()
{
system("./calpontConsole ? >> tdriver.output");
}
void test3()
{
system("./calpontConsole help verbose >> tdriver.output");
}
void test4()
{
system("./calpontConsole help getAlarmConfig >> tdriver.output");
}
void test5()
{
system("./calpontConsole exit >> tdriver.output");
}
void test6()
{
system("./calpontConsole quit >> tdriver.output");
}
void test7()
{
system("./calpontConsole system ls -ltr >> tdriver.output");
}
};
class AlarmConfigTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( AlarmConfigTest );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test3 );
CPPUNIT_TEST( test4 );
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole getAlarmConfig >> tdriver.output");
}
void test2()
{
system("./calpontConsole getAlarmConfig 1 >> tdriver.output");
}
void test3()
{
system("./calpontConsole setAlarmConfig 1 Threshold 50 >> tdriver.output");
}
void test4()
{
system("./calpontConsole getAlarmConfig 1 >> tdriver.output");
}
};
class ProcessConfigTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( ProcessConfigTest );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test3 );
CPPUNIT_TEST( test4 );
CPPUNIT_TEST( test5 );
CPPUNIT_TEST( test6 );
CPPUNIT_TEST( test7 );
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole getProcessConfig >> tdriver.output");
}
void test2()
{
system("./calpontConsole getProcessConfig ProcessManager dm1 >> tdriver.output");
}
void test3()
{
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
}
void test4()
{
system("./calpontConsole setProcessConfig ProcessManager dm1 LaunchID 1 >> tdriver.output");
}
void test5()
{
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
}
void test6()
{
system("./calpontConsole setProcessConfig ProcessManager dm1 LaunchID 3 >> tdriver.output");
}
void test7()
{
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
}
};
class ServerConfigTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( ServerConfigTest );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test3 );
CPPUNIT_TEST( test4 );
CPPUNIT_TEST( test5 );
CPPUNIT_TEST( test6 );
CPPUNIT_TEST( test7 );
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole getModuleConfig >> tdriver.output");
}
void test2()
{
system("./calpontConsole getModuleConfig dm1 >> tdriver.output");
}
void test3()
{
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
}
void test4()
{
system("./calpontConsole setModuleConfig dm1 ServerCPUCriticalThreshold 9999 >> tdriver.output");
}
void test5()
{
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
}
void test6()
{
system("./calpontConsole setModuleConfig dm1 ServerCPUCriticalThreshold 9000 >> tdriver.output");
}
void test7()
{
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
}
};
class SystemConfigTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( SystemConfigTest );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test3 );
CPPUNIT_TEST( test4 );
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole getSystemConfig >> tdriver.output");
}
void test2()
{
system("./calpontConsole getSystemConfig SystemVersion >> tdriver.output");
}
void test3()
{
system("./calpontConsole setSystemConfig SystemVersion 2.0.0.0 >> tdriver.output");
}
void test4()
{
system("./calpontConsole getSystemConfig SystemVersion >> tdriver.output");
}
};
class SystemActionTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( SystemActionTest );
CPPUNIT_TEST( test1 ); // valid, but will fail command
CPPUNIT_TEST( test2 ); // valid, but will fail command
CPPUNIT_TEST( test3 ); // valid, but will fail command
CPPUNIT_TEST( test4 ); // valid, but will fail command
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp()
{
}
void tearDown()
{
}
void test1()
{
system("./calpontConsole stopSystem >> tdriver.output");
}
void test2()
{
system("./calpontConsole shutdownSystem >> tdriver.output");
}
void test3()
{
system("./calpontConsole startSystem >> tdriver.output");
}
void test4()
{
system("./calpontConsole restartSystem >> tdriver.output");
}
};
//CPPUNIT_TEST_SUITE_REGISTRATION( SystemActionTest );
CPPUNIT_TEST_SUITE_REGISTRATION( SystemConfigTest );
CPPUNIT_TEST_SUITE_REGISTRATION( ServerConfigTest );
CPPUNIT_TEST_SUITE_REGISTRATION( ProcessConfigTest );
CPPUNIT_TEST_SUITE_REGISTRATION( AlarmConfigTest );
CPPUNIT_TEST_SUITE_REGISTRATION( GeneralCmdsTest );
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
int main( int argc, char** argv)
{
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );
bool wasSuccessful = runner.run( "", false );
return (wasSuccessful ? 0 : 1);
}

View File

@@ -1,49 +0,0 @@
#
# Not used
#
#
#original Makefile.am contents follow:
## Copyright (C) 2014 InfiniDB, Inc.
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 of
## the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
#
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
### Process this file with automake to produce Makefile.in
#
#AM_CPPFLAGS = $(idb_cppflags)
#AM_CFLAGS = $(idb_cflags)
#AM_CXXFLAGS = $(idb_cxxflags)
#AM_LDFLAGS = $(idb_ldflags)
#bin_PROGRAMS = calpontDBWrite
#calpontDBWrite_SOURCES = calpontDB.cpp
#calpontDBWrite_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
#calpontDBWrite_LDFLAGS = $(idb_common_ldflags) $(idb_common_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
#
#test:
#
#coverage:
#
#leakcheck:
#
#docs:
#
#bootstrap: install-data-am
#

View File

@@ -1,162 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/******************************************************************************************
* $Id: calpontDB.cpp 419 2007-07-22 17:18:00Z dhill $
*
******************************************************************************************/
/**
* @file
*/
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <limits.h>
#include <sstream>
#include <exception>
#include <stdexcept>
#include <vector>
#include <stdio.h>
#include <ctype.h>
#include <sys/signal.h>
#include <sys/types.h>
#include "liboamcpp.h"
#include "configcpp.h"
#include "installdir.h"
using namespace std;
using namespace oam;
using namespace config;
namespace
{
void usage(char* prog)
{
cout << endl;
cout << "Usage: " << prog << " [options]" << endl;
cout << endl;
cout << "This utility is used to suspend and resume Calpont Database Writes." << endl;
cout << "Normally this would be done while performing Database Backups and" << endl;
cout << "Restores " << endl;
cout << endl;
cout << "Options:" << endl;
cout << "-c <command> Command: suspend or resume" << endl << endl;
cout << "-h Display this help." << endl << endl;
}
}
int main(int argc, char** argv)
{
string command;
Oam oam;
BRM::DBRM dbrm;
char c;
// Invokes member function `int operator ()(void);'
while ((c = getopt(argc, argv, "c:h")) != -1)
{
switch (c)
{
case 'c':
command = optarg;
break;
case 'h':
usage(argv[0]);
exit(-1);
break;
default:
usage(argv[0]);
exit(1);
break;
}
}
if ( command == "suspend" )
{
try
{
std::vector<BRM::TableLockInfo> tableLocks = dbrm.getAllTableLocks();
if (!tableLocks.empty())
{
oam.DisplayLockedTables(tableLocks, &dbrm);
}
else
{
dbrm.setSystemSuspended(true);
sleep(5);
string cmd = startup::StartUp::installDir() + "/bin/save_brm > /var/log/mariadb/columnstore/save_brm.log1 2>&1";
int rtnCode = system(cmd.c_str());
if (rtnCode == 0)
{
cout << endl << "Suspend Calpont Database Writes Request successfully completed" << endl;
}
else
{
cout << endl << "Suspend Calpont Database Writes Failed: save_brm Failed" << endl;
dbrm.setSystemSuspended(false);
}
}
}
catch (exception& e)
{
cout << endl << "**** Suspend Calpont Database Writes Failed: " << e.what() << endl;
}
catch (...)
{
cout << endl << "**** Suspend Calpont Database Writes Failed" << endl;
}
}
else
{
if ( command == "resume" )
{
try
{
dbrm.setSystemSuspended(false);
cout << endl << "Resume Calpont Database Writes Request successfully completed" << endl;
}
catch (exception& e)
{
cout << endl << "**** Resume Calpont Database Writes Failed: " << e.what() << endl;
}
catch (...)
{
cout << endl << "**** Resume Calpont Database Writes Failed" << endl;
}
}
else
{
cout << "Invalid Command Entered, please try again" << endl;
exit(-1);
}
}
exit(0);
}

View File

@@ -1,216 +0,0 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir=".">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpontDBWrite"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine="make"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdcalpontDBWrite"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine="make"/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="calpontDB.cpp"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if"/>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters="">
<F
N="Makefile"
Type="Makefile"/>
</Folder>
</Files>
</Project>

View File

@@ -1,57 +0,0 @@
#
# Not used
#
#
#original Makefile.am contents follow:
## Copyright (C) 2014 InfiniDB, Inc.
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 of
## the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
#
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
### Process this file with automake to produce Makefile.in
#
#AM_CPPFLAGS = $(idb_cppflags)
#AM_CFLAGS = $(idb_cflags)
#AM_CXXFLAGS = $(idb_cxxflags)
#AM_LDFLAGS = $(idb_ldflags)
#bin_PROGRAMS = calpontSupport
#calpontSupport_SOURCES = calpontSupport.cpp
#calpontSupport_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
#calpontSupport_LDFLAGS = $(idb_common_ldflags) $(idb_brm_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
#dist_bin_SCRIPTS=\
# alarmReport.sh \
# bulklogReport.sh \
# configReport.sh \
# hadoopReport.sh \
# hardwareReport.sh \
# logReport.sh \
# resourceReport.sh \
# softwareReport.sh
#
#test:
#
#coverage:
#
#leakcheck:
#
#docs:
#
#bootstrap: install-data-am
#

View File

@@ -1,36 +0,0 @@
#! /bin/sh
#
# $Id: logReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
SERVER=$1
else
SERVER="localhost"
fi
if [ $2 ] ; then
DATE=$2
else
DATE=" "
fi
rm -f /tmp/logReport.log
{
echo " "
echo "******************** Alarm Report for $SERVER ********************"
echo " "
echo "-- Today's Alarms --"
echo " "
cat /var/log/mariadb/columnstore/alarm.log 2>/dev/null
if test -f /var/log/mariadb/columnstore/archive/alarm.log-$DATE ; then
echo "-- Archived Alarms --"
echo " "
cat /var/log/mariadb/columnstore/archive/alarm.log-$DATE 2>/dev/null
fi
} > /tmp/logReport.log
exit 0

View File

@@ -1,26 +0,0 @@
/*
Table for output from track.sh.
Contains a row per process / snapshot.
*/
drop table if exists processLog;
create table processLog (
snapshotid int,
dtm datetime, /* repeated for a snapshot */
processPid int,
processUserName varchar(7),
processPriority int,
processNice int,
moduleSwapUsedK int,
moduleCachedUsedK int,
processVirt int,
processRes int,
processShr int,
processS char(8),
processCPUPct decimal(4,1),
processMemPct decimal(4,1),
processTime varchar(20),
processCommand varchar(20))engine=infinidb;

View File

@@ -1,37 +0,0 @@
#!/bin/bash
#
# Usage:
# track.sh
# top output
#top - 12:45:49 up 21:58, 2 users, load average: 0.04, 0.10, 0.08
#Tasks: 164 total, 1 running, 163 sleeping, 0 stopped, 0 zombie
#Cpu(s): 2.9%us, 2.4%sy, 10.3%ni, 76.2%id, 8.0%wa, 0.0%hi, 0.2%si, 0.0%st
#Mem: 16440336k total, 6129588k used, 10310748k free, 74336k buffers
#Swap: 2031608k total, 14848k used, 2016760k free, 511012k cached
#
# PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
# track.sh output
# SEQ DATE PID USER PR NI SWAP CACHE VIRT RES SHR S %CPU %MEM TIME+ COMMAND
# SWAP and CACHE are systemwise swap space: Swap: ... used ... cached
i=0
while [ true ]
do
let i++
dt=`date '+%Y-%m-%d %H:%M:%S'`
top -b -n 1 |
egrep "Swap:|PrimProc|ExeMgr|DMLProc|DDLProc|cpimport|WriteEngineServ|controllernode|workernode|mysqld|DecomSvr" |
awk '{if(NR==1){s=$4; c=$8; next}}; {print s" "c" "$0}' |
awk -v i=$i -v dt="$dt" '{
sub(/k/,"",$1); sub(/k/,"",$2); sub(/m/,"000",$7); sub(/m/,"000",$8); sub(/m/,"000",$9);
sub(/\.([0-9]+)g/, "&00000",$7); sub(/^[0-9]+g/, "&000000",$7); gsub(/[.|g]/, "",$7);
sub(/\.([0-9]+)g/, "&00000",$8); sub(/^[0-9]+g/, "&000000",$8); gsub(/[.|g]/, "",$8)}
{print i"|"dt"|"$3"|"$4"|"$5"|"$6"|"$1"|"$2"|"$7"|"$8"|"$9"|"$10"|"$11"|"$12"|"$13"|"$14"|"}'
if [ -f stop.txt ]; then
rm -f stop.txt
exit
fi
sleep 1
done

View File

@@ -1,62 +0,0 @@
#!/bin/bash
#
# Estimates the row count for a given table. Uses number of extents * 8M for the estimate.
#
#
# Initialize variables.
#
if [ -z "$MYSQLCMD" ]; then
INSTALLDIR="/usr/local/mariadb/columnstore"
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
fi
#
# Validate that there are two parameters - schema and table.
#
if [ $# -ne 2 ]; then
echo ""
echo "Reports the approximate row count for the given table."
echo ""
echo "Parameters:"
echo " Schema"
echo " Table"
fi
db=$1
table=$2
#
# Validate that the table exists.
#
sql="select count(*) from systable where \`schema\`='$db' and tablename='$table';"
count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"`
if [ $count -le 0 ]; then
echo ""
echo "$db.$table does not exist in InfiniDB."
echo ""
exit 1
fi
#
# Grab the objectid and column width for a column in the table.
#
sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' limit 1;"
objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
sql="select columnlength from syscolumn where objectid=$objectid;"
colWidth=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
#
# Use editem to count the extents.
#
extentCount=`/usr/local/mariadb/columnstore/bin/editem -o $objectid | wc -l`
let extentCount-=2 # Take out the 2 extra rows for header and blank line at end.
let approximateRowCount=$extentCount*8192*1024;
echo ""
echo "Approximate row count for $db.$table is $approximateRowCount."
echo ""
exit 0

View File

@@ -1,38 +0,0 @@
#! /bin/sh
#
# $Id: logReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_bulklogReport.txt
{
if test -d $INSTALLDIR/data/bulk ; then
echo " "
echo "-- Check for Errors in Bulk Logs --"
echo " "
echo "################# egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err #################"
echo " "
egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err 2>/dev/null
fi
} > /tmp/${MODULE}_bulklogReport.txt
exit 0

View File

@@ -1,227 +0,0 @@
@echo off
pushd .
set help=
if "%1" == "-h" (set help=true)
if "%1" == "/h" (set help=true)
if "%1" == "--help" (set help=true)
if "%help%"=="true" (
echo The InfiniDB Support Report creates a report that can be sent to InfiniDB
echo for help with field support. There are no options to this command.
set help=
exit /B 0
)
echo.
echo Running the InfiniDB Support Report, outputting to InfiniDBSupportReport.txt
call :func > InfiniDBSupportReport.txt 2>&1
echo.
echo Report finished
popd
exit /B 0
:ErrorExit
echo.
echo Error - Failed to find InfiniDB Install Directory in Windows Registry, Exiting
popd
exit /B 1
:func
setlocal
set key="HKLM\SOFTWARE\Calpont\InfiniDB"
set homeValue=InfiniDBHome
set configValue=ConfigFile
for /f "tokens=3,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
set InfiniDBInstall=%%b
)
if "%InfiniDBInstall%" == "" (
for /f "tokens=2,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
set InfiniDBInstall=%%b
)
)
::error out if can't locate Install Directory
if "%InfiniDBInstall%" == "" GOTO ErrorExit
echo #######################################################################
echo # #
echo # InfiniDB Support Report - %date% %time%
echo # #
echo #######################################################################
echo.
echo.
echo =======================================================================
echo = Software/Version Report =
echo =======================================================================
echo.
echo.
echo -- InfiniDB Software Version --
type %InfiniDBInstall%\etc\CalpontVersion.txt
echo.
echo -- mysql Software Version --
mysql --user=root -e status
echo.
echo -- Windows Version --
ver
echo.
echo.
echo =======================================================================
echo = Status Report =
echo =======================================================================
echo.
echo.
echo -- InfiniDB Process Status --
echo.
tasklist /FI "Imagename eq mysqld.exe"
tasklist /FI "Imagename eq controllernode.exe"
tasklist /FI "Imagename eq workernode.exe"
tasklist /FI "Imagename eq PrimProc.exe"
tasklist /FI "Imagename eq ExeMgr.exe"
tasklist /FI "Imagename eq DDLProc.exe"
tasklist /FI "Imagename eq DMLProc.exe"
tasklist /FI "Imagename eq WriteEngineServer.exe"
echo.
echo.
echo =======================================================================
echo = Configuration Report =
echo =======================================================================
echo.
echo -- Windows InfiniDB Registry Values --
echo.
echo InfiniDBInstall = %InfiniDBInstall%
for /f "tokens=2,*" %%a in ('reg query %key% /v %homeValue% 2^>NUL ^| findstr %homeValue%') do (
set InfiniDBHome=%%b
)
echo InfiniDBHome = %InfiniDBHome%
for /f "tokens=2,*" %%a in ('reg query %key% /v %configValue% 2^>NUL ^| findstr %configValue%') do (
set ConfigFile=%%b
)
echo ConfigFile = %ConfigFile%
echo.
echo.
echo -- InfiniDB System Configuration Information --
echo.
cd %InfiniDBInstall%\bin
for /f "delims=" %%a in ('getConfig.exe DBBC NumBlocksPct') do @echo NumBlocksPct = %%a
for /f "delims=" %%a in ('getConfig.exe HashJoin TotalUmMemory') do @echo TotalUmMemory = %%a
for /f "delims=" %%a in ('getConfig.exe VersionBuffer VersionBufferFileSize') do @echo VersionBufferFileSize = %%a
for /f "delims=" %%a in ('getConfig.exe ExtentMap FilesPerColumnPartition') do @echo FilesPerColumnPartition = %%a
for /f "delims=" %%a in ('getConfig.exe ExtentMap ExtentsPerSegmentFile') do @echo ExtentsPerSegmentFile = %%a
echo.
echo.
echo -- InfiniDB System Configuration File --
echo.
type "%ConfigFile%"
echo.
echo.
echo -- System Process Status --
echo.
tasklist /v
echo.
echo =======================================================================
echo = Resource Usage Report =
echo =======================================================================
echo.
echo -- System Information--
echo.
systeminfo
echo.
echo -- IP Configuration Information --
echo.
ipconfig
echo.
echo -- Disk BRM Data files --
echo.
dir "%InfiniDBInstall%\dbrm\"
echo.
echo -- View Table Locks --
echo.
cd %InfiniDBInstall%\bin\
viewtablelock.exe
echo.
echo.
echo -- BRM Extent Map --
echo.
cd %InfiniDBInstall%\bin\
editem.exe -i
echo.
echo.
echo =======================================================================
echo = Log Report =
echo =======================================================================
echo.
echo -- InfiniDB Platform Logs --
echo.
type "%InfiniDBInstall%\log\InfiniDBLog.txt"
echo.
echo.
echo -- InfiniDB MySQl log --
echo.
type "%InfiniDBInstall%\mysqldb\*.err"
echo.
echo.
echo -- InfiniDB Bulk Load Logs --
echo.
dir "%InfiniDBInstall%\bulk\data"
echo.
dir "%InfiniDBInstall%\bulk\log"
echo.
dir "%InfiniDBInstall%\bulk\job"
echo.
echo -- Check for Errors in Bulk Logs --
echo.
cd "%InfiniDBInstall%\bulk\log"
findstr /spin /c:"error" *
findstr /spin /c:"failed" *
cd "%InfiniDBInstall%\bulk\job"
findstr /spin /c:"error" *
findstr /spin /c:"failed" *
echo.
echo =======================================================================
echo = DBMS Report =
echo =======================================================================
echo.
echo -- DBMS InfiniDB Mysql Version --
echo.
mysql --user=root -e status
echo.
echo -- DBMS Mysql InfiniDB System Column --
echo.
mysql --user=root -e "desc calpontsys.syscolumn"
echo.
echo -- DBMS Mysql InfiniDB System Table --
echo.
mysql --user=root -e "desc calpontsys.systable"
echo.
echo -- DBMS Mysql InfiniDB System Table Data --
echo.
mysql --user=root -e "select * from calpontsys.systable"
echo.
echo -- DBMS Mysql InfiniDB Databases --
echo.
mysql --user=root -e "show databases"
echo.
echo -- DBMS Mysql InfiniDB variables --
echo.
mysql --user=root -e "show variables"
echo.
echo -- DBMS Mysql InfiniDB config file --
echo.
type "%InfiniDBInstall%\my.ini"
echo.
echo -- Active Queries --
::cd \InfiniDB\genii\oamapps\calpontSupport

File diff suppressed because it is too large Load Diff

View File

@@ -1,64 +0,0 @@
#!/bin/bash
#
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_configReport.txt
{
echo " "
echo "******************** Configuration/Status Report for ${MODULE} ********************"
echo " "
if test -f /sbin/chkconfig ; then
echo "-- chkconfig configuration --"
echo " "
echo "################# /sbin/chkconfig --list | grep infinidb #################"
echo " "
$SUDO /sbin/chkconfig --list | grep infinidb 2>/dev/null
echo "################# /sbin/chkconfig --list | grep mysql-Columnstore #################"
echo " "
$SUDO /sbin/chkconfig --list | grep mysql-Columnstore 2>/dev/null
fi
echo " "
echo "-- fstab Configuration --"
echo " "
echo "################# cat /etc/fstab #################"
echo " "
$SUDO cat /etc/fstab 2>/dev/null
echo " "
echo "-- Server Processes --"
echo " "
echo "################# ps axu #################"
echo " "
$SUDO ps axu
echo " "
echo "-- Server Processes with resource usage --"
echo " "
echo "################# top -b -n 1 #################"
echo " "
$SUDO top -b -n 1
} > /tmp/${MODULE}_configReport.txt
exit 0

View File

@@ -1,40 +0,0 @@
#!/bin/sh
#
# This script lists InfiniDBlpont data files that do not have associated extent map entries.
#
# NOTES:
# 1) Only looks in $COLUMNSTORE_INSTALL_DIR/data* for the data files.
# 2) Only checks for an existing extent with a matching OID, doesn't validate that there is an
# existing extent for the exact segment.
#
# Close enough for hand grenades.
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
fi
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
if [ $COLUMNSTORE_INSTALL_DIR != "/usr/local/mariadb/columnstore" ]; then
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
fi
cd $COLUMNSTORE_INSTALL_DIR
last=-1
existsInExtentMap=0
count=0
for i in $COLUMNSTORE_INSTALL_DIR/data*/*/*/*/*/*/FILE*cdf; do
let count++
oid=`$COLUMNSTORE_INSTALL_DIR/bin/file2oid.pl $i`
if [ $last -ne $oid ]; then
last=$oid
existsInExtentMap=`$COLUMNSTORE_INSTALL_DIR/bin/editem -o $oid | wc -l`
fi
if [ $existsInExtentMap -le 0 ]; then
echo "Missing oid $oid path $i"
fi
done

View File

@@ -1,132 +0,0 @@
#!/bin/bash
#
# Reports the max value from the extent map for the given column.
#
#
# Initialize variables.
#
if [ -z "$MYSQLCMD" ]; then
INSTALLDIR="/usr/local/mariadb/columnstore"
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
fi
#
# Validate that there are three parameters - schema and table and columnname.
#
if [ $# -ne 3 ]; then
echo ""
echo "Reports the max value for the given column."
echo ""
echo "Parameters:"
echo " Schema"
echo " Table"
echo " Column"
exit 1
fi
db=$1
table=$2
column=$3
#
# Validate that the column exists.
#
sql="select count(*) from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"`
if [ $count -le 0 ]; then
echo ""
echo "$db.$table.$column does not exist in InfiniDB."
echo ""
exit 1
fi
#
# Validate that the column type is one that this script supports.
# Supported Types:
# 6 int
# 8 date
# 9 bigint
# 11 datetime
sql="select datatype from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
dataType=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
if [ $dataType -ne 6 ] && [ $dataType -ne 8 ] && [ $dataType -ne 9 ] && [ $dataType -ne 11 ]; then
echo ""
echo "The column data type must be an int, bigint, date, or datetime."
echo ""
exit 1
fi
#
# Grab the objectid for the column.
#
sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
#
# Set the editem specific parameter if the column is a date or datetime.
#
if [ $dataType -eq 8 ]; then
parm="-t"
elif [ $dataType -eq 11 ]; then
parm="-s"
fi
#
# Use the editem utility to get the min and max value.
#
/usr/local/mariadb/columnstore/bin/editem -o $objectid $parm | grep max | awk -v dataType=$dataType '
BEGIN {
allValid=1;
foundValidExtent=0;
}
{
if(dataType == 11) {
state=substr($14, 1, length($14)-1); # Datetime has date and time as two fields.
thisMin=$6 " " substr($7, 1, length($7)-1);
thisMax=$9 " " substr($10, 1, length($10)-1);
}
else {
state=substr($12, 1, length($12)-1);
thisMin=substr($6, 1, length($6)-1);
thisMax=substr($8, 1, length($8)-1);
}
if(state == "valid") {
if(!foundValidExtent) {
min=thisMin;
max=thisMax;
foundValidExtent=1;
}
else {
if(thisMin < min) {
min=thisMin;
}
if(thisMax > max) {
max=thisMax;
}
}
}
else {
allValid=0;
}
}
END {
if(foundValidExtent == 1) {
print "";
print "Min=" min;
print "Max=" max;
print "";
if(allValid == 0) {
print "Not all extents had min and max values set. Answer is incomplete."
}
}
else {
print "";
print "There were not any extents with valid min/max values. Unable to provide answer.";
print "";
}
}'
exit 0

View File

@@ -1,69 +0,0 @@
#! /bin/sh
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "hdfs" ]; then
SUDO=" "
else
SUDO="sudo -u hdfs"
fi
sudo rm -f /tmp/hdfsReport.txt
{
echo
echo "****************************** HDFS REPORT ********************************"
echo
echo "-- Hadoop version --"
echo
echo "################# hadoop version #################"
echo
$SUDO hadoop version
echo
echo "-- Data File Plugin --"
echo
echo "######### $INSTALLDIR/bin/getConfig SystemConfig DataFilePlugin ##########"
echo
sudo $INSTALLDIR/bin/getConfig SystemConfig DataFilePlugin
echo
echo
echo "-- Hadoop Configuration File --"
echo
echo "################ core-site.xml ################"
echo
cat $HADOOP_CONF_DIR/core-site.xml
echo
echo "################ hdfs-site.xml ################"
echo
cat $HADOOP_CONF_DIR/hdfs-site.xml
echo
echo "-- Hadoop Health Check --"
echo
echo "################# hdfs dfsadmin -report #################"
echo
$SUDO hadoop dfsadmin -report 2>/dev/null
echo
echo "-- HDFS check --"
echo
echo "################# hdfs fsck $INSTALLDIR #################"
echo
$SUDO hadoop fsck $INSTALLDIR 2>/dev/null
} > /tmp/hadoopReport.txt
exit 0

View File

@@ -1,101 +0,0 @@
#! /bin/sh
#
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_hardwareReport.txt
{
echo " "
echo "******************** Hardware Report for ${MODULE} ********************"
echo " "
echo "-- Server OS Version --"
echo " "
echo "################# cat /proc/version #################"
echo " "
$SUDO cat /proc/version 2>/dev/null
echo " "
echo "################# uname -a #################"
echo " "
uname -a
echo " "
echo "################# cat /etc/issue #################"
echo " "
cat /etc/issue 2>/dev/null
echo " "
echo "run os_check.sh"
echo " "
echo "################# /bin/os_check.sh #################"
echo " "
$INSTALLDIR/bin/os_check.sh 2>/dev/null
echo " "
echo "-- Server Uptime --"
echo " "
echo "################# uptime #################"
echo " "
uptime
echo " "
echo "-- Server cpu-info --"
echo " "
echo "################# cat /proc/cpuinfo #################"
echo " "
$SUDO cat /proc/cpuinfo 2>/dev/null
echo " "
echo "-- Server memory-info --"
echo " "
echo "################# cat /proc/meminfo #################"
echo " "
$SUDO cat /proc/meminfo 2>/dev/null
echo " "
echo "-- Server mounts --"
echo " "
echo "################# cat /proc/mounts #################"
echo " "
$SUDO cat /proc/mounts 2>/dev/null
echo " "
echo "-- Server Disk Scheduler for Calpont Mounts --"
echo " "
for scsi_dev in `mount | awk '/mnt\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do
echo '/dev/'$scsi_dev ' scheduler setup is'
cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null
done
for scsi_dev in `mount | awk '/Calpont\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do
if [ $scsi_dev != "local" ] ; then
echo '/dev/'$scsi_dev ' scheduler setup is'
cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null
fi
done
echo " "
echo "-- Server Ethernet Configuration --"
echo " "
echo "################# ifconfig -a #################"
echo " "
ifconfig -a 2>/dev/null
} > /tmp/${MODULE}_hardwareReport.txt
exit 0

View File

@@ -1,27 +0,0 @@
#! /bin/sh
#
# $Id: logReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_logReport.tar.gz
tar -zcf /tmp/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1
exit 0

View File

@@ -1,170 +0,0 @@
#!/bin/bash
#
# $Id: minMaxCheck.sh 1479 2011-07-20 09:53:32Z wweeks $
#
#
# This script resets the EM Min/Max values for the coluns defined in the cols array.
#
# Usage:
# ./minMax.sh
# runs against the columns defined in the cols array below.
# ./minMaxCheck.sh all
# run for all CP columns in the database (will take a long time against a large database).
# ./minMaxCheck.sh schemaname
# run for CP columns in tables in the schema. If your schema is named all, you'll get all columns.
# ./minMaxCheck.sh schemaname tablename
# run for CP columns against the given table.
# ./minMaxCheck.sh schemaname tablename columnname
# run against the given column.
#
# The script does the following:
# 1) Runs editem for the column.
# 2) Clears the min/max for the column with editem -c.
# 3) Counts the column so that the min/max get set again.
# 4) Runs editem for the column again.
# 5) Diffs the two editem runs and reports / saves the sdiff log files for the column if any of extents had the min/max changed.
#
# Notes:
# 1) An info.log entry will be logged at the end of the script if none of the columns checked had a bad extent map entry.
# Example:
# Mar 11 14:11:29 srvqaperf8 oamcpp[9872]: 29.091980 |0|0|0| I 08 CAL0000: min-max-monitor: okay
# 2) Two warning.log entries will be logged at the end of the script if one or min/max EM entries were corrected.
# Example:
# Mar 11 14:16:36 srvqaperf8 oamcpp[16364]: 36.231731 |0|0|0| W 08 CAL0000: min-max-monitor: some values were reset for oids 3004 3005
# Mar 11 14:16:36 srvqaperf8 oamcpp[16365]: 36.263270 |0|0|0| W 08 CAL0000: min-max-monitor: log files are /tmp/idb_mm_mon.sdiff.*.15190
# 3) The script outputs the results of the selects in #3 above as it's going through the columns and will echo a line when it finds a col that was corrected.
# Example:
# **** Extent map min/max changed on the scan. See results in /tmp/idb_mm_mon.sdiff.3039.15190
# Define the cols array. Here's a sql statement that will list the date and datetime cols in the expected format.
# idbmysql calpontsys -e "select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype in (8, 11) and tablename not like 'temp%';" > www.txt
#
# NOTE: The objectid will be looked up again when it's going through the columns in case the one in the array becomes stale.
#
if [ -z "$MYSQLCMD" ]; then
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root"
fi
if [ -z "$INSTALLDIR" ]; then
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ -z "$PGMPATH" ]; then
PGMPATH=$INSTALLDIR/bin
fi
cols=(
1339664:tpch1.orders.o_orderdate
1339718:tpch1.lineitem.l_shipdate
1339719:tpch1.lineitem.l_commitdate
1339720:tpch1.lineitem.l_receiptdate
1339759:dml.orders.o_orderdate
1339813:dml.lineitem.l_shipdate
1339814:dml.lineitem.l_commitdate
1339815:dml.lineitem.l_receiptdate
)
#
# If called with "all", run the script against all of the column types that use CP.
#
if [ $# -eq 1 ] && [ "$1" == "all" ]; then
$MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7);" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols
cols=( $( cat /tmp/idb_mm_mon.cols ) )
rm -f /tmp/idb_mm_mon.cols
#
# Else if one parm passed, run against the columns in the given schema.
#
elif [ $# -eq 1 ]; then
db=$1
$MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols
cols=( $( cat /tmp/idb_mm_mon.cols ) )
rm -f /tmp/idb_mm_mon.cols
#
# Else if two parms passed, run the script against all the columns that use CP for that table.
#
elif [ $# -eq 2 ]; then
db=$1
tbl=$2
$MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db' and tablename = '$tbl';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols
cols=( $( cat /tmp/idb_mm_mon.cols ) )
rm -f /tmp/idb_mm_mon.cols
#
# Else if three parms passed, run the script against the column.
#
elif [ $# -eq 3 ]; then
db=$1
tbl=$2
col=$3
$MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$db' and tablename = '$tbl' and columnname='$col';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols
cols=( $( cat /tmp/idb_mm_mon.cols ) )
rm -f /tmp/idb_mm_mon.cols
fi
i=0
j=0
if [ ${#cols[@]} -le 0 ]; then
$PGMPATH/cplogger -w 0 "min-max-monitor: no qualifying columns" "$badoidlist"
echo "min-max-monitor: no qualifying columns" "$badoidlist"
exit 1
fi
badoidlist=
while [ $i -lt ${#cols[@]} ]; do
let row=$i+1
echo ""
echo "Evaluating $row of ${#cols[@]} at `date`. Col is ${cols[$i]}."
eval $(echo ${cols[$i]} | awk -F: '{printf "oid=%d\ntcn=%s\n", $1, $2}')
eval $(echo $tcn | awk -F. '{printf "schema=%s\ntable=%s\ncolumn=%s\n", $1, $2, $3}')
#
# Look up the oid if the cols array is being used to keep from having to continually update the array if tables are dropped and recreated.
#
if [ $# -eq 0 ]; then
$MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$schema' and tablename='$table' and columnname='$column';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols
results=`wc -l /tmp/idb_mm_mon.cols | awk '{print $1}'`
if [ $results -eq 0 ]; then
oid=0
else
oid=`cat /tmp/idb_mm_mon.cols`
fi
fi
$PGMPATH/editem -o$oid | awk '{print $1, $6, $8, $12}' >/tmp/idb_mm_mon.$oid.1.$$
$PGMPATH/editem -c$oid
$MYSQLCMD --execute="select count($column) from $table" $schema -vvv
$PGMPATH/editem -o$oid | awk '{print $1, $6, $8, $12}' >/tmp/idb_mm_mon.$oid.2.$$
sdiff /tmp/idb_mm_mon.$oid.1.$$ /tmp/idb_mm_mon.$oid.2.$$ --suppress-common-lines | grep -n -v invalid > /tmp/idb_mm_mon.sdiff.$oid.$$
count=`wc -l /tmp/idb_mm_mon.sdiff.$oid.$$ | awk '{print $1}'`
if [ $count -ne 0 ]; then
badoidlist="$badoidlist $oid"
((j++))
echo "**** Extent map min/max changed on the scan. See results in /tmp/idb_mm_mon.sdiff.$oid.$$"
else
rm -f /tmp/idb_mm_mon.sdiff.$oid.$$
fi
rm -f /tmp/idb_mm_mon.$oid.*.$$
((i++))
done
echo ""
if [ $j -eq 0 ]; then
$PGMPATH/cplogger -i 0 "min-max-monitor: okay"
echo "min-max-monitor: okay"
echo ""
exit 0
else
$PGMPATH/cplogger -w 0 "min-max-monitor: some values were reset for oids" "$badoidlist"
$PGMPATH/cplogger -w 0 "min-max-monitor: log files are /tmp/idb_mm_mon.sdiff.*.$$"
echo "min-max-monitor: some values were reset for oids" "$badoidlist"
echo "min-max-monitor: log files are /tmp/idb_mm_mon.sdiff.*.$$"
echo ""
exit 1
fi

View File

@@ -1,74 +0,0 @@
#! /bin/sh
#
# $Id: resourceReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_resourceReport.txt
{
echo " "
echo "******************** Resource Usage Report for ${MODULE} ********************"
echo " "
echo " "
echo "-- Shared Memory --"
echo " "
echo "################# ipcs -l #################"
echo " "
$SUDO ipcs -l
echo "################# $INSTALLDIR/bin/clearShm -n #################"
echo " "
$INSTALLDIR/bin/clearShm -n
echo " "
echo "-- Disk Usage --"
echo " "
echo "################# df -k #################"
echo " "
$SUDO df -k
echo " "
echo "-- Disk BRM Data files --"
echo " "
ls -l $INSTALLDIR/data1/systemFiles/dbrm 2> /dev/null
ls -l $INSTALLDIR/dbrm 2> /dev/null
echo "################# cat $INSTALLDIR/data1/systemFiles/dbrm/BRM_saves_current #################"
echo " "
cat $INSTALLDIR/data1/systemFiles/dbrm/BRM_saves_current 2> /dev/null
echo " "
echo "-- View Table Locks --"
echo " "
echo "################# cat bin/viewtablelock #################"
echo " "
$INSTALLDIR/bin/viewtablelock 2> /dev/null
echo " "
echo "-- BRM Extent Map --"
echo " "
echo "################# bin/editem -i #################"
echo " "
$INSTALLDIR/bin/editem -i 2>/dev/null
} > /tmp/${MODULE}_resourceReport.txt
exit 0

View File

@@ -1,225 +0,0 @@
#!/bin/bash
#
# Script that does analysis on SQL statements from an InfiniDB debug log.
#
DB=idb_idb_sqllogs
TABLE=statements
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
fi
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
if [ $COLUMNSTORE_INSTALL_DIR != "/usr/local/mariadb/columnstore" ]; then
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
fi
if [ -z "$MYSQLCMD" ]; then
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql --defaults-extra-file=$COLUMNSTORE_INSTALL_DIR/mysql/my.cnf -u root"
export MYSQLCMD
fi
main()
{
if [ "$option" == "usage" ]; then
usage
exit
elif [ "$option" == "create" ]; then
if [ -f $logFile ]; then
create
else
echo ""
usage
echo ""
echo "*** $logFile not found. Pleae specify a valid debug log file.***"
echo ""
exit
fi
elif [ "$option" == "list" ]; then
list
elif [ "$option" == "listAll" ]; then
listAll
elif [ "$option" == "active" ]; then
listActive
elif [ "$option" == "activeAll" ]; then
listActiveAll
else
echo ""
usage
echo "*** $option is not a valid option. ***"
echo ""
exit
fi
}
usage ()
{
echo "
This script can be used to analyze select statements from an InfiniDB debug log.
Usage:
./sqlLogs.sh create [debug log file name - default:debug.log]
Creates an $DB.$TABLE table with the select statements from the debug log. Must be run before other options can be used.
./sqlLogs.sh list
Lists the SQL statements and run times showing the following:
id - statement id in sequential order based on the start time
starttime - start time of the statement
endtime - end time of the statement
runtime - total run time of the statement
sessionid - the MySQL session id for the statement
sessionstatementid - the sequence of the statement within the session
./sqlLogs.sh listAll
Same as list with the addition of the SQL statement.
./sqlLogs.sh active timestamp
Example: ./sqlLogs.sh active 00:35:50.291408
Lists the id, starttime, endtime, runtime, timeActive, sessionid, and sessionstatementid for the sql statements
that were active at the given timestamp.
./sqlLogs.sh activeAll timestamp
Same as listActive with the addition of the SQL statement.
"
}
create ()
{
echo ""
echo "Step 1 of 4. Building import file with Start SQL log entries."
grep "Start SQL" $logFile | grep -v syscolumn | grep -v systable | awk -F '|' '{print NR "|" substr($1,8,6) substr($1,length($1)-9,9) "|" $2 "|" $5}' |
sort -t '|' -n -k 3 -k 1 |
awk -F '|' '
{
if(NR == 1)
{
prevSession=$3;
val=1;
}
else if(prevSession == $3)
val++;
else
{
val=1;
prevSession=$3;
}
print $0 "|" val "|"
}' | sort -t '|' -n -k 1 > /tmp/idbtmp.tbl
echo "Step 2 of 4. Populating $DB.start table with Start SQL log entries."
sql="
create database if not exists $DB;
use $DB;
drop table if exists start;
CREATE TABLE start (
id int,
time char(20),
sessionid int,
statement varchar(8000),
sessionStatementId int
) ENGINE=MyISAM ;
create index start_idx on start (sessionid, sessionStatementId);
load data infile '/tmp/idbtmp.tbl' into table start fields terminated by '|';
"
$MYSQLCMD -e "$sql"
echo "Step 3 of 4. Building import file with End SQL log entries."
grep "End SQL" $logFile | grep -v "2147483" | awk -F '|' '{print NR "|" substr($1,8,6) substr($1,length($1)-9,9) "|" $2}' |
sort -t '|' -n -k 3 -k 1 |
awk -F '|' '
{
if(NR == 1)
{
prevSession=$3;
val=1;
}
else if(prevSession == $3)
val++;
else
{
val=1;
prevSession=$3;
}
print $0 "|" val "|"
}' | sort -t '|' -n -k 1 > /tmp/idbtmp.tbl
echo "Step 4 of 4. Populating $DB.stop table with End SQL log entries."
sql="
drop table if exists stop;
CREATE TABLE stop (
id int,
time char(20),
sessionid int,
sessionStatementId int
) ENGINE=MyISAM ;
create index stop_idx on stop (sessionid, sessionStatementId);
load data infile '/tmp/idbtmp.tbl' into table stop fields terminated by '|';
"
$MYSQLCMD $DB -e "$sql;"
echo "Step 5 of 5. Populating $DB.$TABLE table."
sql="
drop table if exists $TABLE;
create table $TABLE as
(select
a.id id, a.time starttime, b.time endtime, substr(timediff(b.time, a.time), 1, 30) runTime, a.sessionid sessionId, a.sessionstatementid sessionStatementId, a.statement statement
from start a left join stop b
on a.sessionid = b.sessionid and a.sessionstatementid = b.sessionstatementid);
"
$MYSQLCMD $DB -e "$sql"
echo "All done."
echo ""
}
list() {
sql="select id, starttime, endtime, runtime, sessionid, sessionstatementid from statements;"
$MYSQLCMD $DB -vvv -e "$sql"
}
listAll()
{
sql="select id, starttime, endtime, runtime, sessionid, sessionstatementid, trim(statement) statement from statements;"
$MYSQLCMD $DB -vvv -e "$sql"
}
listActive()
{
dtm=$parm2
sql="
select id, starttime, endtime, runtime, timediff('$dtm', starttime) timeActive, sessionid, sessionstatementid from statements
where starttime <= '$dtm' and (endtime is null or endtime > '$dtm');
"
$MYSQLCMD $DB -vvv -e "$sql"
}
listActiveAll()
{
dtm=$parm2
sql="
select id, starttime, endtime, runtime, timediff('$dtm', starttime) timeActive, sessionid, sessionstatementid, trim(statement) statement from statements
where starttime <= '$dtm' and (endtime is null or endtime > '$dtm');
"
$MYSQLCMD $DB -vvv -e "$sql"
}
if [ $# -lt 1 ]; then
usage
exit
else
option=$1
parm2=$2
logFile=debug.log
if [ $# -ge 2 ]; then
logFile=$2
fi
fi
main

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_bulklogReport.txt
rm -f /tmp/${MODULE}_bulklogReport.txt
{

File diff suppressed because it is too large Load Diff

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_configReport.txt
rm -f /tmp/${MODULE}_configReport.txt
{
echo " "
@@ -34,10 +27,10 @@ if [ -n "$chkconfig" ]; then
echo " "
echo "################# chkconfig --list | grep columnstore #################"
echo " "
$SUDO chkconfig --list | grep columnstore 2>/dev/null
chkconfig --list | grep columnstore 2>/dev/null
echo "################# chkconfig --list | grep mysql-Columnstore #################"
echo " "
$SUDO chkconfig --list | grep mysql-Columnstore 2>/dev/null
chkconfig --list | grep mysql-Columnstore 2>/dev/null
fi
systemctl=`which systemctl 2>/dev/null`
@@ -46,10 +39,10 @@ if [ -n "$systemctl" ]; then
echo " "
echo "################# systemctl list-unit-files --type=service | grep columnstore #################"
echo " "
$SUDO systemctl list-unit-files --type=service | grep columnstore 2>/dev/null
systemctl list-unit-files --type=service | grep columnstore 2>/dev/null
echo "################# systemctl list-unit-files --type=service | grep mysql-Columnstore #################"
echo " "
$SUDO systemctl list-unit-files --type=service | grep mysql-Columnstore 2>/dev/null
systemctl list-unit-files --type=service | grep mysql-Columnstore 2>/dev/null
fi
updaterc=`which update-rc.d 2>/dev/null`
@@ -58,10 +51,10 @@ if [ -n "$updaterc" ]; then
echo " "
echo "################# service --status-all | grep columnstore #################"
echo " "
$SUDO service --status-all | grep columnstore 2>/dev/null
service --status-all | grep columnstore 2>/dev/null
echo "################# service --status-all | grep mysql-Columnstore #################"
echo " "
$SUDO service --status-all | grep mysql-Columnstore 2>/dev/null
service --status-all | grep mysql-Columnstore 2>/dev/null
fi
@@ -70,21 +63,21 @@ echo "-- fstab Configuration --"
echo " "
echo "################# cat /etc/fstab #################"
echo " "
$SUDO cat /etc/fstab 2>/dev/null
cat /etc/fstab 2>/dev/null
echo " "
echo "-- Server Processes --"
echo " "
echo "################# ps axu #################"
echo " "
$SUDO ps axu
ps axu
echo " "
echo "-- Server Processes with resource usage --"
echo " "
echo "################# top -b -n 1 #################"
echo " "
$SUDO top -b -n 1
top -b -n 1
} > /tmp/${MODULE}_configReport.txt

View File

@@ -13,14 +13,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "hdfs" ]; then
SUDO=" "
else
SUDO="sudo -u hdfs"
fi
sudo rm -f /tmp/hdfsReport.txt
rm -f /tmp/hdfsReport.txt
{
echo
@@ -30,14 +23,14 @@ echo "-- Hadoop version --"
echo
echo "################# hadoop version #################"
echo
$SUDO hadoop version
hadoop version
echo
echo "-- Data File Plugin --"
echo
echo "######### $INSTALLDIR/bin/getConfig SystemConfig DataFilePlugin ##########"
echo
sudo $INSTALLDIR/bin/getConfig SystemConfig DataFilePlugin
$INSTALLDIR/bin/getConfig SystemConfig DataFilePlugin
echo
echo
@@ -57,14 +50,14 @@ echo "-- Hadoop Health Check --"
echo
echo "################# hdfs dfsadmin -report #################"
echo
$SUDO hadoop dfsadmin -report 2>/dev/null
hadoop dfsadmin -report 2>/dev/null
echo
echo "-- HDFS check --"
echo
echo "################# hdfs fsck $INSTALLDIR #################"
echo
$SUDO hadoop fsck $INSTALLDIR 2>/dev/null
hadoop fsck $INSTALLDIR 2>/dev/null
} > /tmp/hadoopReport.txt
exit 0

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_hardwareReport.txt
rm -f /tmp/${MODULE}_hardwareReport.txt
{
echo " "
@@ -32,7 +25,7 @@ echo "-- Server OS Version --"
echo " "
echo "################# cat /proc/version #################"
echo " "
$SUDO cat /proc/version 2>/dev/null
cat /proc/version 2>/dev/null
echo " "
echo "################# uname -a #################"
echo " "
@@ -60,35 +53,21 @@ echo "-- Server cpu-info --"
echo " "
echo "################# cat /proc/cpuinfo #################"
echo " "
$SUDO cat /proc/cpuinfo 2>/dev/null
cat /proc/cpuinfo 2>/dev/null
echo " "
echo "-- Server memory-info --"
echo " "
echo "################# cat /proc/meminfo #################"
echo " "
$SUDO cat /proc/meminfo 2>/dev/null
$cat /proc/meminfo 2>/dev/null
echo " "
echo "-- Server mounts --"
echo " "
echo "################# cat /proc/mounts #################"
echo " "
$SUDO cat /proc/mounts 2>/dev/null
echo " "
echo "-- Server Disk Scheduler for Columnstore Mounts --"
echo " "
for scsi_dev in `mount | awk '/mnt\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do
echo '/dev/'$scsi_dev ' scheduler setup is'
cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null
done
for scsi_dev in `mount | awk '/MariaDB\/Columnstore\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do
if [ $scsi_dev != "local" ] ; then
echo '/dev/'$scsi_dev ' scheduler setup is'
cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null
fi
done
cat /proc/mounts 2>/dev/null
echo " "
echo "-- Server Ethernet Configuration --"

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_logReport.tar.gz
rm -f /tmp/${MODULE}_logReport.tar.gz
tar -zcf /tmp/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_resourceReport.txt
rm -f /tmp/${MODULE}_resourceReport.txt
{
echo " "
@@ -33,7 +26,7 @@ echo "-- Shared Memory --"
echo " "
echo "################# ipcs -l #################"
echo " "
$SUDO ipcs -l
ipcs -l
echo "################# $INSTALLDIR/bin/clearShm -n #################"
echo " "
@@ -44,7 +37,7 @@ echo "-- Disk Usage --"
echo " "
echo "################# df -k #################"
echo " "
$SUDO df -k
df -k
echo " "
echo "-- Disk BRM Data files --"

View File

@@ -14,14 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_softwareReport.txt
rm -f /tmp/${MODULE}_softwareReport.txt
{
echo " "

View File

@@ -173,7 +173,7 @@ int main(int argc, char* argv[])
// setup to start on reboot, for non-root amazon installs
if ( !rootUser )
{
system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1");
system("sed -i -e 's/#runuser/runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1");
}
//copy Columnstore.xml.rpmsave if upgrade option is selected

View File

@@ -840,7 +840,7 @@ checkPackages()
echo ""
declare -a CENTOS_PKG=("expect" "perl" "perl-DBI" "openssl" "zlib" "file" "sudo" "libaio" "rsync" "snappy" "net-tools" "numactl-libs")
declare -a CENTOS_PKG=("expect" "perl" "perl-DBI" "openssl" "zlib" "file" "libaio" "rsync" "snappy" "net-tools" "numactl-libs")
declare -a CENTOS_PKG_NOT=("mariadb-libs")
if [ "$OS" == "centos6" ] || [ "$OS" == "centos7" ]; then
@@ -960,7 +960,7 @@ checkPackages()
fi
declare -a SUSE_PKG=("boost-devel" "expect" "perl" "perl-DBI" "openssl" "file" "sudo" "libaio1" "rsync" "libsnappy1" "net-tools" "libnuma1")
declare -a SUSE_PKG=("boost-devel" "expect" "perl" "perl-DBI" "openssl" "file" "libaio1" "rsync" "libsnappy1" "net-tools" "libnuma1")
declare -a SUSE_PKG_NOT=("mariadb" , "libmariadb18")
if [ "$OS" == "suse12" ]; then
@@ -1051,7 +1051,7 @@ checkPackages()
fi
fi
declare -a UBUNTU_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline-dev" "rsync" "libsnappy1V5" "net-tools" "libnuma1" )
declare -a UBUNTU_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "libreadline-dev" "rsync" "libsnappy1V5" "net-tools" "libnuma1" )
declare -a UBUNTU_PKG_NOT=("mariadb-server" "libmariadb18")
if [ "$OS" == "ubuntu16" ] || [ "$OS" == "ubuntu18" ]; then
@@ -1169,7 +1169,7 @@ checkPackages()
fi
declare -a DEBIAN_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline-dev" "rsync" "libsnappy1" "net-tools" "libnuma1")
declare -a DEBIAN_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "libreadline-dev" "rsync" "libsnappy1" "net-tools" "libnuma1")
declare -a DEBIAN_PKG_NOT=("libmariadb18" "mariadb-server")
if [ "$OS" == "debian8" ]; then
@@ -1287,7 +1287,7 @@ checkPackages()
fi
declare -a DEBIAN9_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline5" "rsync" "libsnappy1V5" "net-tools" "libaio1" "libnuma1")
declare -a DEBIAN9_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "libreadline5" "rsync" "libsnappy1V5" "net-tools" "libaio1" "libnuma1")
declare -a DEBIAN9_PKG_NOT=("libmariadb18" "mariadb-server")
if [ "$OS" == "debian9" ]; then

View File

@@ -11,7 +11,7 @@ files to create your own function or just try that function as is.
$ make
- Copy the libudf_mysql.so.1.0.0 and libudfsdk.so.1.0.0 file to /usr/local/mariadb/columnstore/lib on
every columnstore node.
$ sudo cp libudf_mysql.so.1.0.0 libudfsdk.so.1.0.0 /usr/local/mariadb/columnstore/lib/
$ cp libudf_mysql.so.1.0.0 libudfsdk.so.1.0.0 /usr/local/mariadb/columnstore/lib/
- Restart ColumnStore
$ mcsadmin restartsystem y
- Using the mcsmysql client add the user defined function, e.g,
@@ -20,4 +20,4 @@ files to create your own function or just try that function as is.
> create function mcs_isnull returns string soname 'libudf_mysql.so';
You should now be able to use the mcs_add(arg1, arg2) and mcs_isnull(arg) functions in the select and/or where clauses
of SQL statements.
of SQL statements.