1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

name changes

This commit is contained in:
david hill
2016-05-11 16:24:17 -05:00
parent 12fbdfb4cd
commit a02049ba6a
269 changed files with 14983 additions and 704 deletions

View File

@@ -0,0 +1,275 @@
# Doxyfile 1.4.1-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = install_scripts.kdevelop
PROJECT_NUMBER = $VERSION$
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = /home/dhill/
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = /home/dhill/InfiniDB_MariaDB/oam/install_scripts
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = yes
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = yes
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = install_scripts.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View File

@@ -9,16 +9,16 @@ include ../../rules.mak
.PHONY: install clean test docs coverage leakcheck
SCRIPTS=post-install pre-uninstall remote_command.sh \
calpontLogRotate transactionLog transactionLogArchiver.sh system_installer.sh \
module_installer.sh patch_installer.sh xm_installer.sh startupTests.sh \
director_installer.sh user_installer.sh performance_installer.sh \
remote_scp_get.sh calpontAlias run.sh upgrade-infinidb.sh \
columnstoreLogRotate transactionLog transactionLogArchiver.sh system_installer.sh \
module_installer.sh startupTests.sh \
user_installer.sh performance_installer.sh \
remote_scp_get.sh columnstoreAlias run.sh upgrade-columnstore.sh \
post-mysql-install post-mysqld-install binary_installer.sh \
os_check.sh infinidb calpontSyslog calpontSyslog-ng syslogSetup.sh \
remote_scp_put.sh calpontUninstall.sh infinidb.def \
remotessh.exp master-rep-infinidb.sh slave-rep-infinidb.sh rsync.sh \
os_check.sh columnstore columnstoreSyslog columnstoreSyslog-ng syslogSetup.sh \
remote_scp_put.sh columnstoreUninstall.sh columnstore.def \
remotessh.exp master-rep-columnstore.sh slave-rep-columnstore.sh rsync.sh \
myCnf-include-args.text myCnf-exclude-args.text remote_command_verify.sh \
calpontSyslog7 disable-rep-infinidb.sh infinidb.conf
columnstoreSyslog7 disable-rep-columnstore.sh columnstore.conf
LOCAL=module

57
oam/install_scripts/Makefile~ Executable file
View File

@@ -0,0 +1,57 @@
include ../../rules.mak
#******************************************************************************************
#
# $Id: Makefile 3250 2012-09-26 17:44:13Z rdempsey $
#
# Copyright (C) 2009-2012 Calpont Corporation
# All rights reserved
#*****************************************************************************************/
.PHONY: install clean test docs coverage leakcheck
SCRIPTS=post-install pre-uninstall remote_command.sh \
columnstoreLogRotate transactionLog transactionLogArchiver.sh system_installer.sh \
module_installer.sh patch_installer.sh xm_installer.sh startupTests.sh \
director_installer.sh user_installer.sh performance_installer.sh \
remote_scp_get.sh columnstoreAlias run.sh upgrade-columnstore.sh \
post-mysql-install post-mysqld-install binary_installer.sh \
os_check.sh columnstore columnstoreSyslog columnstoreSyslog-ng syslogSetup.sh \
remote_scp_put.sh columnstoreUninstall.sh columnstore.def \
remotessh.exp master-rep-columnstore.sh slave-rep-columnstore.sh rsync.sh \
myCnf-include-args.text myCnf-exclude-args.text remote_command_verify.sh \
columnstoreSyslog7 disable-rep-columnstore.sh columnstore.conf
LOCAL=module
bootstrap:
umask 002; \
mkdir -p $(INSTALL_ROOT_BIN); \
pushd $(INSTALL_ROOT_BIN) >/dev/null; \
rm -f $(SCRIPTS); \
popd >/dev/null; \
$(INSTALL) $(SCRIPTS) $(INSTALL_ROOT_BIN)
pushd $(INSTALL_ROOT_BIN) >/dev/null; \
chmod -f 555 $(SCRIPTS); \
popd >/dev/null
umask 002; \
mkdir -p $(INSTALL_ROOT_LOCAL); \
pushd $(INSTALL_ROOT_LOCAL) >/dev/null; \
rm -f $(LOCAL); \
popd >/dev/null; \
$(INSTALL) $(LOCAL) $(INSTALL_ROOT_LOCAL)
pushd $(INSTALL_ROOT_LOCAL) >/dev/null; \
chmod -f 555 $(LOCAL); \
popd >/dev/null
clean:
rm -f $(OBJS) $(PROGRAM) core *~ *.tag *.d *.d.*
install: bootstrap
test:
docs:
coverage:
leakcheck:

View File

@@ -24,7 +24,7 @@ set PKGTYPE "binary"
set SERVERTYPE [lindex $argv 6]
set MYSQLPORT [lindex $argv 7]
set DEBUG [lindex $argv 8]
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
set IDIR [lindex $argv 9]
if { $IDIR != "" } {
set INSTALLDIR $IDIR

View File

@@ -13,7 +13,7 @@ set PACKAGE " "
set CONFIGFILE " "
set DEBUG 0
set NODEPS "-h"
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
spawn -noecho /bin/bash

View File

@@ -4,7 +4,7 @@
#
# Uninstall Package from system
set INFINIDB_INSTALL_DIR "/usr/local/Calpont"
set INFINIDB_INSTALL_DIR "/usr/local/MariaDB/Columnstore"
set env(INFINIDB_INSTALL_DIR) $INFINIDB_INSTALL_DIR
set USERNAME $env(USER)

View File

@@ -0,0 +1,184 @@
#!/bin/bash
#
# $Id: columnstore 3704 2013-08-07 03:33:20Z bwilkinson $
#
# columnstore Starts MariaDB Columnstore database platform
#
#
# chkconfig: 2345 99 99
# description: MariaDB Columnstore is a database platform that utilizes Mysql
#
### BEGIN INIT INFO
# Provides: columnstore
# Required-Start: $local_fs $remote_fs $network $syslog $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop InfiniDB DW DBMS
### END INIT INFO
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
if [ -z "$INFINIDB_INSTALL_DIR" ]; then
test -f /etc/default/columnstore && . /etc/default/columnstore
fi
if [ -z "$INFINIDB_INSTALL_DIR" ]; then
INFINIDB_INSTALL_DIR=/usr/local/MariaDB/Columnstore
fi
export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR
InstallDir=$INFINIDB_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=`$INFINIDB_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
if [ -n "$plugin" ]; then
setenv=`$InstallDir/bin/getConfig SystemConfig DataFileEnvFile`
. $InstallDir/bin/$setenv >/dev/null 2>&1
fi
if [ -e $InstallDir/lib/libjemalloc.so ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so
elif [ -e $InstallDir/lib/libjemalloc.so.1 ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so.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/Calpont.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/columnstore
exit 1
fi
}
[ -f $InstallDir/bin/ProcMon ] || exit 0
start() {
if [ -f /var/lock/subsys/columnstore ]; then
echo "MariaDB Columnstore Database Platform already running"
exit 0
fi
(mkdir -p /var/lock/subsys && touch /var/lock/subsys/columnstore) >/dev/null 2>&1
if [ -x $InstallDir/bin/columnstore.pre-start ]; then
$InstallDir/bin/columnstore.pre-start
if [ $? -ne 0 ]; then
echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore"
rm -f /var/lock/subsys/columnstore
exit 1
fi
fi
checkInstallSetup
CoreFileFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Calpont.xml Installation CoreFileFlag`
if [ $CoreFileFlag = "y" ]; then
SUDO=
if [ "$user" != "root" ]; then
SUDO="sudo"
fi
#columnstore 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/Calpont/corefiles/core.%e.%p > /dev/null 2>&1
fi
RETVAL=0
echo "Starting MariaDB Columnstore Database Platform"
rm -f /tmp/StopCalpont
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
return $RETVAL
}
stop() {
echo "Shutting down MariaDB Columnstore 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/columnstore
fuser -k 8604/tcp > /dev/null 2>&1
test -f $InstallDir/mysql/mysql-Calpont || return $RETVAL
$InstallDir/mysql/mysql-Calpont stop > /dev/null 2>&1
if [ -x $InstallDir/bin/columnstore.post-stop ]; then
$InstallDir/bin/columnstore.post-stop
fi
return $RETVAL
}
restart() {
stop
start
}
status() {
isrunning=0
if [ $EUID -eq 0 ]; then
if [ -f /var/lock/subsys/columnstore ]; then
isrunning=1
fi
else
pgrep ProcMon >/dev/null 2>&1
if [ $? -eq 0 ]; then
isrunning=1
fi
fi
if [ $isrunning -ne 0 ]; then
echo "MariaDB Columnstore is running"
else
echo "MariaDB Columnstore is not running"
exit 3
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/columnstore ] && restart || :
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $?

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
# $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

@@ -0,0 +1,13 @@
# 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/Calpont/'
alias log='cd /var/log/Calpont/'
alias core='cd /var/log/Calpont/corefiles'
alias tmsg='tail -f /var/log/messages'
alias tdebug='tail -f /var/log/Calpont/debug.log'
alias tinfo='tail -f /var/log/Calpont/info.log'
alias dbrm='cd /usr/local/Calpont/data1/systemFiles/dbrm'
alias module='cat /usr/local/Calpont/local/module'

View File

@@ -0,0 +1,167 @@
#!/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: Calpont.xml config file with directory location, i.e. /root/Calpont.xml\n"
send_user " Default version is $INSTALLDIR/etc/Calpont.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/Calpont.xml.rpmsave
}
if { [catch { open $CONFIGFILE "r"} handle ] } {
puts "Calpont Config file not found: $CONFIGFILE"; exit 1
}
exec rm -f $INSTALLDIR/etc/Calpont.xml.new > /dev/null 2>&1
exec mv -f $INSTALLDIR/etc/Calpont.xml $INSTALLDIR/etc/Calpont.xml.new > /dev/null 2>&1
exec /bin/cp -f $CONFIGFILE $INSTALLDIR/etc/Calpont.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

@@ -0,0 +1,35 @@
#
# Calpont Log Rotate file that gets installed in /etc/logrotate.d
# as part of the RPM installation
#
/var/log/Calpont/*.log {
missingok
rotate 7
daily
dateext
copytruncate
olddir /var/log/Calpont/archive
}
/var/log/Calpont/*.log1 {
missingok
rotate 7
daily
nocreate
compress
olddir /var/log/Calpont/archive
}
/usr/local/Calpont/etc/Calpont.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

@@ -0,0 +1,7 @@
# Calpont Database Platform Logging
local1.=crit -/var/log/Calpont/crit.log
local1.=err -/var/log/Calpont/err.log
local1.=warning -/var/log/Calpont/warning.log
local1.=info -/var/log/Calpont/info.log
local1.=debug -/var/log/Calpont/debug.log
local2.=crit -/var/log/Calpont/data/data_mods.log

View File

@@ -0,0 +1,78 @@
# Calpont Database Platform Logging
source s_infinidb {
# 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); };
filter f_local2crit { facility(local2) and level(crit); };
destination d_crit{
file("/var/log/Calpont/crit.log");
};
destination d_err{
file("/var/log/Calpont/err.log");
};
destination d_warning{
file("/var/log/Calpont/warning.log");
};
destination d_info{
file("/var/log/Calpont/info.log");
};
destination d_debug{
file("/var/log/Calpont/debug.log");
};
destination d_data_mods{
file("/var/log/Calpont/data/data_mods.log");
};
log{
source(s_infinidb);
filter(f_local1crit);
destination(d_crit);
};
log{
source(s_infinidb);
filter(f_local1err);
destination(d_err);
};
log{
source(s_infinidb);
filter(f_local1warning);
destination(d_warning);
};
log{
source(s_infinidb);
filter(f_local1info);
destination(d_info);
};
log{
source(s_infinidb);
filter(f_local1debug);
destination(d_debug);
};
log{
source(s_infinidb);
filter(f_local2crit);
destination(d_data_mods);
};

View File

@@ -0,0 +1,8 @@
# Calpont Database Platform Logging
local1.crit -/var/log/Calpont/crit.log
local1.err -/var/log/Calpont/err.log
local1.warning -/var/log/Calpont/warning.log
local1.info -/var/log/Calpont/info.log
local1.debug -/var/log/Calpont/debug.log
local2.crit -/var/log/Calpont/data/data_mods.log

View File

@@ -0,0 +1,118 @@
#!/usr/bin/expect
#
# $Id$
#
# Uninstall Package from system
set INFINIDB_INSTALL_DIR "/usr/local/MariaDB/Columnstore"
set env(INFINIDB_INSTALL_DIR) $INFINIDB_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 "$INFINIDB_INSTALL_DIR/bin/getConfig DBRM_Controller NumWorkers\n"
expect {
1 { set INSTALL 1 }
}
set PACKAGE "rpm"
send "$INFINIDB_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 "$INFINIDB_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 "$INFINIDB_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 "$INFINIDB_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

@@ -0,0 +1,184 @@
#!/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 "$INFINIDB_INSTALL_DIR" ]; then
test -f /etc/default/infinidb && . /etc/default/infinidb
fi
if [ -z "$INFINIDB_INSTALL_DIR" ]; then
INFINIDB_INSTALL_DIR=/usr/local/Calpont
fi
export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR
InstallDir=$INFINIDB_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=`$INFINIDB_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
if [ -n "$plugin" ]; then
setenv=`$InstallDir/bin/getConfig SystemConfig DataFileEnvFile`
. $InstallDir/bin/$setenv >/dev/null 2>&1
fi
if [ -e $InstallDir/lib/libjemalloc.so ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so
elif [ -e $InstallDir/lib/libjemalloc.so.1 ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so.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/Calpont.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/Calpont.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/Calpont/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-Calpont || return $RETVAL
$InstallDir/mysql/mysql-Calpont 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

@@ -20,7 +20,7 @@ set CALPONTMYSQLRPM [lindex $argv 6]
set CALPONTMYSQLDRPM [lindex $argv 7]
set INSTALLTYPE [lindex $argv 8]
set DEBUG [lindex $argv 9]
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
set IDIR [lindex $argv 10]
if { $IDIR != "" } {
set INSTALLDIR $IDIR

View File

@@ -0,0 +1,74 @@
#!/bin/bash
#
# $Id$
#
# generic InfiniDB Disable Replication script.
#
# Notes: This script gets run by ProcMon:
# check log for error
checkForError() {
grep ERROR /tmp/disable-rep-status.log > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "ERROR: check log file: /tmp/disable-rep-status.log"
rm -f /tmp/error.check
exit 1
fi
rm -f /tmp/error.check
}
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
fi
done
test -f $installdir/post/functions && . $installdir/post/functions
>/tmp/disable-rep-status.log
#
# Run stop slave command
#
echo "Run stop slave command" >>/tmp/disable-rep-status.log
cat >/tmp/idb_disable-rep.sql <<EOD
stop slave;
EOD
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
checkForError
#
# Run reset slave command
#
echo "Run start slave command" >>/tmp/disable-rep-status.log
cat >/tmp/idb_disable-rep.sql <<EOD
reset slave;
EOD
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
checkForError
#alls good, 'OK' for success
echo "OK"
exit 0

View File

@@ -18,12 +18,12 @@ checkForError() {
}
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"

View File

@@ -0,0 +1,13 @@
#!/bin/bash
#
# $Id: install-infinidb.sh 421 2007-04-05 15:46:55Z dhill $
#
# install-infinidb.sh dummy EE version
echo " " 1>&2
echo " This install-infinidb.sh script is only used to install the Community Edition." 1>&2
echo " Please use the 'postConfigure' for installing the Enterprise Edition." 1>&2
echo " Check the Calpont InfiniDB Installation Document for further details." 1>&2
exit 1

View File

@@ -0,0 +1,102 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author/>
<email>dhill@srvhill04.calpont.com</email>
<version>$VERSION$</version>
<projectmanagement>KDevCustomProject</projectmanagement>
<primarylanguage>C</primarylanguage>
<ignoreparts/>
</general>
<kdevcustomproject>
<run>
<mainprogram>install_scripts</mainprogram>
<directoryradio>executable</directoryradio>
</run>
</kdevcustomproject>
<kdevdebugger>
<general>
<dbgshell/>
</general>
</kdevdebugger>
<kdevdoctreeview>
<ignoretocs>
<toc>ada</toc>
<toc>ada_bugs_gcc</toc>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>kde2book</toc>
<toc>libstdc++</toc>
<toc>opengl</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>qt-kdev3</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>stl</toc>
<toc>sw</toc>
<toc>w3c-dom-level2-html</toc>
<toc>w3c-svg</toc>
<toc>w3c-uaag10</toc>
<toc>wxwidgets_bugs</toc>
</ignoretocs>
<ignoreqt_xml>
<toc>Guide to the Qt Translation Tools</toc>
<toc>Qt Assistant Manual</toc>
<toc>Qt Designer Manual</toc>
<toc>Qt Reference Documentation</toc>
<toc>qmake User Guide</toc>
</ignoreqt_xml>
<ignoredoxygen>
<toc>KDE Libraries (Doxygen)</toc>
</ignoredoxygen>
</kdevdoctreeview>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="c" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
<includeEnums>true</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
</kdevcppsupport>
<kdevfileview>
<groups>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
</tree>
</kdevfileview>
</kdevelop>

View File

@@ -0,0 +1,4 @@
# KDevelop Custom Project File List
Makefile
Makefile.am
Makefile.in

Binary file not shown.

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="8" >
<Doc0 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/binary_installer.sh" >
<View0 line="0" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/syslogSetup.sh" >
<View0 line="37" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/module_installer.sh" >
<View0 line="99" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/post-install" >
<View0 line="82" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/remote_installer.sh" >
<View0 line="24" Type="Source" />
</Doc4>
<Doc5 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/pre-uninstall" >
<View0 line="5" Type="Source" />
</Doc5>
<Doc6 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/Makefile" >
<View0 line="13" Type="Source" />
</Doc6>
<Doc7 NumberOfViews="1" URL="file:///home/dhill/InfiniDB_MariaDB/oam/install_scripts/columnstore" >
<View0 line="179" Type="Source" />
</Doc7>
</DocsAndViews>
<pluginList>
<kdevdebugger>
<breakpointList/>
</kdevdebugger>
<kdevbookmarks>
<bookmarks/>
</kdevbookmarks>
<kdevvalgrind>
<executable path="" params="" />
<valgrind path="" params="" />
<calltree path="" params="" />
<kcachegrind path="" />
</kdevvalgrind>
</pluginList>
</KDevPrjSession>

View File

@@ -0,0 +1,112 @@
#!/bin/bash
#
# $Id$
#
# generic InfiniDB Master Replication script.
#
# Notes: This script gets run by ProcMon during installs and upgrades:
# check log for error
checkForError() {
grep ERROR /tmp/master-rep-status-$hostipaddr.log > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "ERROR: check log file: /tmp/master-rep-status-$hostipaddr.log"
rm -f /tmp/error.check
exit 1
fi
rm -f /tmp/error.check
}
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--hostIP='` -eq 9 ]; then
hostipaddr="`echo $arg | awk -F= '{print $2}'`"
fi
done
test -f $installdir/post/functions && . $installdir/post/functions
repUser="idbrep"
password="Calpont1"
>/tmp/master-rep-status-$hostipaddr.log
#
# Create Replication User
#
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
cat >/tmp/idb_master-rep.sql <<EOD
CREATE USER '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
EOD
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
checkForError
#
# Grant table access for created user
#
echo "Grant table access for $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
cat >/tmp/idb_master-rep.sql <<EOD
use mysql
grant all on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
grant REPLICATION SLAVE on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
EOD
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
checkForError
#
# Run SHOW MASTER STATUS
#
echo "Run SHOW MASTER STATUS to node log" >>/tmp/master-rep-status-$hostipaddr.log
cat >/tmp/idb_master-rep.sql <<EOD
SHOW MASTER STATUS
EOD
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
checkForError
echo "Run SHOW MASTER STATUS to master status log /tmp/show-master-status.log" >>/tmp/master-rep-status-$hostipaddr.log
cat >/tmp/idb_master-rep.sql <<EOD
SHOW MASTER STATUS
EOD
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
#alls good, 'OK' for success
echo "OK"
exit 0

View File

@@ -18,12 +18,12 @@ checkForError() {
}
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"

View File

@@ -5,12 +5,12 @@
# Setup the Custom OS files during a System install on a module
#
#
# append calpont OS files to Linux OS file
# append columnstore OS files to Linux OS file
#
#
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
if [ -z "$user" ]; then
@@ -22,7 +22,7 @@ shiftcnt=0
for arg in "$@"; do
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
prefix="$(echo $arg | awk -F= '{print $2}')"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
((shiftcnt++))
elif [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then
rpmmode="$(echo $arg | awk -F= '{print $2}')"
@@ -47,7 +47,7 @@ for arg in "$@"; do
done
shift $shiftcnt
if [ $installdir != "/usr/local/Calpont" ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib:$INFINIDB_INSTALL_DIR/mysql/lib/mysql
fi
@@ -60,8 +60,8 @@ if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
if test -f $INFINIDB_INSTALL_DIR/local/etc/pm1/fstab ; then
echo "Setup fstab on Module"
touch /etc/fstab
rm -f /etc/fstab.calpontSave
mv /etc/fstab /etc/fstab.calpontSave
rm -f /etc/fstab.columnstoreSave
mv /etc/fstab /etc/fstab.columnstoreSave
cat $INFINIDB_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab
fi
fi
@@ -97,17 +97,17 @@ if [ $module = "pm" ]; then
fi
echo "Setup rc.local on Module"
if [ $EUID -eq 0 -a -f $INFINIDB_INSTALL_DIR/local/rc.local.calpont ]; then
if [ $EUID -eq 0 -a -f $INFINIDB_INSTALL_DIR/local/rc.local.columnstore ]; then
if [ $user = "root" ]; then
touch /etc/rc.local
rm -f /etc/rc.local.calpontSave
cp /etc/rc.local /etc/rc.local.calpontSave
cat $INFINIDB_INSTALL_DIR/local/rc.local.calpont >> /etc/rc.local
rm -f /etc/rc.local.columnstoreSave
cp /etc/rc.local /etc/rc.local.columnstoreSave
cat $INFINIDB_INSTALL_DIR/local/rc.local.columnstore >> /etc/rc.local
else
sudo touch /etc/rc.local
sudo rm -f /etc/rc.local.calpontSave
sudo cp /etc/rc.local /etc/rc.local.calpontSave
sudo cat $INFINIDB_INSTALL_DIR/local/rc.local.calpont >> /etc/rc.local
sudo rm -f /etc/rc.local.columnstoreSave
sudo cp /etc/rc.local /etc/rc.local.columnstoreSave
sudo cat $INFINIDB_INSTALL_DIR/local/rc.local.columnstore >> /etc/rc.local
fi
fi

View File

@@ -0,0 +1,167 @@
#!/bin/bash
#
# $Id: module_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Setup the Custom OS files during a System install on a module
#
#
# append calpont OS files to Linux OS file
#
#
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
if [ -z "$user" ]; then
user=root
fi
quiet=0
shiftcnt=0
for arg in "$@"; do
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
prefix="$(echo $arg | awk -F= '{print $2}')"
installdir=$prefix/MariaDB/Columnstore
((shiftcnt++))
elif [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then
rpmmode="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++))
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
installdir="$(echo $arg | awk -F= '{print $2}')"
prefix=$(dirname $installdir)
((shiftcnt++))
elif [ $(expr -- "$arg" : '--user=') -eq 7 ]; then
user="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++))
elif [ $(expr -- "$arg" : '--quiet') -eq 7 ]; then
quiet=1
((shiftcnt++))
elif [ $(expr -- "$arg" : '--port') -eq 6 ]; then
mysqlPort="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++))
elif [ $(expr -- "$arg" : '--module') -eq 8 ]; then
module="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++))
fi
done
shift $shiftcnt
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib:$INFINIDB_INSTALL_DIR/mysql/lib/mysql
fi
export INFINIDB_INSTALL_DIR=$installdir
cloud=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation Cloud`
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
cp $INFINIDB_INSTALL_DIR/local/etc/*.pem /root/. > /dev/null 2>&1
if test -f $INFINIDB_INSTALL_DIR/local/etc/pm1/fstab ; then
echo "Setup fstab on Module"
touch /etc/fstab
rm -f /etc/fstab.calpontSave
mv /etc/fstab /etc/fstab.calpontSave
cat $INFINIDB_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab
fi
fi
test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions
mid=`module_id`
#if um, cloud, separate system type, external um storage, then setup mount
if [ $module = "um" ]; then
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
systemtype=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
if [ $systemtype = "1" ]; then
umstoragetype=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation UMStorageType`
if [ $umstoragetype = "external" ]; then
echo "Setup UM Volume Mount"
device=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation UMVolumeDeviceName$mid`
mkdir -p $INFINIDB_INSTALL_DIR/mysql/db > /dev/null 2>&1
mount $device $INFINIDB_INSTALL_DIR/mysql/db -t ext2 -o defaults
chown mysql:mysql -R $INFINIDB_INSTALL_DIR/mysql > /dev/null 2>&1
fi
fi
fi
fi
#if pm, create dbroot directories
if [ $module = "pm" ]; then
numdbroots=`$INFINIDB_INSTALL_DIR/bin/getConfig SystemConfig DBRootCount`
for (( id=1; id<$numdbroots+1; id++ )); do
mkdir -p $INFINIDB_INSTALL_DIR/data$id > /dev/null 2>&1
chmod 755 $INFINIDB_INSTALL_DIR/data$id
done
fi
echo "Setup rc.local on Module"
if [ $EUID -eq 0 -a -f $INFINIDB_INSTALL_DIR/local/rc.local.calpont ]; then
if [ $user = "root" ]; then
touch /etc/rc.local
rm -f /etc/rc.local.calpontSave
cp /etc/rc.local /etc/rc.local.calpontSave
cat $INFINIDB_INSTALL_DIR/local/rc.local.calpont >> /etc/rc.local
else
sudo touch /etc/rc.local
sudo rm -f /etc/rc.local.calpontSave
sudo cp /etc/rc.local /etc/rc.local.calpontSave
sudo cat $INFINIDB_INSTALL_DIR/local/rc.local.calpont >> /etc/rc.local
fi
fi
if [ $user != "root" ]; then
echo "Setup .bashrc on Module for non-root"
eval userhome=~$user
bashFile=$userhome/.bashrc
touch ${bashFile}
echo " " >> ${bashFile}
echo "export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR" >> ${bashFile}
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib:$INFINIDB_INSTALL_DIR/mysql/lib/mysql" >> ${bashFile}
fi
plugin=`$INFINIDB_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
if [ -n "$plugin" ]; then
echo "Setup .bashrc on Module for local-query"
setenv=`$INFINIDB_INSTALL_DIR/bin/getConfig SystemConfig DataFileEnvFile`
eval userhome=~$user
bashFile=$userhome/.bashrc
touch ${bashFile}
echo " " >> ${bashFile}
echo ". $INFINIDB_INSTALL_DIR/bin/$setenv" >> ${bashFile}
fi
# if mysqlrep is on and module has a my.cnf file, upgrade it
MySQLRep=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation MySQLRep`
if [ $MySQLRep = "y" ]; then
if test -f $INFINIDB_INSTALL_DIR/mysql/my.cnf ; then
echo "Run Upgrade on my.cnf on Module"
$INFINIDB_INSTALL_DIR/bin/mycnfUpgrade > /tmp/mycnfUpgrade.log 2>&1
fi
fi
if test -f $INFINIDB_INSTALL_DIR/mysql/my.cnf ; then
echo "Run Mysql Port update on my.cnf on Module"
$INFINIDB_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > /tmp/mycnfUpgrade_port.log 2>&1
fi
# if um, run mysql install scripts
if [ $module = "um" ]; then
echo "Run post-mysqld-install"
$INFINIDB_INSTALL_DIR/bin/post-mysqld-install > /tmp/post-mysqld-install.log 2>&1
echo "Run post-mysql-install"
$INFINIDB_INSTALL_DIR/bin/post-mysql-install > /tmp/post-mysql-install.log 2>&1
fi
echo " "
echo "!!!Module Installation Successfully Completed!!!"
exit 0

View File

@@ -19,7 +19,7 @@ set INSTALLTYPE [lindex $argv 4]
set PKGTYPE [lindex $argv 5]
set NODEPS [lindex $argv 6]
set DEBUG [lindex $argv 7]
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
set IDIR [lindex $argv 8]
if { $IDIR != "" } {
set INSTALLDIR $IDIR

View File

@@ -2,10 +2,10 @@
#
# $Id: post-install 3705 2013-08-07 19:47:20Z dhill $
#
# Post-install steps for calpont install
# Post-install steps for columnstore install
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
if [ -z "$user" ]; then
@@ -16,7 +16,7 @@ quiet=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
@@ -33,7 +33,7 @@ for arg in "$@"; do
fi
done
if [ $installdir != "/usr/local/Calpont" ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib
else
@@ -141,7 +141,7 @@ mkdir /var/log/Calpont/data/archive > /dev/null 2>&1
# install Calpont Log Rotate File
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
cp $installdir/bin/calpontLogRotate /etc/logrotate.d/calpont > /dev/null 2>&1
cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
rm -rf $installdir/mysql/db/infinidb_log_archive > /dev/null 2>&1
# delete Calpont shared memory segments
@@ -174,7 +174,7 @@ else
sudo rm -f /var/lock/subsys/mysql-Calpont
sudo rm -f /tmp/StopCalpont
sed -i -e s@/usr/local/Calpont@$installdir@g $installdir/bin/infinidb.def
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/bin/infinidb.def
sudo cp $installdir/bin/infinidb.def /etc/default/infinidb
fi
@@ -188,17 +188,17 @@ fi
eval userhome=~$user
bashFile=$userhome/.bashrc
touch ${bashFile}
if [ $installdir != "/usr/local/Calpont" ]; then
sed -i -e s@/usr/local/Calpont@$installdir@g $installdir/bin/calpontAlias
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/bin/columnstoreAlias
fi
egrep -qs 'Calpont Database Platform Alias Commands' ${bashFile}
rc1=$?
egrep -qs 'InfiniDB Alias Commands' ${bashFile}
rc2=$?
if [ $rc1 -ne 0 -a $rc2 -ne 0 ]; then
rm -f ${bashFile}.calpontSave
cp ${bashFile} ${bashFile}.calpontSave >/dev/null 2>&1
cat $installdir/bin/calpontAlias >> ${bashFile}
rm -f ${bashFile}.columnstoreSave
cp ${bashFile} ${bashFile}.columnstoreSave >/dev/null 2>&1
cat $installdir/bin/columnstoreAlias >> ${bashFile}
echo " " >> ${bashFile}
fi
@@ -221,7 +221,7 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib $installdir/bin/cplogger -i 19
hadoop=`which hadoop 2>/dev/null`
if [ -z $hadoop ]; then
#check for non-root user
if [ $installdir != "/usr/local/Calpont" -a $quiet -eq 0 ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
The next steps are:
@@ -251,7 +251,7 @@ else
$installdir/bin/setConfig -d SystemConfig DataFileEnvFile setenv-hdfs-20
#check for non-root user
if [ $installdir != "/usr/local/Calpont" -a $quiet -eq 0 ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:
@@ -290,7 +290,7 @@ EOD
$installdir/bin/setConfig -d SystemConfig DataFilePlugin $installdir/lib/hdfs-12.so
$installdir/bin/setConfig -d SystemConfig DataFileEnvFile setenv-hdfs-12
if [ $installdir != "/usr/local/Calpont" -a $quiet -eq 0 ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:

336
oam/install_scripts/post-install~ Executable file
View File

@@ -0,0 +1,336 @@
#!/bin/bash
#
# $Id: post-install 3705 2013-08-07 19:47:20Z dhill $
#
# Post-install steps for calpont install
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
if [ -z "$user" ]; then
user=root
fi
quiet=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
user="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--quiet'` -eq 7 ]; then
quiet=1
elif [ `expr -- "$arg" : '--plugin='` -eq 9 ]; then
plugin="`echo $arg | awk -F= '{print $2}'`"
else
echo "post-install: ignoring unknown argument: $arg" 1>&2
fi
done
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib
else
# add library config file
/bin/cp -f $installdir/bin/infinidb.conf /etc/ld.so.conf.d/.
ldconfig
fi
#check 64-bit OS compatiable
arch=`uname -m`
patcnt=`expr "$arch" : 'i.86'`
is64bitos=1
if [ $patcnt -ne 0 ]; then
is64bitos=0
fi
is64bitpkg=1
file $installdir/bin/PrimProc | grep '64-bit' >/dev/null 2>&1
if [ $? -ne 0 ]; then
is64bitpkg=0
fi
if [ $is64bitpkg -eq 1 -a $is64bitos -ne 1 ]; then
echo "ERROR: Incompatiable Version, package is intended for a x86_64 architecture"
echo "exiting...."
exit 1
fi
if [ ! -f $installdir/etc/Calpont.xml ]; then
echo "$installdir/etc/Calpont.xml not found, exiting"
exit 1
fi
cd $installdir/lib || exit 1
for lib in *.so.1.0.0; do
blib=`basename $lib .1.0.0`
ln -sf $lib $blib
done
chown -h $user.$user *.so >/dev/null 2>&1
if [ -f libnetsnmp.so.5.2.1 ]; then
for lib in *.so.5.2.1; do
blib=`basename $lib .5.2.1`
ln -sf $lib $blib
ln -sf $lib ${blib}.5
done
chown -h $user.$user *.so *.so.5 >/dev/null 2>&1
fi
if [ -f libstdc++.so.6.0.14 ]; then
ln -sf libstdc++.so.6.0.14 libstdc++.so.6
chown -h $user.$user libstdc++.so.6 >/dev/null 2>&1
fi
ln -sf libjemalloc.so.3.3.0 libjemalloc.so
chown -h $user.$user libjemalloc.so >/dev/null 2>&1
# TODO-based on early experience with HDP it doesn't install bigtop
# so the code below will not correctly detect JAVA_HOME. Need to
# decide how to handle
# Autodetect JAVA_HOME if not defined
#if [ -e /usr/libexec/bigtop-detect-javahome ]; then
#. /usr/libexec/bigtop-detect-javahome
#elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
#. /usr/lib/bigtop-utils/bigtop-detect-javahome
#fi
#ln -sf $JAVA_HOME/jre/lib/amd64/server/libjvm.so
#chown -h $user.$user libjvm.so >/dev/null 2>&1
cd /
test -d /var/log/Calpont || mkdir /var/log/Calpont >/dev/null 2>&1
test -d /var/log/Calpont/archive || mkdir /var/log/Calpont/archive >/dev/null 2>&1
test -d /var/log/Calpont/corefiles || mkdir /var/log/Calpont/corefiles >/dev/null 2>&1
test -d /var/log/Calpont/trace || mkdir /var/log/Calpont/trace >/dev/null 2>&1
test -h /var/log/Calpont/data && rm -f /var/log/Calpont/data
test -d /var/log/Calpont/data || mkdir /var/log/Calpont/data >/dev/null 2>&1
# make sure trace dir is world-writable and sticky
chmod 1755 /var/log/Calpont/trace >/dev/null 2>&1
test -d $installdir/data || mkdir $installdir/data
test -d $installdir/data1 || mkdir $installdir/data1
test -d $installdir/data1/systemFiles || mkdir $installdir/data1/systemFiles
test -d $installdir/data1/systemFiles/dbrm || mkdir $installdir/data1/systemFiles/dbrm
test -d $installdir/data1/systemFiles/dataTransaction || rmdir $installdir/data1/systemFiles/dataTransaction >/dev/null 2>&1
test -d $installdir/data1/systemFiles/dataTransaction/archive || rmdir $installdir/data1/systemFiles/dataTransaction/archive >/dev/null 2>&1
chmod 1755 $installdir/data1 >/dev/null 2>&1
chmod -R 1755 $installdir/data1/systemFiles >/dev/null 2>&1
chmod 1755 $installdir/etc > /dev/null 2>&1
#create the bulk-load dirs
mkdir -p $installdir/data/bulk/data/import >/dev/null 2>&1
mkdir -p $installdir/data/bulk/log >/dev/null 2>&1
mkdir -p $installdir/data/bulk/job >/dev/null 2>&1
mkdir -p $installdir/data/bulk/rollback >/dev/null 2>&1
mkdir -p $installdir/data/bulk/tmpjob >/dev/null 2>&1
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
chmod -R 755 $installdir/data/bulk >/dev/null 2>&1
#create infinidb temp file directory
mkdir -p /tmp/infinidb_tmp_files >/dev/null 2>&1
#setup core file directory and link
mkdir /var/log/Calpont/corefiles > /dev/null 2>&1
chmod 755 /var/log/Calpont/corefiles > /dev/null 2>&1
#create mount directories
mkdir /mnt/tmp > /dev/null 2>&1
mkdir /var/log/Calpont/data/archive > /dev/null 2>&1
# install Calpont Log Rotate File
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
cp $installdir/bin/calpontLogRotate /etc/logrotate.d/calpont > /dev/null 2>&1
rm -rf $installdir/mysql/db/infinidb_log_archive > /dev/null 2>&1
# delete Calpont shared memory segments
$installdir/bin/Calpont/bin/clearShm > /dev/null 2>&1
#setup the infinidb service script
rm -f /etc/init.d/infinidb >/dev/null 2>&1
cp $installdir/bin/infinidb /etc/init.d >/dev/null 2>&1
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add infinidb > /dev/null 2>&1
/sbin/chkconfig infinidb on > /dev/null 2>&1
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d infinidb defaults 99 > /dev/null 2>&1
else
echo ""
echo "Package 'chkconfig' or 'update-rc.d' not installed, contact your sysadmin if you want to setup to autostart for infinidb"
fi
#setup InfiniDB system logging
if [ $user = "root" ]; then
$installdir/bin/syslogSetup.sh install > /tmp/syslog_install.log 2>&1
chmod 777 -R /dev/shm
rm -f /etc/default/infinidb
else
sudo $installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
sudo chown $user:$user $installdir/etc/Calpont.xml
sudo chmod 755 /var/log
sudo chmod -R 755 /var/log/Calpont
sudo chmod -R 777 /dev/shm
sudo rm -f /var/lock/subsys/mysql-Calpont
sudo rm -f /tmp/StopCalpont
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/bin/infinidb.def
sudo cp $installdir/bin/infinidb.def /etc/default/infinidb
fi
#check if InfiniDB system logging was setup
cat /tmp/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
if [ $? -eq 0 ]; then
cat /tmp/syslog_install.log
fi
#setup alias commands
eval userhome=~$user
bashFile=$userhome/.bashrc
touch ${bashFile}
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/bin/calpontAlias
fi
egrep -qs 'Calpont Database Platform Alias Commands' ${bashFile}
rc1=$?
egrep -qs 'InfiniDB Alias Commands' ${bashFile}
rc2=$?
if [ $rc1 -ne 0 -a $rc2 -ne 0 ]; then
rm -f ${bashFile}.calpontSave
cp ${bashFile} ${bashFile}.calpontSave >/dev/null 2>&1
cat $installdir/bin/calpontAlias >> ${bashFile}
echo " " >> ${bashFile}
fi
#check and get amazon EC2 env variables
if [ -n "$EC2_HOME" ]; then
$installdir/bin/setConfig -d Installation EC2_HOME $EC2_HOME
if [ -n "$EC2_HOME" ]; then
$installdir/bin/setConfig -d Installation JAVA_HOME $JAVA_HOME
fi
$installdir/bin/setConfig -d Installation EC2_PATH $PATH:/home/ec2/bin:/opt/aws/bin
fi
#log install message
test -f $installdir/post/functions && . $installdir/post/functions
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib $installdir/bin/cplogger -i 19 "***** InfiniDB Installed *****"
#setup hadoop
hadoop=`which hadoop 2>/dev/null`
if [ -z $hadoop ]; then
#check for non-root user
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
The next steps are:
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib/mysql
$installdir/bin/postConfigure -i $installdir
EOD
else
cat <<EOD
The next step is:
$installdir/bin/postConfigure
EOD
fi
exit 0
else
chmod 755 $installdir/bin/setenv-hdfs-12
chmod 755 $installdir/bin/setenv-hdfs-20
. $installdir/bin/setenv-hdfs-20
$installdir/bin/hdfsCheck $installdir/lib/hdfs-20.so > /tmp/hdfs-20-test.log 2>&1
if [ $? -eq 0 ]; then
#Passed set in config file
$installdir/bin/setConfig -d SystemConfig DataFilePlugin $installdir/lib/hdfs-20.so
$installdir/bin/setConfig -d SystemConfig DataFileEnvFile setenv-hdfs-20
#check for non-root user
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib/mysql
. $installdir/bin/setenv-hdfs-20
$installdir/bin/postConfigure -i $installdir
If you are intending to install InfiniDB without Hadoop, the next steps are:
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib/mysql
$installdir/bin/postConfigure -i $installdir
EOD
else
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:
. $installdir/bin/setenv-hdfs-20
$installdir/bin/postConfigure
If you are intending to install InfiniDB without Hadoop, the next step is:
$installdir/bin/postConfigure
EOD
fi
else
. $installdir/bin/setenv-hdfs-12
$installdir/bin/hdfsCheck $installdir/lib/hdfs-12.so > /tmp/hdfs-12-test.log 2>&1
if [ $? -eq 0 ]; then
#Passed set in config file
$installdir/bin/setConfig -d SystemConfig DataFilePlugin $installdir/lib/hdfs-12.so
$installdir/bin/setConfig -d SystemConfig DataFileEnvFile setenv-hdfs-12
if [ $installdir != "/usr/local/MariaDB/Columnstore" -a $quiet -eq 0 ]; then
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib/mysql:$libpath
. $installdir/bin/setenv-hdfs-12
$installdir/bin/postConfigure -i $installdir
If you are intending to install InfiniDB without Hadoop, the next steps are:
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib/mysql
$installdir/bin/postConfigure -i $installdir
EOD
else
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the next steps are:
. $installdir/bin/setenv-hdfs-12
$installdir/bin/postConfigure
If you are intending to install InfiniDB without Hadoop, the next step is:
$installdir/bin/postConfigure
EOD
fi
else
cat <<EOD
If you are intending to install InfiniDB over Hadoop, the Hadoop sanity check did not pass.
Most likely there is an environment setup conflict or the hdfs services are down.
Please Contact InfiniDB Customer Support.
EOD
fi
fi
fi
exit 0

View File

@@ -47,14 +47,14 @@ checkForError() {
}
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
password=
for arg in "$@"; do
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
prefix="$(echo $arg | awk -F= '{print $2}')"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then
rpmmode="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
@@ -67,7 +67,7 @@ for arg in "$@"; do
fi
done
if [ $installdir != "/usr/local/Calpont" ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib:$INFINIDB_INSTALL_DIR/mysql/lib/mysql
fi
@@ -89,8 +89,8 @@ if [ -d $installdir/mysql/lib64/mysql/plugin -a -n "$libcalmysql" ]; then
ln -sf $libudfsdk libudf_mysql.so
fi
if [ $installdir != "/usr/local/Calpont" ]; then
sed -i -e s@/usr/local/Calpont@$installdir@g $installdir/mysql/my.cnf
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/mysql/my.cnf
fi
if [ -x $installdir/mysql/mysql-Calpont ]; then

View File

@@ -5,7 +5,7 @@
# Post-install steps for infinidb-mysql install
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=mysql
if [ $EUID -ne 0 ]; then
@@ -15,7 +15,7 @@ fi
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
@@ -60,8 +60,8 @@ usermod -g $user $user 2> /dev/null || true
chown -R $user:$user $installdir/mysql
# Initiate databases if needed
if [ $installdir != "/usr/local/Calpont" ]; then
sed -i -e s@/usr/local/Calpont@$installdir@g $installdir/mysql/my.cnf
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
sed -i -e s@/usr/local/MariaDB/Columnstore@$installdir@g $installdir/mysql/my.cnf
fi
# InfiniDB testing hook...

View File

@@ -13,7 +13,7 @@ set PASSWORD " "
set CONFIGFILE " "
set DEBUG 0
set USERNAME "root"
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
spawn -noecho /bin/bash

View File

@@ -2,10 +2,10 @@
#
# $Id: post-uninstall 421 2007-04-05 15:46:55Z dhill $
#
# Post-uninstall steps for calpont install
# Post-uninstall steps for columnstore install
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
sudo=sudo
@@ -18,7 +18,7 @@ quiet=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
@@ -35,11 +35,11 @@ done
#stop services
$installdir/bin/infinidb stop > /dev/null 2>&1
if test -f /etc/init.d/calpont-Mysql ; then
$installdir/myql/calpont-Mysql stop > /dev/null 2>&1
if test -f /etc/init.d/columnstore-Mysql ; then
$installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
fi
if [ $installdir == "/usr/local/Calpont" ]; then
if [ $installdir == "/usr/local/MariaDB/Columnstore" ]; then
# remove library config file
rm -f /etc/ld.so.conf.d/infinidb.conf
rm -f /etc/ld.so.cache
@@ -47,19 +47,19 @@ if [ $installdir == "/usr/local/Calpont" ]; then
fi
# uninstall OS scripts updated by postConfigure
if test -f /root/.bashrc.calpontSave ; then
$sudo mv -f /root/.bashrc.calpontSave /root/.bashrc > /dev/null 2>&1
if test -f /root/.bashrc.columnstoreSave ; then
$sudo mv -f /root/.bashrc.columnstoreSave /root/.bashrc > /dev/null 2>&1
fi
if test -f /etc/exports.calpontSave ; then
$sudo mv -f /etc/exports.calpontSave /etc/exports > /dev/null 2>&1
if test -f /etc/exports.columnstoreSave ; then
$sudo mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
else
$sudo rm -f /etc/exports > /dev/null 2>&1
fi
if test -f /etc/rc.d/rc.local.calpontSave ; then
$sudo mv -f /etc/rc.d/rc.local.calpontSave /etc/rc.d/rc.local > /dev/null 2>&1
if test -f /etc/rc.d/rc.local.columnstoreSave ; then
$sudo mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1
fi
if test -f /etc/rc.local.calpontSave ; then
$sudo mv -f /etc/rc.local.calpontSave /etc/rc.local > /dev/null 2>&1
if test -f /etc/rc.local.columnstoreSave ; then
$sudo mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1
fi
export INFINIDB_INSTALL_DIR=$installdir
@@ -80,7 +80,7 @@ rm -rf $installdir/mysql/db/infinidb_log_archive > /dev/null 2>&1
sudo rm -f /etc/default/infinidb
# remove Calpont Log Rotate File abd Transaction Log File
rm -f /etc/logrotate.d/calpont > /dev/null 2>&1
rm -f /etc/logrotate.d/columnstore > /dev/null 2>&1
rm -f /etc/cron.d/transactionLog > /dev/null 2>&1
# delete Calpont shared memory segments
@@ -94,10 +94,10 @@ rm -f /etc/pscollect > /dev/null 2>&1
systemctl reload crond.service > /dev/null 2>&1
# delete tmp files
rm -f $installdir/local/*.calpont
rm -f $installdir/local/*.columnstore
rm -rf $installdir/local/etc/
rm -rf /tmp/bucketreuse
rm -f /tmp/calpont.txt
rm -f /tmp/columnstore.txt
rm -f /tmp/dbbuilder.*
rm -f /tmp/dbrmfiles
rm -f /var/lock/subsys/infinidb

View File

@@ -0,0 +1,156 @@
#!/bin/bash
#
# $Id: post-uninstall 421 2007-04-05 15:46:55Z dhill $
#
# Post-uninstall steps for calpont install
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
rpmmode=install
user=$USER
sudo=sudo
if [ -z "$user" ]; then
user=root
sudo=" "
fi
quiet=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
user="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--quiet'` -eq 7 ]; then
quiet=1
else
echo "post-uninstall: ignoring unknown argument: $arg" 1>&2
fi
done
#stop services
$installdir/bin/infinidb stop > /dev/null 2>&1
if test -f /etc/init.d/calpont-Mysql ; then
$installdir/myql/calpont-Mysql stop > /dev/null 2>&1
fi
if [ $installdir == "/usr/local/MariaDB/Columnstore" ]; then
# remove library config file
rm -f /etc/ld.so.conf.d/infinidb.conf
rm -f /etc/ld.so.cache
ldconfig
fi
# uninstall OS scripts updated by postConfigure
if test -f /root/.bashrc.calpontSave ; then
$sudo mv -f /root/.bashrc.calpontSave /root/.bashrc > /dev/null 2>&1
fi
if test -f /etc/exports.calpontSave ; then
$sudo mv -f /etc/exports.calpontSave /etc/exports > /dev/null 2>&1
else
$sudo rm -f /etc/exports > /dev/null 2>&1
fi
if test -f /etc/rc.d/rc.local.calpontSave ; then
$sudo mv -f /etc/rc.d/rc.local.calpontSave /etc/rc.d/rc.local > /dev/null 2>&1
fi
if test -f /etc/rc.local.calpontSave ; then
$sudo mv -f /etc/rc.local.calpontSave /etc/rc.local > /dev/null 2>&1
fi
export INFINIDB_INSTALL_DIR=$installdir
cloud=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation Cloud`
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
if test -f /etc/fstab ; then
$sudo sed -i '/Calpont\/data/d' /etc/fstab > /dev/null 2>&1
fi
fi
#remove log file directories
#rm -rf /var/log/Calpont > /dev/null 2>&1
#rm -f $installdir/mysql/db/*.err > /dev/null 2>&1
rm -f /var/log/Calpont/activeAlarms > /dev/null 2>&1
rm -f /var/log/Calpont/*.log1 > /dev/null 2>&1
rm -rf $installdir/mysql/db/infinidb_log_archive > /dev/null 2>&1
sudo rm -f /etc/default/infinidb
# remove Calpont Log Rotate File abd Transaction Log File
rm -f /etc/logrotate.d/calpont > /dev/null 2>&1
rm -f /etc/cron.d/transactionLog > /dev/null 2>&1
# delete Calpont shared memory segments
pkill -9 ProcMon
$installdir/bin/clearShm > /dev/null 2>&1
# delete prat files
rm -f /etc/cron.d/ps > /dev/null 2>&1
rm -f /etc/pscollect > /dev/null 2>&1
/etc/init.d/crond reload > /dev/null 2>&1
systemctl reload crond.service > /dev/null 2>&1
# delete tmp files
rm -f $installdir/local/*.calpont
rm -rf $installdir/local/etc/
rm -rf /tmp/bucketreuse
rm -f /tmp/calpont.txt
rm -f /tmp/dbbuilder.*
rm -f /tmp/dbrmfiles
rm -f /var/lock/subsys/infinidb
rm -f /tmp/pkgcheck
rm -f /tmp/upgrade-status.log.*
rm -f /tmp/mount.log
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
rm -rf /tmp/infinidb_tmp_files
rm -f $installdir/local/moveDbrootTransactionLog
#delete any old setenv files under home directory
if [ $user = "root" ]; then
rm -f /root/setenv-hdfs*
else
rm -f /home/$user/setenv-hdfs*
fi
# delete core files
#rm -f /var/log/Calpont/corefiles/* > /dev/null 2>&1
#uninstall InfiniDB system logging
if [ -x $installdir/bin/syslogSetup.sh ]; then
if [ $user = "root" ]; then
$installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
rm -f /etc/init.d/infinidb > /dev/null 2>&1
else
sudo $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
fi
fi
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig infinidb off > /dev/null 2>&1
/sbin/chkconfig --del infinidb > /dev/null 2>&1
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d -f infinidb remove > /dev/null 2>&1
fi
if [ $quiet != 1 ]; then
#make copy of Calpont.xml
/bin/cp -f $installdir/etc/Calpont.xml $installdir/etc/Calpont.xml.rpmsave > /dev/null 2>&1
/bin/cp -f $installdir/mysql/my.cnf $installdir/mysql/my.cnf.rpmsave > /dev/null 2>&1
fi
#umount file systems
if [ $user = "root" ]; then
rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
else
sudo rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
fi
#tell user to run post configure script
echo " "
echo "Calpont uninstall completed"
exit 0

View File

@@ -86,7 +86,7 @@ send_user "\n"
# copy over custom OS files
#
send_user "Copy Custom OS files to Module"
send "scp /usr/local/Calpont/local/etc/$MODULE/* $USERNAME@$SERVER:/etc/.\n"
send "scp /usr/local/MariaDB/Columnstore/local/etc/$MODULE/* $USERNAME@$SERVER:/etc/.\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"

View File

@@ -0,0 +1,119 @@
#!/bin/bash
#
# $Id$
#
# generic InfiniDB Slave Replication script.
#
# Notes: This script gets run by ProcMon during installs and upgrades:
# check log for error
checkForError() {
grep ERROR /tmp/slave-rep-status.log > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "ERROR: check log file: /tmp/slave-rep-status.log"
rm -f /tmp/error.check
exit 1
fi
rm -f /tmp/error.check
}
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--masteripaddr='` -eq 15 ]; then
masteripaddr="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--masterlogfile='` -eq 16 ]; then
masterlogfile="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--masterlogpos='` -eq 15 ]; then
masterlogpos="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
port="`echo $arg | awk -F= '{print $2}'`"
fi
done
test -f $installdir/post/functions && . $installdir/post/functions
repUser="idbrep"
password="Calpont1"
>/tmp/slave-rep-status.log
#
# Run stop slave command
#
echo "Run stop slave command" >>/tmp/slave-rep-status.log
cat >/tmp/idb_slave-rep.sql <<EOD
stop slave;
EOD
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
#
# Run Change Master Command
#
echo "Run Change Master Command" >>/tmp/slave-rep-status.log
cat >/tmp/idb_slave-rep.sql <<EOD
CHANGE MASTER TO
MASTER_HOST='$masteripaddr',
MASTER_USER='$repUser',
MASTER_PASSWORD='$password',
MASTER_PORT=$port,
MASTER_LOG_FILE='$masterlogfile',
MASTER_LOG_POS=$masterlogpos;
MASTER_USE_GTID=$masterlogpos;
EOD
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
#
# Run start slave command
#
echo "Run start slave command" >>/tmp/slave-rep-status.log
cat >/tmp/idb_slave-rep.sql <<EOD
start slave;
EOD
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
#
# Run SHOW SLAVE STATUS
#
echo "Run SHOW SLAVE STATUS to node log" >>/tmp/slave-rep-status.log
cat >/tmp/idb_slave-rep.sql <<EOD
SHOW SLAVE STATUS\G
EOD
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
checkForError
#alls good, 'OK' for success
echo "OK"
exit 0

View File

@@ -18,12 +18,12 @@ checkForError() {
}
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"

View File

@@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then
fi
if [ -z "$INFINIDB_INSTALL_DIR" ]; then
INFINIDB_INSTALL_DIR=/usr/local/Calpont
INFINIDB_INSTALL_DIR=/usr/local/MariaDB/Columnstore
fi
export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR

View File

@@ -8,14 +8,14 @@
test $EUID -eq 0 || exit 0
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
syslog_conf=nofile
rsyslog7=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
@@ -30,13 +30,13 @@ for arg in "$@"; do
shift
done
if [ $installdir != "/usr/local/Calpont" ]; then
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib
fi
calpontSyslogFile=$installdir/bin/calpontSyslog
calpontSyslogFile7=$installdir/bin/calpontSyslog7
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog
columnstoreSyslogFile7=$installdir/bin/columnstoreSyslog7
checkSyslog() {
#check which syslog daemon is being used
@@ -84,7 +84,7 @@ fi
if [ "$daemon" = "syslog-ng" ]; then
if [ -f /etc/syslog-ng/syslog-ng.conf ]; then
syslog_conf=/etc/syslog-ng/syslog-ng.conf
calpontSyslogFile=$installdir/bin/calpontSyslog-ng
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog-ng
echo ""
echo "System logging being used: syslog-ng"
echo ""
@@ -128,7 +128,7 @@ elif [ "$daemon" = "syslog" ]; then
echo ""
elif [ -d /etc/syslog-ng/syslog-ng.conf ]; then
syslog_conf=/etc/syslog-ng/syslog-ng.conf
calpontSyslogFile=$installdir/bin/calpontSyslog-ng
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog-ng
echo ""
echo "System logging being used: syslog-ng"
echo ""
@@ -160,10 +160,10 @@ if [ ! -z "$syslog_conf" ] ; then
rm -rf /etc/rsyslog.d/calpont.conf
if [ $rsyslog7 == 1 ]; then
rm -f /etc/rsyslog.d/49-calpont.conf
cat ${calpontSyslogFile7} >> ${syslog_conf}
cat ${columnstoreSyslogFile7} >> ${syslog_conf}
chown syslog:adm /var/log/Calpont
else
cat ${calpontSyslogFile} >> ${syslog_conf}
cat ${columnstoreSyslogFile} >> ${syslog_conf}
fi
fi

View File

@@ -0,0 +1,262 @@
#!/bin/bash
#
# $Id: syslogSetup.sh 421 2007-04-05 15:46:55Z dhill $
#
# syslogSetup.sh - install / uninstall Calpont InfiniDB system logging configuration
# no point in going any further if not root... (only works in bash)
test $EUID -eq 0 || exit 0
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
syslog_conf=nofile
rsyslog7=0
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--..*'` -ge 3 ]; then
echo "ignoring unknown argument: $arg" 1>&2
elif [ `expr -- "$arg" : '--'` -eq 2 ]; then
shift
break
else
break
fi
shift
done
if [ $installdir != "/usr/local/MariaDB/Columnstore" ]; then
export INFINIDB_INSTALL_DIR=$installdir
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFINIDB_INSTALL_DIR/lib
fi
calpontSyslogFile=$installdir/bin/calpontSyslog
calpontSyslogFile7=$installdir/bin/calpontSyslog7
checkSyslog() {
#check which syslog daemon is being used
#first check which is running
daemon="nodaemon"
cnt=`ps -ef | grep -v grep | grep syslog-ng | wc -l`
if [ $cnt -gt 0 ]; then
daemon="syslog-ng"
else cnt=`ps -ef | grep -v grep | grep rsyslog | wc -l`
if [ $cnt -ge 1 ]; then
daemon="rsyslog"
else cnt=`ps -ef | grep -v grep | grep syslogd | wc -l`
if [ $cnt -ge 1 ]; then
if [ "$daemon" != "rsyslog" ]; then
daemon=syslog
fi
fi
fi
fi
#if none running, check installed
if [ "$daemon" = "nodaemon" ]; then
if [ -f /etc/init.d/syslog ]; then
daemon="syslog"
/etc/init.d/syslog start > /dev/null 2>&1
elif [ -f /etc/init.d/rsyslog ]; then
daemon="rsyslog"
/etc/init.d/rsyslog start > /dev/null 2>&1
elif [ -f /etc/init.d/syslog-ng ]; then
daemon="syslog-ng"
/etc/init.d/syslog-ng start > /dev/null 2>&1
fi
fi
#if none running or installed, exit
if [ "$daemon" = "nodaemon" ]; then
echo ""
echo "*** No System Logging Application found (syslog, rsyslog, or syslog-ng)"
echo "*** For InfiniDB System Logging functionality, install a System Logging package and reinstall InfiniDB"
echo ""
exit 1
fi
#check which syslog config file is installed
if [ "$daemon" = "syslog-ng" ]; then
if [ -f /etc/syslog-ng/syslog-ng.conf ]; then
syslog_conf=/etc/syslog-ng/syslog-ng.conf
calpontSyslogFile=$installdir/bin/calpontSyslog-ng
echo ""
echo "System logging being used: syslog-ng"
echo ""
fi
elif [ "$daemon" = "rsyslog" ]; then
#check if rsyslog version 7 or greater
rsyslogd -v > /tmp/rsyslog.ver
cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l`
if [ $cnt -gt 0 ]; then
rsyslog7=1
fi
cnt=`grep "rsyslogd 8" /tmp/rsyslog.ver | wc -l`
if [ $cnt -gt 0 ]; then
rsyslog7=1
fi
cnt=`grep "rsyslogd 9" /tmp/rsyslog.ver | wc -l`
if [ $cnt -gt 0 ]; then
rsyslog7=1
fi
if [ -f /etc/rsyslog.conf ]; then
cnt=`grep "/etc/rsyslog.d/" /etc/rsyslog.conf | wc -l`
if [ $cnt -gt 0 ]; then
if [ $rsyslog7 == 1 ]; then
syslog_conf=/etc/rsyslog.d/49-calpont.conf
else
syslog_conf=/etc/rsyslog.d/calpont.conf
fi
else
syslog_conf=/etc/rsyslog.conf
fi
echo ""
echo "System logging being used: rsyslog"
echo ""
fi
elif [ "$daemon" = "syslog" ]; then
if [ -f /etc/syslog.conf ]; then
syslog_conf=/etc/syslog.conf
echo ""
echo "System logging being used: syslog"
echo ""
elif [ -d /etc/syslog-ng/syslog-ng.conf ]; then
syslog_conf=/etc/syslog-ng/syslog-ng.conf
calpontSyslogFile=$installdir/bin/calpontSyslog-ng
echo ""
echo "System logging being used: syslog-ng"
echo ""
fi
else
echo ""
echo "*** No System Logging Application found (syslog, rsyslog, or syslog-ng)"
echo "*** For InfiniDB System Logging functionality, install a System Logging package and reinstall InfiniDB"
echo ""
exit 1
fi
}
install() {
checkSyslog
if [ ! -z "$syslog_conf" ] ; then
$installdir/bin/setConfig -d Installation SystemLogConfigFile ${syslog_conf} >/dev/null 2>&1
if [ "$syslog_conf" != /etc/rsyslog.d/calpont.conf ]; then
rm -f ${syslog_conf}.calpontSave
cp ${syslog_conf} ${syslog_conf}.calpontSave >/dev/null 2>&1
sed -i '/# Calpont/,$d' ${syslog_conf}.calpontSave > /dev/null 2>&1
fi
egrep -qs 'Calpont Database Platform Logging' ${syslog_conf}
if [ $? -ne 0 ]; then
#set the syslog for calpont logging
# remove older version incase it was installed by previous build
rm -rf /etc/rsyslog.d/calpont.conf
if [ $rsyslog7 == 1 ]; then
rm -f /etc/rsyslog.d/49-calpont.conf
cat ${calpontSyslogFile7} >> ${syslog_conf}
chown syslog:adm /var/log/Calpont
else
cat ${calpontSyslogFile} >> ${syslog_conf}
fi
fi
pkill -hup syslogd > /dev/null 2>&1
pkill -hup syslog-ng > /dev/null 2>&1
pkill -hup rsyslogd > /dev/null 2>&1
/etc/init.d/rsyslog restart > /dev/null 2>&1
systemctl restart rsyslog.service > /dev/null 2>&1
fi
}
uninstall() {
checkSyslog
if [ ! -z "$syslog_conf" ] ; then
if [ "$syslog_conf" != /etc/rsyslog.d/calpont.conf ]; then
if [ "$syslog_conf" != /etc/rsyslog.d/49-calpont.conf ]; then
egrep -qs 'Calpont Database Platform Logging' ${syslog_conf}
if [ $? -eq 0 ]; then
if [ -f ${syslog_conf}.calpontSave ] ; then
#uninstall the syslog for calpont logging
mv -f ${syslog_conf} ${syslog_conf}.calpontBackup
mv -f ${syslog_conf}.calpontSave ${syslog_conf} >/dev/null 2>&1
if [ ! -f ${syslog_conf} ] ; then
cp ${syslog_conf}.calpontBackup ${syslog_conf}
fi
fi
fi
sed -i '/# Calpont/,$d' ${syslog_conf} > /dev/null 2>&1
else
rm -f "$syslog_conf"
fi
else
rm -f "$syslog_conf"
fi
pkill -hup syslogd > /dev/null 2>&1
pkill -hup syslog-ng > /dev/null 2>&1
/etc/init.d/rsyslog restart > /dev/null 2>&1
systemctl restart rsyslog.service > /dev/null 2>&1
$installdir/bin/setConfig -d Installation SystemLogConfigFile "unassigned"
fi
}
status() {
checkSyslog
if [ ! -z "$syslog_conf" ] ; then
egrep -qs 'Calpont Database Platform Logging' ${syslog_conf}
if [ $? -eq 0 ]; then
echo $syslog_conf
else
echo "No System Log Config File configured for InfiniDB System Logging"
fi
fi
}
check() {
test -f $installdir/post/functions && . $installdir/post/functions
number=$RANDOM
cplogger -i 100 "InfiniDB Log Test: $number"
sleep 3
egrep -qs "InfiniDB Log Test: $number" /var/log/Calpont/info.log
if [ $? -eq 0 ]; then
echo "InfiniDB System Logging working"
exit 0
else
echo "InfiniDB System Logging not working"
exit 1
fi
}
case "$1" in
install)
install
;;
uninstall)
uninstall
;;
status)
status
;;
check)
check
;;
*)
echo $"Usage: $0 {install|uninstall|status|check)"
exit 1
esac
exit 0
/

View File

@@ -129,7 +129,7 @@ if { $INSTALLTYPE == "initial"} {
# copy over InfiniDB OS files
#
send_user "Copy InfiniDB OS files to Module "
send "scp /usr/local/Calpont/local/etc/$MODULE/* $USERNAME@$SERVER:/usr/local/Calpont/local/.\n"
send "scp /usr/local/MariaDB/Columnstore/local/etc/$MODULE/* $USERNAME@$SERVER:/usr/local/MariaDB/Columnstore/local/.\n"
expect "word: "
# send the password
send "$PASSWORD\n"
@@ -144,7 +144,7 @@ if { $INSTALLTYPE == "initial"} {
# Start module installer to setup Customer OS files
#
send_user "Run Module Installer "
send "ssh $USERNAME@$SERVER '/usr/local/Calpont/bin/module_installer.sh'\n"
send "ssh $USERNAME@$SERVER '/usr/local/MariaDB/Columnstore/bin/module_installer.sh'\n"
expect "word: "
# send the password
send "$PASSWORD\n"

View File

@@ -0,0 +1,444 @@
#!/bin/bash
#
# $Id$
#
# generic InfiniDB upgrade script.
#
# Notes: This script gets run every time InfiniDB starts up so it needs to be:
# 1) able to only do stuff once if needed and nothing if not needed
# 2) reasonably fast when there's nothing to do
# check log for error
checkForError() {
grep ERROR /tmp/upgrade-status.log.$$ > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "ERROR: check log file: /tmp/upgrade-status.log.$$"
rm -f /tmp/error.check
exit 1;
fi
rm -f /tmp/error.check
}
if [ "x$1" != xdoupgrade ]; then
echo "Don't run this script by hand! You probably want to use install-infinidb.sh." 1>&2
exit 1
fi
prefix=/usr/local
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
fi
done
test -f $installdir/post/functions && . $installdir/post/functions
mt=`module_type`
mid=`module_id`
# for CE version
if [ -z "$mt" ]; then
mt=pm
fi
if [ -z "$mid" ]; then
mid=1
fi
has_um=`$installdir/bin/getConfig SystemModuleConfig ModuleCount2`
if [ -z "$has_um" ]; then
has_um=0
fi
>/tmp/upgrade-status.log.$$
echo "mt = $mt" >>/tmp/upgrade-status.log.$$
echo "mid = $mid" >>/tmp/upgrade-status.log.$$
echo "has_um = $has_um" >>/tmp/upgrade-status.log.$$
#This upgrade only for UM or PM with no UM
if [ $has_um -eq 0 -o "x$mt" = xum ]; then
#---------------------------------------------------------------------------
# See if compressiontype column is in SYSCOLUMN
#---------------------------------------------------------------------------
echo "checking calpontsys for compressiontype..." >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep compressiontype >>/tmp/upgrade-status.log.$$ 2>&1
#
# Add compressiontype column to SYSCOLUMN if applicable
#
if [ $? -ne 0 ]; then
echo "calpontsys needs upgrade for compressiontype" >>/tmp/upgrade-status.log.$$
echo "added compressiontype column" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
alter table syscolumn add compressiontype int comment 'schema sync only';
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
if [ $mid -eq 1 ]; then
echo "update compressiontype to backend" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
select calonlinealter('alter table syscolumn add (compressiontype int)') as xxx;
update syscolumn set compressiontype=0 where compressiontype is null;
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
fi
#
# Verify that compressiontype was successfully added to SYSCOLUMN
#
rm -f /tmp/idb_upgrade.sql
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep compressiontype >/tmp/upgrade-status-1.log 2>&1
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding compressiontype to SYSCOLUMN!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ -z "$cnt" ]; then
cnt=0
fi
if [ $cnt -ne 1 ]; then
echo "FAILED adding compressiontype to SYSCOLUMN!"
exit 1
fi
#
# Verify that compressiontype (OID 1041) was successfully added to BRM
#
if [ $has_um -eq 0 ]; then
$installdir/bin/editem -o1041 1>/tmp/upgrade-status-1.log 2>/dev/null
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding compressiontype to BRM!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ -z "$cnt" ]; then
cnt=0
fi
if [ $cnt -lt 2 ]; then
echo "FAILED adding compressiontype to BRM!"
exit 1
fi
fi
fi
#---------------------------------------------------------------------------
# See if autoincrement column is in SYSTABLE
#---------------------------------------------------------------------------
echo "checking calpontsys for autoincrement..." >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe systable;' \
calpontsys | grep autoincrement >>/tmp/upgrade-status.log.$$ 2>&1
#
# Add autoincrement column to SYSTABLE if applicable
#
if [ $? -ne 0 ]; then
echo "calpontsys needs upgrade for autoincrement" >>/tmp/upgrade-status.log.$$
echo "add autoincrement columns" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
alter table systable add autoincrement int comment 'schema sync only';
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
if [ $mid -eq 1 ]; then
echo "update autoincrement to backend" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
select calonlinealter('alter table systable add (autoincrement int)') as xxx;
update systable set autoincrement=0 where autoincrement is null;
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
fi
#
#Verify that autoincrement was successfully added to SYSTABLE
#
rm -f /tmp/idb_upgrade.sql
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe systable;' \
calpontsys | grep autoincrement >/tmp/upgrade-status-1.log 2>&1
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding autoincrement to SYSTABLE!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ -z "$cnt" ]; then
cnt=0
fi
if [ $cnt -ne 1 ]; then
echo "FAILED adding autoincrement to SYSTABLE!"
exit 1
fi
#
# Verify that autoincrement (OID 1011) was successfully added to BRM
#
if [ $has_um -eq 0 ]; then
$installdir/bin/editem -o1011 1>/tmp/upgrade-status-1.log 2>/dev/null
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding autoincrement to BRM!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ "x$cnt" = x ]; then
cnt=0
fi
if [ $cnt -lt 2 ]; then
echo "FAILED adding autoincrement to BRM!"
exit 1
fi
fi
fi
#---------------------------------------------------------------------------
# See if nextvalue column is in SYSCOLUMN
#---------------------------------------------------------------------------
echo "checking calpontsys for nextvalue..." >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep nextvalue >>/tmp/upgrade-status.log.$$ 2>&1
#
# Add nextvalue column to SYSCOLUMN if applicable.
# Also set old autoincrement column in SYSCOLUMN to 'n'.
#
if [ $? -ne 0 ]; then
echo "calpontsys needs upgrade for nextvalue" >>/tmp/upgrade-status.log.$$
echo "add nextvalue columns" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
alter table syscolumn add nextvalue bigint comment 'schema sync only';
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
if [ $mid -eq 1 ]; then
echo "update nextvalue to backend" >>/tmp/upgrade-status.log.$$
cat >/tmp/idb_upgrade.sql <<EOD
select calonlinealter('alter table syscolumn add (nextvalue bigint)') as xxx;
update syscolumn set nextvalue=1 where nextvalue is null;
update syscolumn set autoincrement='n' where autoincrement is null;
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
fi
#
# Verify that nextvalue was successfully added to SYSCOLUMN
#
rm -f /tmp/idb_upgrade.sql
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep nextvalue >/tmp/upgrade-status-1.log 2>&1
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding nextvalue to SYSCOLUMN!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ -z "$cnt" ]; then
cnt=0
fi
if [ $cnt -ne 1 ]; then
echo "FAILED adding nextvalue to SYSCOLUMN!"
exit 1
fi
#
# Verify that nextvalue (OID 1042) was successfully added to BRM
#
if [ $has_um -eq 0 ]; then
$installdir/bin/editem -o1042 1>/tmp/upgrade-status-1.log 2>/dev/null
rc=$?
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
if [ $rc -ne 0 ]; then
echo "FAILED adding nextvalue to BRM!"
exit 1
fi
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ "x$cnt" = x ]; then
cnt=0
fi
if [ $cnt -lt 2 ]; then
echo "FAILED adding nextvalue to BRM!"
exit 1
fi
fi
fi
#---------------------------------------------------------------------------
# See if systable schema and tablename columns are varchar(128).
#---------------------------------------------------------------------------
recreate=0
echo "checking calpontsys.systable schema and tablename for varchar(128)..." >>/tmp/upgrade-status.log.$$
colCount=` \
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe systable;' \
calpontsys | egrep "schema|tablename" | grep "varchar(128)" | wc -l`
if [ $colCount -ne 2 ]; then
recreate=1
echo "calpontsys needs upgrade to expand systable schema and tablename" >>/tmp/upgrade-status.log.$$
fi
#---------------------------------------------------------------------------
# See if syscolumn schema, tablename, and columname columns are varchar(128).
#---------------------------------------------------------------------------
if [ $recreate -eq 0 ]; then
echo "checking calpontsys.syscolumn schema, tablename, columnname for varchar(128)..." >>/tmp/upgrade-status.log.$$
colCount=` \
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | egrep "schema|tablename|columnname" | grep "varchar(128)" | wc -l`
if [ $colCount -ne 3 ]; then
recreate=1
echo "calpontsys needs upgrade to expand syscolumn schema, tablename, and columnname" >>/tmp/upgrade-status.log.$$
fi
fi
#---------------------------------------------------------------------------
# See if defaultvalue column in SYSCOLUMN is varchar(64)
#---------------------------------------------------------------------------
if [ $recreate -eq 0 ]; then
echo "checking calpontsys for defaultvalue varchar(64)..." >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep defaultvalue | grep 'varchar(64)' >>/tmp/upgrade-status.log.$$ 2>&1
if [ $? -ne 0 ]; then
recreate=1
echo "calpontsys needs upgrade to change defaultvalue" >>/tmp/upgrade-status.log.$$
fi
fi
#
# Change defaultvalue column to varchar(64) if applicable
#
if [ $recreate -ne 0 ]; then
cat >/tmp/idb_upgrade.sql <<EOD
drop table if exists systable restrict;
drop table if exists syscolumn restrict;
EOD
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
echo "create systable and syscolumn with schema sync only" >>/tmp/upgrade-status.log.$$
cat $installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
calpontsys <$installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$ 2>&1
checkForError
#
# Verify column widths:
# varchar(64) for syscolumn.defaultvalue
# varchar(128) for systable (schema, tablename) and syscolumn (schema, tablename, and columnname).
#
rm -f /tmp/idb_upgrade.sql
echo "verify column widths" >>/tmp/upgrade-status.log.$$
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe syscolumn;' \
calpontsys | grep defaultvalue | grep 'varchar(64)' >/tmp/upgrade-status-1.log 2>&1
$installdir/mysql/bin/mysql \
--defaults-file=$installdir/mysql/my.cnf \
--user=root $pwprompt \
--execute='describe systable; describe syscolumn;' \
calpontsys | egrep "schema|tablename|columnname" | grep 'varchar(128)' >>/tmp/upgrade-status-1.log 2>&1
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
rm -f /tmp/upgrade-status-1.log
if [ -z "$cnt" ]; then
cnt=0
fi
if [ $cnt -ne 6 ]; then
echo "FAILED width of schema, tablename, columnname, defaultvalue verification!"
exit 1
fi
fi
fi
echo "OK"

View File

@@ -25,12 +25,12 @@ if [ "x$1" != xdoupgrade ]; then
fi
prefix=/usr/local
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
prefix="`echo $arg | awk -F= '{print $2}'`"
installdir=$prefix/Calpont
installdir=$prefix/MariaDB/Columnstore
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
password="`echo $arg | awk -F= '{print $2}'`"
pwprompt="--password=$password"

View File

@@ -21,7 +21,7 @@ set NODEPS [lindex $argv 6]
set MYSQLPW [lindex $argv 7]
set MYSQLPORT [lindex $argv 8]
set DEBUG [lindex $argv 9]
set INSTALLDIR "/usr/local/Calpont"
set INSTALLDIR "/usr/local/MariaDB/Columnstore"
set IDIR [lindex $argv 10]
if { $IDIR != "" } {
set INSTALLDIR $IDIR