You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-3551 Use generic MariaDB Server paths
This branch enforces the use of generic MariaDB server paths for their binaries and data rather than custom paths. /usr/local/mariadb/columnstore is now only for columnstore with this patch. It should be noted that this removes the auto-mounting of external MariaDB UM data storage for AWS. This is also a fix for MCOL-3510 after buildbot changes are made. Also... MCOL-3552 Use columnstore.cnf to load plugins The ColumnStore plugins now load using a columnstore.cnf instead of a SQL sequence to be more in-line with MariaDB's methods.
This commit is contained in:
@ -74,6 +74,14 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/obj)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
|
||||
IF (RPM)
|
||||
SET(MARIADB_PLUGINDIR "/usr/lib64/mysql/plugin")
|
||||
ELSEIF (DEB)
|
||||
SET(MARIADB_PLUGINDIR "/usr/lib/mysql/plugin")
|
||||
ELSE()
|
||||
SET(MARIADB_PLUGINDIR "/usr/local/lib/mysql/plugin")
|
||||
ENDIF()
|
||||
|
||||
SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${CMAKE_CURRENT_BINARY_DIR}/external)
|
||||
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
|
||||
|
||||
@ -104,7 +112,7 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
# (but later on when installing)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "${INSTALL_ENGINE}/lib;${INSTALL_ENGINE}/mysql/lib")
|
||||
SET(CMAKE_INSTALL_RPATH "${INSTALL_ENGINE}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
@ -116,11 +124,6 @@ IF("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${INSTALL_ENGINE}/lib")
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${SERVER_SOURCE_ROOT_DIR}/libmysql/" isSystemDir)
|
||||
IF("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${INSTALL_ENGINE}/mysql/lib")
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
INCLUDE (configureEngine)
|
||||
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
#!/usr/bin/expect -f
|
||||
#@echo off
|
||||
spawn scp /InfiniDB/genii/mysql/queries/nightly/srvswdev11/go.log root@srvnightly:/tmp/srvbldwin1-genii-queryTester.log
|
||||
|
||||
expect {
|
||||
-re "authenticity" { send "yes\r"
|
||||
expect {
|
||||
-re "word: " { send "$PASSWORD\r" } abort
|
||||
-re "passphrase" { send "$PASSWORD\r" } abort
|
||||
}
|
||||
}
|
||||
-re "word: " { send "Calpont1\r" } abort
|
||||
}
|
||||
expect "*\r"
|
||||
expect "\r"
|
@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
prefix="$1"
|
||||
|
||||
if [ -z "$prefix" ]; then
|
||||
echo "usage: $0 destdir" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf infinidb mysql infinidb-ent
|
||||
|
||||
git clone http://srvgip1.calpont.com/repos/infinidb.git
|
||||
cd infinidb
|
||||
git checkout develop
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/infinidb/mysql.git
|
||||
cd mysql
|
||||
git checkout develop
|
||||
cd ..
|
||||
|
||||
git clone http://srvgip1.calpont.com/repos/infinidb-ent.git
|
||||
cd infinidb-ent
|
||||
git checkout develop
|
||||
cd ..
|
||||
|
||||
cd infinidb
|
||||
|
||||
mkdir -p export/{include,lib,etc,share,bin,sbin,post}
|
||||
|
||||
cp -r utils/autoconf/* .
|
||||
autoreconf
|
||||
libtoolize --force --install
|
||||
|
||||
./configure --prefix=$prefix
|
||||
|
@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is for adding an include statement to Makefiles in order
|
||||
# to point them at the toplevel rules.mak. It was used to add these
|
||||
# lines when rules.mak was introduced.
|
||||
|
||||
root=${root:-.}
|
||||
|
||||
files=$(find $root -name '[mM]akefile' | grep -v ./mysql)
|
||||
|
||||
for x in $files; do
|
||||
|
||||
istmt=$(dirname $(echo $x | sed -r -e 's,\./,,' -e 's,[^/]+/,\.\./,g'))/rules.mak
|
||||
tmpfile=/tmp/setmktop.$UID
|
||||
# put new include stmt
|
||||
echo "include $istmt" > $tmpfile
|
||||
# append the old file less any include rules.mak lines
|
||||
grep -v '^include .*rules.mak' $x >> $tmpfile
|
||||
# copy over old
|
||||
mv $tmpfile $x
|
||||
printf "%s %s\n" "$x :" $istmt
|
||||
done
|
@ -81,7 +81,7 @@ set_target_properties(is_columnstore_files PROPERTIES PREFIX "")
|
||||
set_target_properties(is_columnstore_files PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
|
||||
install(TARGETS calmysql is_columnstore_tables is_columnstore_columns is_columnstore_extents is_columnstore_files DESTINATION ${ENGINE_LIBDIR} COMPONENT storage-engine)
|
||||
install(TARGETS calmysql is_columnstore_tables is_columnstore_columns is_columnstore_extents is_columnstore_files DESTINATION ${MARIADB_PLUGINDIR} COMPONENT storage-engine)
|
||||
install(FILES syscatalog_mysql.sql
|
||||
dumpcat_mysql.sql
|
||||
calsetuserpriority.sql
|
||||
|
@ -1,14 +1,11 @@
|
||||
# The following options will be passed to all MySQL clients
|
||||
[client]
|
||||
#password = your_password
|
||||
socket = /usr/local/mariadb/columnstore/mysql/lib/mysql/mysql.sock
|
||||
|
||||
# Here follows entries for some specific programs
|
||||
|
||||
# The MySQL server
|
||||
[mysqld]
|
||||
socket = /usr/local/mariadb/columnstore/mysql/lib/mysql/mysql.sock
|
||||
datadir = /usr/local/mariadb/columnstore/mysql/db
|
||||
sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
|
||||
#columnstore_processing_handlers_fallback = OFF;
|
||||
|
||||
@ -29,15 +26,9 @@ sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
|
||||
#columnstore_use_import_for_batchinsert=1
|
||||
#columnstore_import_for_batchinsert_delimiter=7
|
||||
|
||||
basedir = /usr/local/mariadb/columnstore/mysql/
|
||||
character-sets-dir = /usr/local/mariadb/columnstore/mysql/share/charsets/
|
||||
lc-messages-dir = /usr/local/mariadb/columnstore/mysql/share/
|
||||
plugin_dir = /usr/local/mariadb/columnstore/mysql/lib/plugin
|
||||
|
||||
# Replication Master Server (default)
|
||||
# binary logging is required for replication
|
||||
# log-bin=mysql-bin
|
||||
binlog_format=ROW
|
||||
|
||||
# required unique id between 1 and 2^32 - 1
|
||||
# defaults to 1 if master-host
|
||||
@ -45,9 +36,11 @@ binlog_format=ROW
|
||||
server-id = 1
|
||||
|
||||
# binary logging - not required for slaves, but recommended
|
||||
log-bin=/usr/local/mariadb/columnstore/mysql/db/mysql-bin
|
||||
relay-log=/usr/local/mariadb/columnstore/mysql/db/relay-bin
|
||||
relay-log-index = /usr/local/mariadb/columnstore/mysql/db/relay-bin.index
|
||||
relay-log-info-file = /usr/local/mariadb/columnstore/mysql/db/relay-bin.info
|
||||
|
||||
lower_case_table_names=1
|
||||
|
||||
plugin-load-add=libcalmysql.so
|
||||
plugin-load-add=is_columnstore_tables.so
|
||||
plugin-load-add=is_columnstore_columns.so
|
||||
plugin-load-add=is_columnstore_extents.so
|
||||
plugin-load-add=is_columnstore_files.so
|
||||
|
@ -24,15 +24,55 @@ for arg in "$@"; do
|
||||
fi
|
||||
done
|
||||
|
||||
$installdir/mysql/bin/mysql --force --user=root mysql 2> ${tmpdir}/mysql_install.log <<EOD
|
||||
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
|
||||
INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so';
|
||||
INSTALL PLUGIN columnstore_columns SONAME 'is_columnstore_columns.so';
|
||||
INSTALL PLUGIN columnstore_extents SONAME 'is_columnstore_extents.so';
|
||||
INSTALL PLUGIN columnstore_files SONAME 'is_columnstore_files.so';
|
||||
INSERT INTO mysql.func VALUES ('calgetstats',0,'libcalmysql.so','function'),('calsettrace',2,'libcalmysql.so','function'),('calsetparms',0,'libcalmysql.so','function'),('calflushcache',2,'libcalmysql.so','function'),('calgettrace',0,'libcalmysql.so','function'),('calgetversion',0,'libcalmysql.so','function'),('calonlinealter',2,'libcalmysql.so','function'),('calviewtablelock',0,'libcalmysql.so','function'),('calcleartablelock',0,'libcalmysql.so','function'),('callastinsertid',2,'libcalmysql.so','function'),('calgetsqlcount',0,'libcalmysql.so','function'),('idbpm',2,'libcalmysql.so','function'),('idbdbroot',2,'libcalmysql.so','function'),('idbsegment',2,'libcalmysql.so','function'),('idbsegmentdir',2,'libcalmysql.so','function'),('idbextentrelativerid',2,'libcalmysql.so','function'),('idbblockid',2,'libcalmysql.so','function'),('idbextentid',2,'libcalmysql.so','function'),('idbextentmin',0,'libcalmysql.so','function'),('idbextentmax',0,'libcalmysql.so','function'),('idbpartition',0,'libcalmysql.so','function'),('idblocalpm',2,'libcalmysql.so','function'),('mcssystemready',2,'libcalmysql.so','function'),('mcssystemreadonly',2,'libcalmysql.so','function'),('mcssystemprimary',2,'libcalmysql.so','function'),('regr_avgx',1,'libregr_mysql.so','aggregate'),('regr_avgy',1,'libregr_mysql.so','aggregate'),('regr_count',2,'libregr_mysql.so','aggregate'),('regr_slope',1,'libregr_mysql.so','aggregate'),('regr_intercept',1,'libregr_mysql.so','aggregate'),('regr_r2',1,'libregr_mysql.so','aggregate'),('corr',1,'libregr_mysql.so','aggregate'),('regr_sxx',1,'libregr_mysql.so','aggregate'),('regr_syy',1,'libregr_mysql.so','aggregate'),('regr_sxy',1,'libregr_mysql.so','aggregate'),('covar_pop',1,'libregr_mysql.so','aggregate'),('covar_samp',1,'libregr_mysql.so','aggregate'),('moda',4,'libregr_mysql.so','aggregate'),('distinct_count',2,'libudf_mysql.so','aggregate'),('caldisablepartitions',0,'libcalmysql.so','function'),('calenablepartitions',0,'libcalmysql.so','function'),('caldroppartitions',0,'libcalmysql.so','function'),('calshowpartitions',0,'libcalmysql.so','function'),('caldroppartitionsbyvalue',0,'libcalmysql.so','function'),('caldisablepartitionsbyvalue',0,'libcalmysql.so','function'),('calenablepartitionsbyvalue',0,'libcalmysql.so','function'),('calshowpartitionsbyvalue',0,'libcalmysql.so','function');
|
||||
mysql --force --user=root mysql 2> ${tmpdir}/mysql_install.log <<EOD
|
||||
INSERT INTO mysql.func VALUES ('calgetstats',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calsettrace',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calsetparms',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calflushcache',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calgettrace',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calgetversion',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calonlinealter',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calviewtablelock',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calcleartablelock',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('callastinsertid',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calgetsqlcount',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbpm',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbdbroot',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbsegment',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbsegmentdir',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbextentrelativerid',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbblockid',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbextentid',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbextentmin',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbextentmax',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idbpartition',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('idblocalpm',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('mcssystemready',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('mcssystemreadonly',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('mcssystemprimary',2,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('regr_avgx',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_avgy',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_count',2,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_slope',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_intercept',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_r2',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('corr',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_sxx',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_syy',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('regr_sxy',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('covar_pop',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('covar_samp',1,'libregr_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('distinct_count',2,'libudf_mysql.so','aggregate');
|
||||
INSERT INTO mysql.func VALUES ('caldisablepartitions',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calenablepartitions',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('caldroppartitions',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calshowpartitions',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('caldroppartitionsbyvalue',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('caldisablepartitionsbyvalue',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calenablepartitionsbyvalue',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('calshowpartitionsbyvalue',0,'libcalmysql.so','function');
|
||||
INSERT INTO mysql.func VALUES ('moda',4,'libregr_mysql.so','aggregate');
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS infinidb_vtable;
|
||||
CREATE DATABASE IF NOT EXISTS infinidb_querystats;
|
||||
CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats
|
||||
(
|
||||
@ -76,9 +116,9 @@ CREATE TABLE IF NOT EXISTS infinidb_querystats.priority
|
||||
insert ignore into infinidb_querystats.priority values ('High', 100),('Medium', 66), ('Low', 33);
|
||||
EOD
|
||||
|
||||
$installdir/mysql/bin/mysql --user=root mysql 2>/dev/null <$installdir/mysql/syscatalog_mysql.sql
|
||||
$installdir/mysql/bin/mysql --user=root mysql 2>/dev/null <$installdir/mysql/calsetuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --user=root mysql 2>/dev/null <$installdir/mysql/calremoveuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --user=root mysql 2>/dev/null <$installdir/mysql/calshowprocesslist.sql
|
||||
$installdir/mysql/bin/mysql --user=root mysql 2>/dev/null <$installdir/mysql/columnstore_info.sql
|
||||
mysql --user=root mysql 2>/dev/null <$installdir/mysql/syscatalog_mysql.sql
|
||||
mysql --user=root mysql 2>/dev/null <$installdir/mysql/calsetuserpriority.sql
|
||||
mysql --user=root mysql 2>/dev/null <$installdir/mysql/calremoveuserpriority.sql
|
||||
mysql --user=root mysql 2>/dev/null <$installdir/mysql/calshowprocesslist.sql
|
||||
mysql --user=root mysql 2>/dev/null <$installdir/mysql/columnstore_info.sql
|
||||
|
||||
|
@ -43,40 +43,12 @@
|
||||
# If you change base dir, you must also change datadir. These may get
|
||||
# overwritten by settings in the MySQL configuration files.
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
USER=`whoami 2>/dev/null`
|
||||
|
||||
if [ $USER != "root" ]; then
|
||||
prefix=$HOME
|
||||
fi
|
||||
|
||||
if [ $USER != "root" ]; then
|
||||
if [ -f $prefix/.bash_profile ]; then
|
||||
profileFile=$prefix/.bash_profile
|
||||
elif [ -f $prefix/.profile ]; then
|
||||
profileFile=$prefix/.profile
|
||||
else
|
||||
profileFile=$prefix/.bashrc
|
||||
fi
|
||||
|
||||
. $profileFile
|
||||
fi
|
||||
|
||||
# Source function library.
|
||||
if [ -f /etc/init.d/functions ]; then
|
||||
. /etc/init.d/functions
|
||||
fi
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
|
||||
fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
basedir=$COLUMNSTORE_INSTALL_DIR/mysql
|
||||
datadir=$basedir/db
|
||||
|
||||
# Default value, in seconds, afterwhich the script should timeout waiting
|
||||
# for server start.
|
||||
# Value here is overriden by value in my.cnf.
|
||||
@ -86,7 +58,7 @@ service_startup_timeout=90
|
||||
user=`whoami 2>/dev/null`
|
||||
|
||||
# Lock directory
|
||||
lockdir=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation LockFileDirectory`
|
||||
lockdir=/var/lock/subsys
|
||||
|
||||
lock_file_path="$lockdir/mysql-Columnstore"
|
||||
|
||||
@ -96,14 +68,14 @@ lock_file_path="$lockdir/mysql-Columnstore"
|
||||
mysqld_pid_file_path=
|
||||
if test -z "$basedir"
|
||||
then
|
||||
basedir=/usr/local/mariadb/columnstore/mysql
|
||||
bindir=/usr/local/bin
|
||||
basedir=/usr
|
||||
bindir=/usr/bin
|
||||
if test -z "$datadir"
|
||||
then
|
||||
datadir=/var/lib/mysql
|
||||
fi
|
||||
sbindir=/usr/local/sbin
|
||||
bindir=/usr/local/bin
|
||||
sbindir=/usr/bin
|
||||
bindir=/usr/bin
|
||||
else
|
||||
bindir="$basedir/bin"
|
||||
if test -z "$datadir"
|
||||
@ -295,7 +267,7 @@ wait_for_ready () {
|
||||
i=0
|
||||
while test $i -ne $service_startup_timeout ; do
|
||||
|
||||
if $bindir/mysqladmin ping --socket=$basedir/lib/mysql/mysql.sock >/dev/null 2>&1; then
|
||||
if $bindir/mysqladmin ping >/dev/null 2>&1; then
|
||||
log_success_msg
|
||||
return 0
|
||||
elif kill -0 $! 2>/dev/null ; then
|
||||
@ -335,7 +307,7 @@ fi
|
||||
kill_by_pid() {
|
||||
# let's see if we can kill the 2 mysql procs by hand
|
||||
# get the our mysql from ps
|
||||
eval $(ps -ef | grep "$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysqld" | grep -v grep | head -1 | awk '{printf "pid=%d\n", $2}')
|
||||
eval $(ps -ef | grep "bin/mysqld" | grep -v grep | head -1 | awk '{printf "pid=%d\n", $2}')
|
||||
|
||||
if [ -n "$pid" ]; then
|
||||
ppid=$(ps -o ppid= -p $pid)
|
||||
@ -361,7 +333,7 @@ case "$mode" in
|
||||
then
|
||||
# Give extra arguments to mysqld with the my.cnf file. This script
|
||||
# may be overwritten at next upgrade.
|
||||
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "--ledir=$bindir" "$@" >/dev/null 2>&1 &
|
||||
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" >/dev/null 2>&1 &
|
||||
wait_for_ready; return_value=$?
|
||||
|
||||
# Make lock for RedHat / SuSE
|
||||
|
60
genii.vpw
60
genii.vpw
@ -1,60 +0,0 @@
|
||||
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">
|
||||
<Workspace Version="10.0" VendorName="SlickEdit">
|
||||
<Projects>
|
||||
<Project File="tools/configMgt/autoConfigure.vpj"/>
|
||||
<Project File="utils/batchloader/batchloader.vpj"/>
|
||||
<Project File="primitives/blockcache/blockcache.vpj"/>
|
||||
<Project File="versioning/BRM/brm.vpj"/>
|
||||
<Project File="writeengine/bulk/bulk.vpj"/>
|
||||
<Project File="utils/cacheutils/cacheutils.vpj"/>
|
||||
<Project File="tools/dbloadxml/colxml.vpj"/>
|
||||
<Project File="utils/common/common.vpj"/>
|
||||
<Project File="utils/compress/compress.vpj"/>
|
||||
<Project File="utils/configcpp/configcpp.vpj"/>
|
||||
<Project File="utils/dataconvert/dataconvert.vpj"/>
|
||||
<Project File="utils/ddlcleanup/ddlcleanup.vpj"/>
|
||||
<Project File="dbcon/ddlpackage/ddlpackage.vpj"/>
|
||||
<Project File="dbcon/ddlpackageproc/ddlpackageproc.vpj"/>
|
||||
<Project File="ddlproc/ddlproc.vpj"/>
|
||||
<Project File="writeengine/dictionary/dictionary.vpj"/>
|
||||
<Project File="dbcon/dmlpackage/dmlpackage.vpj"/>
|
||||
<Project File="dbcon/dmlpackageproc/dmlpackageproc.vpj"/>
|
||||
<Project File="dmlproc/dmlproc.vpj"/>
|
||||
<Project File="tools/editem/editem.vpj"/>
|
||||
<Project File="dbcon/execplan/execplan.vpj"/>
|
||||
<Project File="exemgr/exemgr.vpj"/>
|
||||
<Project File="utils/funcexp/funcexp.vpj"/>
|
||||
<Project File="oamapps/hardwareMonitor/HardwareMonitor.vpj"/>
|
||||
<Project File="tools/hdfsCheck/hdfsCheck.vpj"/>
|
||||
<Project File="utils/idbdatafile/idbdatafile.vpj"/>
|
||||
<Project File="utils/idbhdfs/idbhdfs.vpj"/>
|
||||
<Project File="dbcon/ingres/ingres.vpj"/>
|
||||
<Project File="dbcon/joblist/joblist.vpj"/>
|
||||
<Project File="utils/joiner/joiner.vpj"/>
|
||||
<Project File="primitives/linux-port/linux-port.vpj"/>
|
||||
<Project File="utils/loggingcpp/loggingcpp.vpj"/>
|
||||
<Project File="utils/messageqcpp/messageqcpp.vpj"/>
|
||||
<Project File="utils/multicast/multicast.vpj"/>
|
||||
<Project File="dbcon/mysql/mysql.vpj"/>
|
||||
<Project File="oam/oamcpp/oamcpp.vpj"/>
|
||||
<Project File="oamapps/postConfigure/postConfigure.vpj"/>
|
||||
<Project File="primitives/primproc/primproc.vpj"/>
|
||||
<Project File="procmgr/procmgr.vpj"/>
|
||||
<Project File="procmon/procmon.vpj"/>
|
||||
<Project File="utils/regr/regr.vpj"/>
|
||||
<Project File="oamapps/replayTransactionLog/ReplayTransactionLog.vpj"/>
|
||||
<Project File="oamapps/resourceMonitor/resourceMonitor.vpj"/>
|
||||
<Project File="utils/rowgroup/rowgroup.vpj"/>
|
||||
<Project File="utils/rwlock/rwlock.vpj"/>
|
||||
<Project File="oamapps/serverMonitor/ServerMonitor.vpj"/>
|
||||
<Project File="writeengine/splitter/splitter.vpj"/>
|
||||
<Project File="utils/startup/startup.vpj"/>
|
||||
<Project File="utils/dataconvert/tdriver.vpj"/>
|
||||
<Project File="utils/threadpool/threadpool.vpj"/>
|
||||
<Project File="utils/udfsdk/udfsdk.vpj"/>
|
||||
<Project File="utils/utils.vpj"/>
|
||||
<Project File="writeengine/wrapper/wrapper.vpj"/>
|
||||
<Project File="writeengine/client/writeengineclient.vpj"/>
|
||||
<Project File="writeengine/server/WriteEngineServer.vpj"/>
|
||||
</Projects>
|
||||
</Workspace>
|
@ -132,7 +132,7 @@
|
||||
<PROCESSCONFIG12>
|
||||
<ProcessName>mysqld</ProcessName>
|
||||
<ModuleType>um</ModuleType>
|
||||
<ProcessLocation>$INSTALLDIR/mysql/libexec/mysqld</ProcessLocation>
|
||||
<ProcessLocation>/usr/bin/mysqld</ProcessLocation>
|
||||
<BootLaunch>0</BootLaunch>
|
||||
<LaunchID>100</LaunchID>
|
||||
<DepProcessName/>
|
||||
|
@ -121,7 +121,7 @@
|
||||
<PROCESSCONFIG12>
|
||||
<ProcessName>mysqld</ProcessName>
|
||||
<ModuleType>pm</ModuleType>
|
||||
<ProcessLocation>/usr/local/mariadb/columnstore/mysql/libexe/mysqld</ProcessLocation>
|
||||
<ProcessLocation>/usr/bin/mysqld</ProcessLocation>
|
||||
<BootLaunch>0</BootLaunch>
|
||||
<LaunchID>100</LaunchID>
|
||||
<DepProcessName/>
|
||||
|
@ -27,7 +27,6 @@ install(PROGRAMS post-install
|
||||
columnstoreSyslog-ng
|
||||
syslogSetup.sh
|
||||
remote_scp_put.sh
|
||||
columnstore.def
|
||||
remotessh.exp
|
||||
rsync.sh
|
||||
remote_command_verify.sh
|
||||
|
@ -1,2 +1 @@
|
||||
/usr/local/mariadb/columnstore/lib
|
||||
/usr/local/mariadb/columnstore/mysql/lib
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copy this file to /etc/default and rename it to 'columnstore'.
|
||||
|
||||
# Change this line to your MariaDB Columnstore installation directory
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
|
||||
|
||||
LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
@ -51,8 +51,8 @@ export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
InstallDir=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $InstallDir != "/usr/local/mariadb/columnstore" ]; then
|
||||
export PATH=$InstallDir/bin:$InstallDir/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$InstallDir/lib:$InstallDir/mysql/lib
|
||||
export PATH=$InstallDir/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$InstallDir/lib
|
||||
fi
|
||||
|
||||
#hadoop
|
||||
|
@ -1,6 +1,6 @@
|
||||
# MariaDB Columnstore Alias Commands
|
||||
#
|
||||
alias mcsmysql='/usr/local/mariadb/columnstore/mysql/bin/mysql -u root'
|
||||
alias mcsmysql='mysql -u root'
|
||||
alias ma=/usr/local/mariadb/columnstore/bin/mcsadmin
|
||||
alias mcsadmin=/usr/local/mariadb/columnstore/bin/mcsadmin
|
||||
alias cpimport=/usr/local/mariadb/columnstore/bin/cpimport
|
||||
|
@ -18,12 +18,3 @@
|
||||
copy
|
||||
olddir @ENGINE_SYSCONFDIR@/columnstore
|
||||
}
|
||||
/usr/local/mariadb/columnstore/mysql/db/*.err {
|
||||
missingok
|
||||
rotate 7
|
||||
daily
|
||||
dateext
|
||||
copytruncate
|
||||
olddir /usr/local/mariadb/columnstore/mysql/db
|
||||
su root root
|
||||
}
|
||||
|
@ -48,8 +48,7 @@ stop slave;
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
mysql \
|
||||
--user=root $pwprompt \
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
@ -64,8 +63,7 @@ reset slave;
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
mysql \
|
||||
--user=root $pwprompt \
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
|
@ -56,7 +56,7 @@ $command;
|
||||
EOD
|
||||
|
||||
cat${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys < ${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log 2>&1
|
||||
|
||||
|
@ -51,7 +51,7 @@ GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -68,7 +68,7 @@ grant REPLICATION SLAVE on *.* to '$repUser'@'$hostipaddr' identified by 'Calpon
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -83,7 +83,7 @@ SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -95,7 +95,7 @@ SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_master-rep.sql >${tmpdir}/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/show-master-status.log
|
||||
|
||||
|
@ -50,8 +50,8 @@ shift $shiftcnt
|
||||
|
||||
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib
|
||||
else
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
fi
|
||||
@ -93,13 +93,6 @@ if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
systemtype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
||||
if [ $systemtype = "1" ]; then
|
||||
umstoragetype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMStorageType`
|
||||
if [ $umstoragetype = "external" ]; then
|
||||
echo "Setup UM Volume Mount"
|
||||
device=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMVolumeDeviceName$mid`
|
||||
mkdir -p $COLUMNSTORE_INSTALL_DIR/mysql/db > /dev/null 2>&1
|
||||
sudo mount $device $COLUMNSTORE_INSTALL_DIR/mysql/db -t ext2 -o noatime,nodiratime,noauto,user
|
||||
sudo chown $user:$user -R $COLUMNSTORE_INSTALL_DIR/mysql > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -22,7 +22,7 @@ for arg in "$@"; do
|
||||
if [ $installdirTmp == $installdir ] ; then
|
||||
user=root
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib
|
||||
else
|
||||
installdir=$installdirTmp
|
||||
prefix=`dirname $installdir`
|
||||
@ -43,7 +43,7 @@ done
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib
|
||||
else
|
||||
# add library config file
|
||||
/bin/cp -f $installdir/bin/columnstore.conf /etc/ld.so.conf.d/. >/dev/null 2>&1
|
||||
@ -130,7 +130,7 @@ if [ $user != "root" ]; then
|
||||
echo " " >> ${profileFile}
|
||||
echo "# MariaDB Columnstore Non-Root Environment Variables" >> ${profileFile}
|
||||
echo "export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR" >> ${profileFile}
|
||||
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib" >> ${profileFile}
|
||||
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib" >> ${profileFile}
|
||||
fi
|
||||
|
||||
egrep -qs 'MariaDB Columnstore Non-Root Alias Variables' ${profileFile}
|
||||
@ -207,10 +207,6 @@ mkdir -p $hdfsDir >/dev/null 2>&1
|
||||
#create mount directories
|
||||
mkdir /mnt/tmp > /dev/null 2>&1
|
||||
|
||||
# remove mysql archive log
|
||||
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
|
||||
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
|
||||
|
||||
# delete Columnstore shared memory segments
|
||||
$installdir/bin/clearShm > /dev/null 2>&1
|
||||
|
||||
|
@ -22,9 +22,9 @@ checkForError() {
|
||||
# See if engine columnstore exist
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking for engine columnstore..."
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
--execute='select * from mysql.plugin where name="columnstore";' \
|
||||
--execute='show engines;' \
|
||||
calpontsys | grep -i columnstore
|
||||
|
||||
#
|
||||
@ -65,31 +65,11 @@ USER=`whoami 2>/dev/null`
|
||||
if [ $USER != "root" ]; then
|
||||
ldconfig >/dev/null 2>&1
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib
|
||||
else
|
||||
ldconfig
|
||||
fi
|
||||
|
||||
if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then
|
||||
libcalmysql=$installdir/lib/libcalmysql.so.1.0.0
|
||||
libudfsdk=$installdir/lib/libudf_mysql.so.1.0.0
|
||||
libregrsdk=$installdir/lib/libregr_mysql.so.1.0.0
|
||||
elif [ -f $installdir/lib/libcalmysql.so.1 ]; then
|
||||
libcalmysql=$installdir/lib/libcalmysql.so.1
|
||||
libudfsdk=$installdir/lib/libudf_mysql.so.1
|
||||
libregrsdk=$installdir/lib/libregr_mysql.so.1
|
||||
else
|
||||
libcalmysql=
|
||||
fi
|
||||
|
||||
if [ -d $installdir/mysql/lib64/mysql/plugin -a -n "$libcalmysql" ]; then
|
||||
cd $installdir/mysql/lib64/mysql/plugin
|
||||
ln -sf $libcalmysql libcalmysql.so
|
||||
ln -sf $libcalmysql libcalmysqlent.so
|
||||
ln -sf $libudfsdk libudf_mysql.so
|
||||
ln -sf $libregrsdk libregr_mysql.so
|
||||
fi
|
||||
|
||||
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g /etc/my.cnf.d/columnstore.cnf
|
||||
fi
|
||||
|
@ -38,132 +38,7 @@ for arg in "$@"; do
|
||||
fi
|
||||
done
|
||||
|
||||
#cd $installdir/mysql/lib
|
||||
#for file in libmysqlclient libmysqlclient_r; do
|
||||
# ln -sf $file.so.18.0.0 $file.so
|
||||
# ln -sf $file.so.18.0.0 $file.so.18
|
||||
#done
|
||||
cd $installdir/mysql/lib/plugin
|
||||
for file in ha_archive ha_blackhole ha_federated ha_innodb; do
|
||||
ln -sf $file.so $file.so.0
|
||||
done
|
||||
|
||||
### taken from MySQL-server-5.1.30-0.glibc23.i386.rpm
|
||||
mysql_datadir=$installdir/mysql/db
|
||||
|
||||
# Create data directory if needed
|
||||
if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi
|
||||
if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
|
||||
if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
|
||||
if test ! -d $installdir/mysql/lib; then mkdir $installdir/mysql/lib; fi
|
||||
if test ! -d $installdir/mysql/lib/mysql; then mkdir $installdir/mysql/lib/mysql; fi
|
||||
|
||||
# Create a MySQL user and group. Do not report any problems if it already
|
||||
# exists.
|
||||
groupadd -r $user 2> /dev/null || true
|
||||
useradd -m -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g $user $user 2> /dev/null || true
|
||||
# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
|
||||
usermod -g $user $user 2> /dev/null || true
|
||||
|
||||
# Change permissions so that the user that will run the MySQL daemon
|
||||
# owns all database files.
|
||||
chown -R $user:$user $installdir/mysql
|
||||
|
||||
# Initiate databases if needed
|
||||
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g /etc/my.cnf.d/columnstore.cnf
|
||||
fi
|
||||
|
||||
# InfiniDB testing hook...
|
||||
test -x /usr/local/bin/idb-testing-mysql-pre-start && /usr/local/bin/idb-testing-mysql-pre-start $installdir/mysql
|
||||
|
||||
# If DB exist, run upgrade script if it exist
|
||||
if [ -d $installdir/mysql/db/calpontsys ]; then
|
||||
|
||||
if [ -x $installdir/mysql/mysql-Columnstore ]; then
|
||||
# Restart in the same way that mysqld will be started normally.
|
||||
$installdir/mysql/mysql-Columnstore stop >/dev/null 2>&1
|
||||
sleep 2
|
||||
$installdir/mysql/mysql-Columnstore start --skip-grant-tables
|
||||
|
||||
sleep 5
|
||||
|
||||
# Run MariaDB (mysql) upgrade script, if it exist
|
||||
if [ -x $installdir/mysql/bin/mysql_upgrade ]; then
|
||||
echo "Running mysql_upgrade script"
|
||||
if [[ ${password} == " " ]]; then
|
||||
$installdir/mysql/bin/mysql_upgrade > $tmpdir/mysql_upgrade.log
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: mysql_upgrade failure, check $tmpdir/mysql_upgrade.log"
|
||||
$installdir/mysql/mysql-Columnstore stop
|
||||
sleep 2
|
||||
exit 2;
|
||||
fi
|
||||
else
|
||||
$installdir/mysql/bin/mysql_upgrade --password=$password > $tmpdir/mysql_upgrade.log
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: mysql_upgrade failure, check $tmpdir/mysql_upgrade.log"
|
||||
$installdir/mysql/mysql-Columnstore stop
|
||||
sleep 2
|
||||
exit 2;
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# stop
|
||||
$installdir/mysql/mysql-Columnstore stop
|
||||
sleep 2
|
||||
fi
|
||||
fi
|
||||
|
||||
### Don't give the user the notes, we'll fix them ourselves...
|
||||
$installdir/mysql/scripts/mysql_install_db --rpm --user=$user --basedir=$installdir/mysql >/dev/null
|
||||
# Change permissions again to fix any new files.
|
||||
chown -R $user:$user $mysql_datadir
|
||||
|
||||
# Fix permissions for the permission database so that only the user
|
||||
# can read them.
|
||||
chmod -R og-rw $mysql_datadir/mysql
|
||||
|
||||
# Change permissions again to fix any new files.
|
||||
chown -R $user.$user $installdir/mysql
|
||||
|
||||
if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then
|
||||
libcalmysql=$installdir/lib/libcalmysql.so.1.0.0
|
||||
libudfsdk=$installdir/lib/libudf_mysql.so.1.0.0
|
||||
libregrsdk=$installdir/lib/libregr_mysql.so.1.0.0
|
||||
is_columnstore_tables=$installdir/lib/is_columnstore_tables.so.1.0.0
|
||||
is_columnstore_columns=$installdir/lib/is_columnstore_columns.so.1.0.0
|
||||
is_columnstore_extents=$installdir/lib/is_columnstore_extents.so.1.0.0
|
||||
is_columnstore_files=$installdir/lib/is_columnstore_files.so.1.0.0
|
||||
elif [ -f $installdir/lib/libcalmysql.so.1 ]; then
|
||||
libcalmysql=$installdir/lib/libcalmysql.so.1
|
||||
libudfsdk=$installdir/lib/libudf_mysql.so.1
|
||||
libregrsdk=$installdir/lib/libregr_mysql.so.1
|
||||
is_columnstore_tables=$installdir/lib/is_columnstore_tables.so.1
|
||||
is_columnstore_columns=$installdir/lib/is_columnstore_columns.so.1
|
||||
is_columnstore_extents=$installdir/lib/is_columnstore_extents.so.1
|
||||
is_columnstore_files=$installdir/lib/is_columnstore_files.so.1
|
||||
else
|
||||
libcalmysql=
|
||||
fi
|
||||
|
||||
if [ -n "$libcalmysql" ]; then
|
||||
|
||||
cd $installdir/mysql/lib/plugin
|
||||
ln -sf $libcalmysql libcalmysql.so
|
||||
ln -sf $libcalmysql libcalmysqlent.so
|
||||
ln -sf $libudfsdk libudf_mysql.so
|
||||
ln -sf $libregrsdk libregr_mysql.so
|
||||
ln -sf $is_columnstore_tables is_columnstore_tables.so
|
||||
ln -sf $is_columnstore_columns is_columnstore_columns.so
|
||||
ln -sf $is_columnstore_extents is_columnstore_extents.so
|
||||
ln -sf $is_columnstore_files is_columnstore_files.so
|
||||
fi
|
||||
|
||||
# cleanup previous install mysql replication files
|
||||
rm -rf $mysql_datadir/*relay*
|
||||
rm -rf $mysql_datadir/mysql-bin.*
|
||||
rm -rf $mysql_datadir/master.info
|
||||
mysql_install_db --rpm --user=$user >/dev/null
|
||||
|
||||
exit 0
|
||||
|
@ -38,7 +38,7 @@ $installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib
|
||||
fi
|
||||
|
||||
cloud=`$installdir/bin/getConfig Installation Cloud`
|
||||
@ -72,8 +72,6 @@ if [ $user == "root" ]; then
|
||||
rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1\
|
||||
|
||||
# delete Mariab Columnstore shared memory segments
|
||||
$installdir/bin/clearShm > /dev/null 2>&1
|
||||
|
||||
@ -131,7 +129,7 @@ fi
|
||||
if [ $quiet != 1 ]; then
|
||||
#make copy of Columnstore.xml
|
||||
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1
|
||||
/bin/cp -f $installdir/mysql/my.cnf $installdir/mysql/my.cnf.rpmsave > /dev/null 2>&1
|
||||
/bin/cp -f /etc/my.cnf.d/columnstore.cnf /etc/my.cnf.d/columnstore.cnf.rpmsave > /dev/null 2>&1
|
||||
cp $installdir/bin/myCnf-include-args.text $installdir/bin/myCnf-include-args.text.rpmsave >& /dev/null
|
||||
rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave
|
||||
fi
|
||||
|
@ -25,7 +25,8 @@ if { $PASSWORD == "ssh" } {
|
||||
set PASSWORD ""
|
||||
}
|
||||
|
||||
set COMMAND "rsync -vopgr -e ssh --exclude=mysql/ --exclude=test/ --exclude=infinidb_vtable/ --exclude=infinidb_querystats/ --exclude=calpontsys/ --include=*/ --include=*/* --exclude=* $INSTALLDIR/mysql/db/ $USERNAME@$SERVER:$INSTALLDIR/mysql/db/"
|
||||
# LinuxJedi: Not sure what this is expecting to be copying, but it probably shouldn't be doing it
|
||||
# set COMMAND "rsync -vopgr -e ssh --exclude=mysql/ --exclude=test/ --exclude=infinidb_vtable/ --exclude=infinidb_querystats/ --exclude=calpontsys/ --include=*/ --include=*/* --exclude=* $INSTALLDIR/mysql/db/ $USERNAME@$SERVER:$INSTALLDIR/mysql/db/"
|
||||
|
||||
#
|
||||
# run command
|
||||
|
@ -56,7 +56,7 @@ stop slave;
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
@ -78,7 +78,7 @@ CHANGE MASTER TO
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
@ -93,7 +93,7 @@ start slave;
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
@ -108,7 +108,7 @@ SHOW SLAVE STATUS\G
|
||||
EOD
|
||||
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
mysql \
|
||||
--user=root \
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
|
@ -7859,47 +7859,25 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
if (action == MYSQL_START || action == MYSQL_RESTART)
|
||||
{
|
||||
//get pid
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
char buf[512];
|
||||
FILE *cmd_pipe = popen("pidof -s mysqld", "r");
|
||||
|
||||
//fail if file size 0
|
||||
oldFile.seekg(0, std::ios::end);
|
||||
int size = oldFile.tellg();
|
||||
fgets(buf, 512, cmd_pipe);
|
||||
pid_t pid = strtoul(buf, NULL, 10);
|
||||
|
||||
if ( size == 0 )
|
||||
pclose( cmd_pipe );
|
||||
|
||||
if (!pid)
|
||||
{
|
||||
// mysql not started
|
||||
writeLog("***mysql.pid FILE SIZE EQUALS ZERO", LOG_TYPE_ERROR);
|
||||
writeLog("***mysqld NOT RUNNING", LOG_TYPE_ERROR);
|
||||
exceptionControl("actionMysqlCalpont", API_FAILURE);
|
||||
}
|
||||
|
||||
char line[400];
|
||||
string pid;
|
||||
|
||||
while (oldFile.getline(line, 400))
|
||||
{
|
||||
pid = line;
|
||||
string::size_type pos = pid.find("cat", 0);
|
||||
|
||||
if (pos != string::npos)
|
||||
{
|
||||
// mysql not started
|
||||
writeLog("***mysql.pid FILE HAS CAT", LOG_TYPE_ERROR);
|
||||
exceptionControl("actionMysqlCalpont", API_FAILURE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
oldFile.close();
|
||||
|
||||
int PID = atoi(pid.c_str());
|
||||
|
||||
//set process status
|
||||
try
|
||||
{
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, PID);
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, pid);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
@ -7918,24 +7896,18 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
if ( state != ACTIVE )
|
||||
{
|
||||
//get pid
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
char line[400];
|
||||
string pid;
|
||||
char buf[512];
|
||||
FILE *cmd_pipe = popen("pidof -s mysqld", "r");
|
||||
|
||||
while (oldFile.getline(line, 400))
|
||||
{
|
||||
pid = line;
|
||||
break;
|
||||
}
|
||||
fgets(buf, 512, cmd_pipe);
|
||||
pid_t pid = strtoul(buf, NULL, 10);
|
||||
|
||||
oldFile.close();
|
||||
pclose( cmd_pipe );
|
||||
|
||||
//set process status
|
||||
try
|
||||
{
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, atoi(pid.c_str()));
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, pid);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
@ -7945,26 +7917,20 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
else
|
||||
{
|
||||
//check if pid has changed
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
char line[400];
|
||||
string pid;
|
||||
char buf[512];
|
||||
FILE *cmd_pipe = popen("pidof -s mysqld", "r");
|
||||
|
||||
while (oldFile.getline(line, 400))
|
||||
{
|
||||
pid = line;
|
||||
break;
|
||||
}
|
||||
fgets(buf, 512, cmd_pipe);
|
||||
pid_t pid = strtoul(buf, NULL, 10);
|
||||
|
||||
oldFile.close();
|
||||
pclose( cmd_pipe );
|
||||
|
||||
if ( pidStatus != atoi(pid.c_str()) )
|
||||
if ( pidStatus != pid )
|
||||
{
|
||||
//set process status
|
||||
try
|
||||
{
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, atoi(pid.c_str()));
|
||||
setProcessStatus("mysqld", moduleName, ACTIVE, pid);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
@ -572,7 +572,6 @@ enum PROC_MGT_TYPE_REQUEST
|
||||
OAMPARENTCOLD,
|
||||
GETALARMDATA,
|
||||
GETACTIVEALARMDATA,
|
||||
RUNUPGRADE,
|
||||
PROCUNMOUNT,
|
||||
PROCMOUNT,
|
||||
PROCFSTABUPDATE,
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql -u root"
|
||||
MYSQLCMD="mysql -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -205,7 +205,7 @@ void reportThread(string reporttype)
|
||||
cmd = "mv -f " + tmpDir + "/" + localModule + "_logReport.tar.gz .";
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "tar -zcf " + localModule + "_mysqllogReport.tar.gz " + installDir + "/mysql/db/*.err* 2>/dev/null";
|
||||
cmd = "tar -zcf " + localModule + "_mysqllogReport.tar.gz /var/log/mysql/*.err* 2>/dev/null";
|
||||
system(cmd.c_str());
|
||||
|
||||
// run log config on local server
|
||||
@ -873,7 +873,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
// check if mysql is supported and get info
|
||||
string logFile = tmpDir + "/idbmysql.log";
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql -u root ";
|
||||
string columnstoreMysql = "mysql -u root ";
|
||||
string cmd = columnstoreMysql + " -e 'status' > " + logFile + " 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
@ -947,7 +947,7 @@ int main(int argc, char* argv[])
|
||||
if (!FAILED)
|
||||
{
|
||||
// check if mysql is supported and get info
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql -u root " + pwprompt;
|
||||
string columnstoreMysql = "mysql -u root " + pwprompt;
|
||||
string cmd = columnstoreMysql + " -V > /dev/null 2>&1";
|
||||
int ret = system(cmd.c_str());
|
||||
|
||||
|
@ -17,8 +17,8 @@ fi
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $COLUMNSTORE_INSTALL_DIR != "/usr/local/mariadb/columnstore" ]; then
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib
|
||||
fi
|
||||
|
||||
cd $COLUMNSTORE_INSTALL_DIR
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql -u root"
|
||||
MYSQLCMD="mysql -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -45,7 +45,7 @@
|
||||
#
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql -u root"
|
||||
MYSQLCMD="mysql -u root"
|
||||
fi
|
||||
|
||||
if [ -z "$INSTALLDIR" ]; then
|
||||
|
@ -13,13 +13,13 @@ fi
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $COLUMNSTORE_INSTALL_DIR != "/usr/local/mariadb/columnstore" ]; then
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql -u root"
|
||||
MYSQLCMD="mysql -u root"
|
||||
export MYSQLCMD
|
||||
fi
|
||||
|
||||
|
@ -2095,12 +2095,6 @@ int main(int argc, char* argv[])
|
||||
|
||||
cmd = "mkdir -p " + installDir + "/data1/mysqldb > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "mkdir -p " + installDir + "/mysql > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "cd " + installDir + "/mysql/;ln -s " + installDir + "/data1/mysqldb db > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
}
|
||||
|
||||
//install rpms
|
||||
|
@ -311,101 +311,6 @@ void mysqlSetup()
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
* @brief sendUpgradeRequest
|
||||
*
|
||||
* purpose: send Upgrade Request Msg to all ACTIVE UMs
|
||||
*
|
||||
*
|
||||
******************************************************************************************/
|
||||
int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
||||
{
|
||||
Oam oam;
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessStatus procstat;
|
||||
oam.getProcessStatus("WriteEngineServer", "pm1", procstat);
|
||||
|
||||
if ( procstat.ProcessOpState == oam::ACTIVE)
|
||||
break;
|
||||
}
|
||||
catch (const std::exception& exc)
|
||||
{
|
||||
std::cerr << exc.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
SystemModuleTypeConfig systemmoduletypeconfig;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig(systemmoduletypeconfig);
|
||||
}
|
||||
catch (const std::exception& exc)
|
||||
{
|
||||
std::cerr << exc.what() << std::endl;
|
||||
}
|
||||
|
||||
messageqcpp::ByteStream msg;
|
||||
messageqcpp::ByteStream::byte requestID = RUNUPGRADE;
|
||||
|
||||
msg << requestID;
|
||||
|
||||
int returnStatus = oam::API_SUCCESS;
|
||||
|
||||
for ( unsigned int i = 0; i < systemmoduletypeconfig.moduletypeconfig.size(); i++)
|
||||
{
|
||||
int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount;
|
||||
|
||||
if ( moduleCount == 0)
|
||||
continue;
|
||||
|
||||
string moduleType = systemmoduletypeconfig.moduletypeconfig[i].ModuleType;
|
||||
|
||||
if ( moduleType == "um" ||
|
||||
( moduleType == "pm" && IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
||||
( moduleType == "pm" && pmwithum ) )
|
||||
{
|
||||
|
||||
DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin();
|
||||
|
||||
for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++)
|
||||
{
|
||||
int opState = oam::ACTIVE;
|
||||
bool degraded;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getModuleStatus((*pt).DeviceName, opState, degraded);
|
||||
|
||||
if (opState == oam::ACTIVE ||
|
||||
opState == oam::DEGRADED)
|
||||
{
|
||||
returnStatus = sendMsgProcMon( (*pt).DeviceName, msg, requestID, 30 );
|
||||
|
||||
if ( returnStatus != API_SUCCESS)
|
||||
{
|
||||
string tmpDir = startup::StartUp::tmpDir();
|
||||
|
||||
cout << "ERROR: Error return in running the MariaDB Columnstore Upgrade, check " + tmpDir + "/mysql_upgrade.log on " << (*pt).DeviceName << endl;
|
||||
return returnStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception& exc)
|
||||
{
|
||||
std::cerr << exc.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnStatus;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
* @brief sendReplicationRequest
|
||||
*
|
||||
|
@ -38,7 +38,6 @@ extern bool waitForActive();
|
||||
extern void dbrmDirCheck();
|
||||
extern void mysqlSetup();
|
||||
extern int sendMsgProcMon( std::string module, messageqcpp::ByteStream msg, int requestID, int timeout );
|
||||
extern int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum = false);
|
||||
extern int sendReplicationRequest(int IserverTypeInstall, std::string password, bool pmwithum);
|
||||
extern void checkFilesPerPartion(int DBRootCount, Config* sysConfig);
|
||||
extern void checkMysqlPort( string& mysqlPort, Config* sysConfig);
|
||||
|
@ -995,19 +995,6 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
if ( oam.checkLogStatus(logFile, "System catalog appears to exist") )
|
||||
{
|
||||
/* cout << endl << "Run MariaDB Server Upgrade.. ";
|
||||
cout.flush();
|
||||
|
||||
//send message to procmon's to run upgrade script
|
||||
int status = sendUpgradeRequest(IserverTypeInstall);
|
||||
|
||||
if ( status != 0 ) {
|
||||
cout << endl << "MariaDB Columnstore Install Failed" << endl << endl;
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
cout << " DONE" << endl;
|
||||
*/
|
||||
cout.flush();
|
||||
}
|
||||
else
|
||||
|
@ -2961,15 +2961,6 @@ int main(int argc, char* argv[])
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
string pathID = installDir + "/mysql/db";
|
||||
|
||||
// check volume for attach and try to attach if not
|
||||
if ( !attachVolume(newModuleHostName, volumeName, deviceName, pathID) )
|
||||
{
|
||||
cout << "attachVolume error" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3866,19 +3857,6 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
if ( oam.checkLogStatus(dbbuilderLog, "System catalog appears to exist") )
|
||||
{
|
||||
/* cout << endl << "Run MariaDB Server Upgrade.. ";
|
||||
cout.flush();
|
||||
|
||||
//send message to procmon's to run upgrade script
|
||||
int status = sendUpgradeRequest(IserverTypeInstall, pmwithum);
|
||||
|
||||
if ( status != 0 ) {
|
||||
cout << endl << "MariaDB Columnstore Install Failed" << endl << endl;
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
cout << " DONE" << endl;
|
||||
*/
|
||||
cout.flush();
|
||||
}
|
||||
else
|
||||
|
@ -73,7 +73,7 @@ else
|
||||
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib
|
||||
|
||||
echo "${bold}Run postConfigure script${normal}"
|
||||
echo ""
|
||||
|
@ -79,7 +79,7 @@ else
|
||||
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib
|
||||
|
||||
echo "${bold}Run postConfigure script${normal}"
|
||||
echo ""
|
||||
|
@ -32,7 +32,7 @@ else
|
||||
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib
|
||||
|
||||
echo "Run postConfigure script"
|
||||
echo ""
|
||||
|
@ -10467,134 +10467,6 @@ int ProcessManager::setEnableState(std::string target, std::string state)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************************
|
||||
* @brief sendUpgradeRequest
|
||||
*
|
||||
* purpose: send Upgrade Request Msg to all ACTIVE UMs
|
||||
*
|
||||
*
|
||||
******************************************************************************************/
|
||||
void sendUpgradeRequest()
|
||||
{
|
||||
ProcessLog log;
|
||||
Configuration config;
|
||||
ProcessManager processManager(config, log);
|
||||
Oam oam;
|
||||
bool exitThread = false;
|
||||
int exitThreadStatus = oam::API_SUCCESS;
|
||||
|
||||
pthread_t ThreadId;
|
||||
ThreadId = pthread_self();
|
||||
|
||||
// wait until DMLProc is ACTIVE
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessStatus procstat;
|
||||
oam.getProcessStatus("WriteEngineServer", config.moduleName(), procstat);
|
||||
|
||||
if ( procstat.ProcessOpState == oam::ACTIVE)
|
||||
break;
|
||||
}
|
||||
catch (exception& ex)
|
||||
{
|
||||
// string error = ex.what();
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getProcessStatus: " + error, LOG_TYPE_ERROR);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getProcessStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
SystemModuleTypeConfig systemmoduletypeconfig;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig(systemmoduletypeconfig);
|
||||
}
|
||||
catch (exception& ex)
|
||||
{
|
||||
string error = ex.what();
|
||||
log.writeLog(__LINE__, "EXCEPTION ERROR on getSystemConfig: " + error, LOG_TYPE_ERROR);
|
||||
exitThread = true;
|
||||
exitThreadStatus = oam::API_FAILURE;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
log.writeLog(__LINE__, "EXCEPTION ERROR on getSystemConfig: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
exitThread = true;
|
||||
exitThreadStatus = oam::API_FAILURE;
|
||||
}
|
||||
|
||||
if ( exitThread )
|
||||
{
|
||||
pthread_detach (ThreadId);
|
||||
pthread_exit(reinterpret_cast<void*>(static_cast<ptrdiff_t>(exitThreadStatus)));
|
||||
}
|
||||
|
||||
ByteStream msg;
|
||||
ByteStream::byte requestID = RUNUPGRADE;
|
||||
|
||||
msg << requestID;
|
||||
msg << " "; // pass a blank dummy password
|
||||
|
||||
int returnStatus = oam::API_SUCCESS;
|
||||
|
||||
for ( unsigned int i = 0; i < systemmoduletypeconfig.moduletypeconfig.size(); i++)
|
||||
{
|
||||
int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount;
|
||||
|
||||
if ( moduleCount == 0)
|
||||
continue;
|
||||
|
||||
string moduleType = systemmoduletypeconfig.moduletypeconfig[i].ModuleType;
|
||||
|
||||
if ( moduleType == "um" ||
|
||||
( moduleType == "pm" && config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) )
|
||||
{
|
||||
|
||||
DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin();
|
||||
|
||||
for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++)
|
||||
{
|
||||
int opState = oam::ACTIVE;
|
||||
bool degraded;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getModuleStatus((*pt).DeviceName, opState, degraded);
|
||||
|
||||
if (opState == oam::ACTIVE ||
|
||||
opState == oam::DEGRADED)
|
||||
{
|
||||
returnStatus = processManager.sendMsgProcMon( (*pt).DeviceName, msg, requestID, 30 );
|
||||
|
||||
upgradethreadStatus = returnStatus;
|
||||
|
||||
if ( returnStatus != API_SUCCESS)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (exception& ex)
|
||||
{
|
||||
// string error = ex.what();
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getModuleStatus on module " + (*pt).DeviceName + ": " + error, LOG_TYPE_ERROR);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getModuleStatus on module " + (*pt).DeviceName + ": Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pthread_detach (ThreadId);
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
* @brief stopProcessTypes
|
||||
*
|
||||
|
@ -81,8 +81,6 @@ void startModuleThread(std::string moduleName);
|
||||
void stopModuleThread(std::string moduleName);
|
||||
void processMSG(messageqcpp::IOSocket* fIos);
|
||||
|
||||
void sendUpgradeRequest();
|
||||
|
||||
/** @brief Timeset for Milleseconds
|
||||
*/
|
||||
#define TS_MS(x) ((x) * 1000000)
|
||||
|
@ -1697,23 +1697,6 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
||||
break;
|
||||
}
|
||||
|
||||
case RUNUPGRADE:
|
||||
{
|
||||
log.writeLog(__LINE__, "MSG RECEIVED: Run upgrade script ");
|
||||
|
||||
// run upgrade script
|
||||
int ret = runUpgrade();
|
||||
|
||||
ackMsg << (ByteStream::byte) ACK;
|
||||
ackMsg << (ByteStream::byte) RUNUPGRADE;
|
||||
ackMsg << (ByteStream::byte) ret;
|
||||
mq.write(ackMsg);
|
||||
|
||||
log.writeLog(__LINE__, "RUNUPGRADE: ACK back to ProcMgr return status = " + oam.itoa((int) ret));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PROCUNMOUNT:
|
||||
{
|
||||
string dbrootID;
|
||||
@ -5916,86 +5899,6 @@ bool ProcessMonitor::amazonVolumeCheck(int dbrootID)
|
||||
MonitorLog log;
|
||||
Oam oam;
|
||||
|
||||
if ( config.moduleType() == "um")
|
||||
{
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function called for User Module", LOG_TYPE_DEBUG);
|
||||
|
||||
string volumeNameID = "UMVolumeName" + oam.itoa(config.moduleID());
|
||||
string volumeName = oam::UnassignedName;
|
||||
string deviceNameID = "UMVolumeDeviceName" + oam.itoa(config.moduleID());
|
||||
string deviceName = oam::UnassignedName;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig( volumeNameID, volumeName);
|
||||
oam.getSystemConfig( deviceNameID, deviceName);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( volumeName.empty() || volumeName == oam::UnassignedName )
|
||||
{
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function exiting, no volume assigned ", LOG_TYPE_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
string status = oam.getEC2VolumeStatus(volumeName);
|
||||
|
||||
if ( status == "attached" )
|
||||
{
|
||||
string cmd;
|
||||
string mountLog = tmpLogDir + "/um_mount.log";
|
||||
cmd = SUDO + "mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o noatime,nodiratime,user > " + mountLog;
|
||||
|
||||
system(cmd.c_str());
|
||||
log.writeLog(__LINE__, "mount cmd: " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
cmd = SUDO + "chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/mysql/db";
|
||||
system(cmd.c_str());
|
||||
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function successfully completed, volume attached: " + volumeName, LOG_TYPE_DEBUG);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( status != "available" )
|
||||
{
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function failed, volume not attached and not available: " + volumeName, LOG_TYPE_WARNING);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//get Module HostName / InstanceName
|
||||
string instanceName;
|
||||
|
||||
try
|
||||
{
|
||||
ModuleConfig moduleconfig;
|
||||
oam.getSystemConfig(config.moduleName(), moduleconfig);
|
||||
HostConfigList::iterator pt1 = moduleconfig.hostConfigList.begin();
|
||||
instanceName = (*pt1).HostName;
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if (oam.attachEC2Volume(volumeName, deviceName, instanceName))
|
||||
{
|
||||
string cmd = SUDO + "mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o noatime,nodiratime,user > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
log.writeLog(__LINE__, "mount cmd: " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
cmd = SUDO + "chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/mysql/db";
|
||||
system(cmd.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function failed, volume failed to attached: " + volumeName, LOG_TYPE_WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log.writeLog(__LINE__, "amazonVolumeCheck function called for DBRoot" + oam.itoa(dbrootID), LOG_TYPE_DEBUG);
|
||||
|
||||
@ -6615,56 +6518,6 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
||||
return oam::API_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
* @brief runUpgrade
|
||||
*
|
||||
* purpose: run upgrade script
|
||||
*
|
||||
******************************************************************************************/
|
||||
int ProcessMonitor::runUpgrade()
|
||||
{
|
||||
Oam oam;
|
||||
|
||||
string tmpLog = tmpLogDir + "/mysql_upgrade.log";
|
||||
|
||||
string mysqlpw = oam.getMySQLPassword();
|
||||
|
||||
string passwordOption = "";
|
||||
if ( mysqlpw != oam::UnassignedName )
|
||||
passwordOption = " --password=" + mysqlpw;
|
||||
|
||||
for ( int i = 0 ; i < 10 ; i++ )
|
||||
{
|
||||
//run upgrade script
|
||||
string cmd = startup::StartUp::installDir() + "/mysql/bin/mysql_upgrade " +
|
||||
passwordOption + " > " + tmpLog + " 2>&1";
|
||||
|
||||
log.writeLog(__LINE__, "runUpgrade, cmd = " + cmd, LOG_TYPE_DEBUG);
|
||||
int retCode = system(cmd.c_str());
|
||||
if ( retCode == 0 ) {
|
||||
log.writeLog(__LINE__, "mysql_upgrade.sh: Successful return", LOG_TYPE_DEBUG);
|
||||
return oam::API_SUCCESS;
|
||||
}
|
||||
else {
|
||||
if (oam.checkLogStatus(cmd, "ERROR 1045") ) {
|
||||
log.writeLog(__LINE__, "mysql_upgrade.sh: Missing Password error, return success", LOG_TYPE_DEBUG);
|
||||
return oam::API_SUCCESS;
|
||||
}
|
||||
|
||||
log.writeLog(__LINE__, "mysql_upgrade.sh: Error return, check log " + tmpLog, LOG_TYPE_ERROR);
|
||||
//restart mysqld and retry
|
||||
try {
|
||||
oam.actionMysqlCalpont(MYSQL_RESTART);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
return oam::API_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
} //end of namespace
|
||||
// vim:ts=4 sw=4:
|
||||
|
||||
|
@ -1,475 +0,0 @@
|
||||
#!/usr/bin/expect
|
||||
#
|
||||
# $Id: buildTester.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
# Build, install, and test Calpont Builds
|
||||
#
|
||||
set EMAIL " "
|
||||
set USERNAME root
|
||||
set PASSWORD Calpont1
|
||||
set BUILD " "
|
||||
set SVN genii
|
||||
set RELEASE " "
|
||||
set SYSTEM noSystem
|
||||
set USER " "
|
||||
set DEBUG "-k"
|
||||
set TEST(0) " "
|
||||
set SERVER srvswdev11
|
||||
|
||||
#set SHARED "//cal6500/shared"
|
||||
set SHARED "//calweb/shared"
|
||||
|
||||
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 "'buildTester' executes a set of DVM test on a specifed system and\n"
|
||||
send_user "send the results via email or outputs results to a log file.\n"
|
||||
send_user "It has the option of installing a released\n"
|
||||
send_user "build or generating a new build when release of 'Latest' is specified\n"
|
||||
send_user "and installing that build on the specified system.\n"
|
||||
send_user "\n"
|
||||
send_user "Usage: buildTester -b 'build-type' -r 'release' -v 'svn-branch' -s 'system' -sv 'server' -u 'database-user' -p 'password' -d -e -t 'test-names'\n"
|
||||
send_user " build-type - optional: RHEL5 or FC6\n"
|
||||
send_user " release - Required when build-type is entered: Calpont release number or 'Latest'\n"
|
||||
send_user " svn-branch - SVN Branch built againest, default to genii\n"
|
||||
send_user " system - Target install/test system\n"
|
||||
send_user " server - Target query server hostname\n"
|
||||
send_user " database-user - Database User, i.e. tpch1\n"
|
||||
send_user " password - system password, default to 'qcalpont!'\n"
|
||||
send_user " -d - Debug mode, will output additional install and test data\n"
|
||||
send_user " -e - email results\n"
|
||||
send_user " test-names - Test name list seperated by spaces (sanity tpch)\n"
|
||||
exit
|
||||
}
|
||||
if { $arg($i) == "-b" } {
|
||||
incr i
|
||||
set BUILD $arg($i)
|
||||
} elseif { $arg($i) == "-r" } {
|
||||
incr i
|
||||
set RELEASE $arg($i)
|
||||
} elseif { $arg($i) == "-s" } {
|
||||
incr i
|
||||
set SYSTEM $arg($i)
|
||||
} elseif { $arg($i) == "-v" } {
|
||||
incr i
|
||||
set SVN $arg($i)
|
||||
} elseif { $arg($i) == "-u" } {
|
||||
incr i
|
||||
set USER $arg($i)
|
||||
} elseif { $arg($i) == "-p" } {
|
||||
incr i
|
||||
set PASSWORD $arg($i)
|
||||
} elseif { $arg($i) == "-t" } {
|
||||
incr i
|
||||
if { $i == [llength $argv] } {
|
||||
puts "no Test Name entered, enter ./buildTester.sh -h for additional info"; exit -1
|
||||
}
|
||||
set TESTNUMBER 0
|
||||
while true {
|
||||
set TEST($TESTNUMBER) $arg($i)
|
||||
incr i
|
||||
incr TESTNUMBER
|
||||
if { $i == [llength $argv] } {
|
||||
incr i -1
|
||||
break
|
||||
}
|
||||
}
|
||||
} elseif { $arg($i) == "-e" } {
|
||||
if { $SYSTEM == "qaftest2" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,dcathey@calpont.com,bpaul@calpont.com
|
||||
} elseif { $SYSTEM == "qaftest2" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,dcathey@calpont.com,bpaul@calpont.com
|
||||
} elseif { $SYSTEM == "caldev02" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com,chao@calpont.com,xlou@calpont.com,dcathey@calpont.com
|
||||
} elseif { $SYSTEM == "srvswdev11" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com,chao@calpont.com,xlou@calpont.com,dcathey@calpont.com
|
||||
} elseif { $SYSTEM == "devint2" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com
|
||||
} elseif { $SYSTEM == "devint3" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com
|
||||
} elseif { $SYSTEM == "ss2" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com,chao@calpont.com,dcathey@calpont.com
|
||||
} elseif { $SYSTEM == "ss2ImportSSB100" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,dcathey@calpont.com,pleblanc@calpont.com
|
||||
} elseif { $SYSTEM == "demo01" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,pleblanc@calpont.com,chao@calpont.com
|
||||
} elseif { $SYSTEM == "qperfd01" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,bpaul@calpont.com,dcathey@calpont.com,pleblanc@calpont.com
|
||||
} elseif { $SYSTEM == "qperfd01" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,bpaul@calpont.com,dcathey@calpont.com
|
||||
} elseif { $SYSTEM == "qcald02a" } {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com,mroberts@calpont.com
|
||||
} else {
|
||||
set EMAIL dhill@calpont.com,wweeks@calpont.com
|
||||
}
|
||||
} elseif { $arg($i) == "-d" } {
|
||||
set DEBUG " "
|
||||
} elseif { $arg($i) == "-sv" } {
|
||||
incr i
|
||||
set SERVER $arg($i)
|
||||
}
|
||||
incr i
|
||||
}
|
||||
|
||||
if { $SYSTEM == "noSystem" } {
|
||||
set SYSTEM $BUILD
|
||||
}
|
||||
|
||||
#cleanup
|
||||
set RUN_LOG_FILE /tmp/$SYSTEM-$SVN.log
|
||||
exec rm -f /tmp/test.log $RUN_LOG_FILE
|
||||
# open log file
|
||||
log_file $RUN_LOG_FILE
|
||||
|
||||
#get current date
|
||||
exec date >/tmp/datesync.tmp
|
||||
exec cat /tmp/datesync.tmp
|
||||
set newtime [exec cat /tmp/datesync.tmp]
|
||||
#
|
||||
send_user "\n\n#####################################################################################################\n"
|
||||
send_user " Automated Build Tester Report $newtime\n"
|
||||
send_user " BUILD=$BUILD RELEASE=$RELEASE SVN-BRANCH=$SVN SYSTEM=$SYSTEM\n"
|
||||
send_user "\n#####################################################################################################\n\n"
|
||||
# build request
|
||||
log_user 1
|
||||
set timeout 30
|
||||
if { $BUILD != " " } {
|
||||
set timeout 6060
|
||||
|
||||
send_user "******************* Generate Build $BUILD / $RELEASE ****************************\n\n"
|
||||
|
||||
log_user 0
|
||||
send "./autoBuilder -o $BUILD -r $RELEASE -s $SVN\n"
|
||||
log_user 1
|
||||
expect {
|
||||
-re "Calpont RPM Build successfully completed" { } abort
|
||||
-re "Build Failed" { send_user "\nBuild Failed\n" ; puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
}
|
||||
#get current date
|
||||
exec date >/tmp/datesync.tmp
|
||||
exec cat /tmp/datesync.tmp
|
||||
set newtime [exec cat /tmp/datesync.tmp]
|
||||
|
||||
send_user "\nBuild successfully completed $newtime\n\n"
|
||||
}
|
||||
set timeout 30
|
||||
#expect -re "#"
|
||||
if { $DEBUG == " " } {
|
||||
log_user 1
|
||||
} else {
|
||||
log_user 0
|
||||
}
|
||||
if { $SYSTEM != $BUILD } {
|
||||
set timeout 1500
|
||||
if { $RELEASE != " " } {
|
||||
# install request
|
||||
send_user "\n\n******************* Install Build $RELEASE on $SYSTEM *******************************\n\n"
|
||||
send "./autoInstaller -s $SYSTEM -r $RELEASE -n -d\n"
|
||||
expect {
|
||||
-re "Install Successfully completed" { send_user "\nInstall successfully completed\n\n" } abort
|
||||
-re "Installation Failed" { send_user "\nInstallation Failed\n\n"
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
timeout { send_user "\nInstallation Failed - Timeout error\n\n"
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#get install RPM info
|
||||
#log_user 1
|
||||
#send_user "\n\n******************* Calpont RPM Install Information *******************************\n\n"
|
||||
#exec ./remote_command_test.sh $SERVER $PASSWORD "rpm -iq calpont | grep Version -A 2" " " "No such file" 60 1
|
||||
#exec ./remote_command.sh $SERVER $PASSWORD 'rpm -iq calpont' tools not 30 1
|
||||
#expect {
|
||||
# -re " " { abort }
|
||||
# -re "FAILED" {
|
||||
# puts "\nCalpont RPM not installed\n";
|
||||
# exec echo "Test Failed, Calpont RPM not installed" >> $RUN_LOG_FILE
|
||||
# puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1
|
||||
# }
|
||||
#}
|
||||
set timeout 30
|
||||
|
||||
if { $TEST(0) != " " } {
|
||||
set timeout 600
|
||||
set t 0
|
||||
while true {
|
||||
if { $t == $TESTNUMBER } {
|
||||
break
|
||||
}
|
||||
set TESTCASE $TEST($t)
|
||||
incr t
|
||||
|
||||
#get current date
|
||||
exec date >/tmp/datesync.tmp
|
||||
exec cat /tmp/datesync.tmp
|
||||
set newtime [exec cat /tmp/datesync.tmp]
|
||||
|
||||
log_user 1
|
||||
send_user "\n\n******************* Run Test $TESTCASE start at $newtime **********************************\n\n"
|
||||
#log_user 0
|
||||
|
||||
set TESTTYPE [exec expr substr $TESTCASE 1 5]
|
||||
if { $TESTTYPE == "mysql" } {
|
||||
set TESTCOMMAND [exec expr substr $TESTCASE 7 80]
|
||||
} else {
|
||||
# Oracle test case
|
||||
set TESTCOMMAND [exec expr substr $TESTCASE 8 80]
|
||||
}
|
||||
|
||||
if { $TESTTYPE == "oracl" } {
|
||||
if { [catch { open "/usr/local/lib/python2.4/site-packages/dvm_app/$USER\_$SYSTEM\_brefd01.cfg" "r"} handle ] } {
|
||||
exec echo "\nTest Failed, DVM config file $USER\_$SYSTEM\_brefd01.cfg not found\n";
|
||||
exec echo "Test Failed, DVM config file $USER\_$SYSTEM\_brefd01.cfg not found" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1
|
||||
}
|
||||
|
||||
if { $TESTCOMMAND == "tpch" } {
|
||||
exec su - oracle -c "python /usr/local/lib/python2.4/site-packages/dvm_app/dvm.py -c /usr/local/lib/python2.4/site-packages/dvm_app/$USER\\_$SYSTEM\_brefd01.cfg -e1 -sS -rB $DEBUG -l2 -t Perf_Tpch > /tmp/test.log "
|
||||
expect {
|
||||
-re "Traceback" {
|
||||
exec echo "\nTest Failed, Database instance is down\n";
|
||||
exec echo "Test Failed, Database instance is down" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
-re "$" { if { [catch { open "/tmp/test.log" "r"} handle ] } {
|
||||
exec echo "\nTest Failed, /tmp/test.log not found\n";
|
||||
exec echo "Test Failed, /tmp/test.log not found" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
}
|
||||
}
|
||||
exec cat /tmp/test.log >> $RUN_LOG_FILE
|
||||
} else {
|
||||
if { $TESTCOMMAND == "dml" } {
|
||||
exec su - oracle -c "python /usr/local/lib/python2.4/site-packages/dvm_app/dvm.py -c /usr/local/lib/python2.4/site-packages/dvm_app/$USER\\_$SYSTEM\_brefd01.cfg -sS -rB -l2 -t Iter16_TableNameLengths $DEBUG > /tmp/test.log "
|
||||
expect {
|
||||
-re "Traceback" {
|
||||
exec echo "\nTest Failed, Database instance is down\n";
|
||||
exec echo "Test Failed, Database instance is down" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
-re "$" { if { [catch { open "/tmp/test.log" "r"} handle ] } {
|
||||
exec echo "\nTest Failed, /tmp/test.log not found\n";
|
||||
exec echo "Test Failed, /tmp/test.log not found" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
}
|
||||
}
|
||||
exec cat /tmp/test.log >> $RUN_LOG_FILE
|
||||
|
||||
exec su - oracle -c "python /usr/local/lib/python2.4/site-packages/dvm_app/dvm.py -c /usr/local/lib/python2.4/site-packages/dvm_app/$USER\\_$SYSTEM\_brefd01.cfg -sS -rB -l2 -t Iter16_Datatypes_Ext $DEBUG > /tmp/test.log "
|
||||
expect {
|
||||
-re "Traceback" {
|
||||
exec echo "\nTest Failed, Database instance is down\n";
|
||||
exec echo "Test Failed, Database instance is down" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
-re "$" { if { [catch { open "/tmp/test.log" "r"} handle ] } {
|
||||
exec echo "\nTest Failed, /tmp/test.log not found\n";
|
||||
exec echo "Test Failed, /tmp/test.log not found" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
}
|
||||
}
|
||||
exec cat /tmp/test.log >> $RUN_LOG_FILE
|
||||
} else {
|
||||
# default to a test-command of a file name
|
||||
exec su - oracle -c "python /usr/local/lib/python2.4/site-packages/dvm_app/dvm.py -c /usr/local/lib/python2.4/site-packages/dvm_app/$USER\\_$SYSTEM\_brefd01.cfg -e2 -sS -rT $DEBUG -t /home/qa/bldqry/$TESTCOMMAND.txt -q /home/qa/bldqry > /tmp/test.log "
|
||||
expect {
|
||||
-re "Traceback" {
|
||||
exec echo "\nTest Failed, Database instance is down\n";
|
||||
exec echo "Test Failed, Database instance is down" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
-re "$" { if { [catch { open "/tmp/test.log" "r"} handle ] } {
|
||||
exec echo "\nTest Failed, /tmp/test.log not found\n";
|
||||
exec echo "Test Failed, /tmp/test.log not found" >> $RUN_LOG_FILE
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build Tester Results" $EMAIL < $RUN_LOG_FILE] ; exit -1 }
|
||||
}
|
||||
}
|
||||
exec cat /tmp/test.log >> $RUN_LOG_FILE
|
||||
}
|
||||
}
|
||||
} else { # run mysql test commands
|
||||
if { $TESTTYPE == "mysql" } {
|
||||
if { $TESTCOMMAND == "query" } {
|
||||
set timeout 72000
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/runQueryTestAll $SVN" "runQueryTestAll completed" "No such file" $timeout
|
||||
expect {
|
||||
-re "FAILED" { exec echo "\nFailed to run runQueryTestAll\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run runQueryTestAll\n" >> $RUN_LOG_FILE} abort;
|
||||
-re " " { exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/srvswdev11/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE
|
||||
exec rm -f go.log
|
||||
} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "querySSB" } {
|
||||
set timeout 1200
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/startQueryTesterSSB $SVN" "startQueryTester completed" "No such file" 1200
|
||||
expect {
|
||||
-re " " { exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/queryTesterSSB.report"
|
||||
exec cat queryTesterSSB.report >> $RUN_LOG_FILE
|
||||
exec rm -f queryTesterSSB.report
|
||||
} abort;
|
||||
-re "FAILED" { exec echo "\nFailed to run queryTester\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run queryTester\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "concur" } {
|
||||
set timeout 600
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/startConcurTester 32" "Success" "Failed" 600
|
||||
expect {
|
||||
-re " " { exec echo "Concurrance Test Passed\n\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { exec echo "\nConcurrance Test Failed\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nConcurrance Test Timeout\n" >> $RUN_LOG_FILE} abort;
|
||||
timeout { exec echo "\nConcurrance Test Timeout\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "continueousConcur" } {
|
||||
set timeout 30
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/continueousConcurTester" "Started" "Failed" 30
|
||||
expect {
|
||||
-re " " { exec echo "Continueous Concurrance Test Started \n\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { exec echo "\nContinueous Concurrance Test Failed\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nContinueous Concurrance Test Timeout\n" >> $RUN_LOG_FILE} abort;
|
||||
timeout { exec echo "\nContinueous Concurrance Test Timeout\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "queryCalpontOnly" } {
|
||||
set timeout 1200
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/startQueryTesterCalpontOnly $SVN" "startQueryTester completed" "No such file" 1200
|
||||
expect {
|
||||
-re " " { exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/queryTester_working_tpch1_calpontonly.report"
|
||||
exec cat queryTester_working_tpch1_calpontonly.report >> $RUN_LOG_FILE
|
||||
exec rm -f queryTester_working_tpch1_calpontonly.report} abort;
|
||||
-re "FAILED" { exec echo "\nFailed to run queryTester\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run queryTester\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "DBimport" } {
|
||||
set timeout 28800
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/dbImport.sh $SVN" "dbImport completed" "No such file" $timeout
|
||||
expect {
|
||||
-re " " { exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/qaftest2/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE
|
||||
exec rm -f go.log} abort;
|
||||
-re "FAILED" { exec echo "\nFailed to run dbImport\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run dbImport\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
}
|
||||
if { $TESTCOMMAND == "ImportSSB100" } {
|
||||
set timeout 28800
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/importSSB100.sh $SVN" "importSSB100 completed" "No such file" $timeout
|
||||
expect {
|
||||
-re " " {
|
||||
exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/srvalpha2/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE
|
||||
exec rm -f go.log
|
||||
} abort;
|
||||
-re "FAILED" {
|
||||
exec echo "\nFailed to run importSSB100\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run importSSB100\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "dml" } {
|
||||
set timeout 60
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "./nightly/startQueryTesterDML $SVN" "startQueryTester completed" "No such file" 60
|
||||
expect {
|
||||
-re "FAILED" { send_user "FAILED\n"
|
||||
exec echo "\nFailed to run queryTesterDML\n" >> $RUN_LOG_FILE};
|
||||
-re "TIMEOUT" { send_user "TIMEOUT\n"
|
||||
exec echo "\nTimeout on run queryTesterDML\n" >> $RUN_LOG_FILE};
|
||||
-re " " { send_user "PASSED\n"
|
||||
exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/queryTesterDML.report"
|
||||
exec cat queryTesterDML.report >> $RUN_LOG_FILE
|
||||
exec rm -f queryTesterDML.report;
|
||||
};
|
||||
send_user "NOTHING\n"
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "timings" } {
|
||||
set timeout 60
|
||||
log_user 1
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/updateQueries $SVN" "updateQueries completed" "No such file" 60 1
|
||||
set timeout 22000
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/startTimingsTester $SVN" "startTimingsTester completed" "error" 22000 1
|
||||
expect {
|
||||
-re " " {
|
||||
set REPORT demo
|
||||
exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/$REPORT/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { exec echo "\nFailed to run timings\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run timings\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "perfTests" } {
|
||||
set timeout 22000
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/startPerfTests $SVN" "startPerfTests completed" "error" 22000 1
|
||||
expect {
|
||||
-re " " {
|
||||
set REPORT perf
|
||||
exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/$REPORT/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { echo "\nFailed to run timings\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run timings\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "dataWarehouse" } {
|
||||
set timeout 5000000
|
||||
exec ./remote_command_test.sh $SERVER $PASSWORD "/root/nightly/startDataWarehouseTests $SVN" "startDataWarehouseTests completed" "error" 5000000 1
|
||||
expect {
|
||||
-re " " {
|
||||
set REPORT dataWarehouse
|
||||
exec ./remote_scp_get.sh $SERVER $PASSWORD "/root/$SVN/mysql/queries/nightly/$REPORT/go.log"
|
||||
exec cat go.log >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { echo "\nFailed to run dataWarehouse\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on dataWarehouse\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
} elseif { $TESTCOMMAND == "calbench" } {
|
||||
set timeout 22000
|
||||
log_user 1
|
||||
exec ./remote_command.sh $SERVER $PASSWORD "/home/calbench/AutomatedCalBench.sh " "EndAutomatedCalBench" "No such file" 22000 1
|
||||
expect {
|
||||
-re " " { exec echo "\n\nAutomatedCalBench.sh successfully started\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "FAILED" { exec echo "\nFailed to run AutomatedCalBench.sh\n" >> $RUN_LOG_FILE} abort;
|
||||
-re "TIMEOUT" { exec echo "\nTimeout on run AutomatedCalBench.sh\n" >> $RUN_LOG_FILE} abort;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
send_user "Test Failed, Testcase $TESTCASE not supported\n"
|
||||
exec echo "Test Failed, Testcase $TESTCASE not supported" >> $RUN_LOG_FILE
|
||||
}
|
||||
}
|
||||
#get current date
|
||||
exec date >/tmp/datesync.tmp
|
||||
exec cat /tmp/datesync.tmp
|
||||
set newtime [exec cat /tmp/datesync.tmp]
|
||||
exec echo "\n\n******************* Run Test $TESTCASE ended at $newtime **********************************\n\n" >> $RUN_LOG_FILE
|
||||
sleep 10
|
||||
}
|
||||
}
|
||||
set timeout 30
|
||||
|
||||
#get current date
|
||||
exec date >/tmp/datesync.tmp
|
||||
exec cat /tmp/datesync.tmp
|
||||
set newtime [exec cat /tmp/datesync.tmp]
|
||||
|
||||
exec echo "\nBuild Test Successfully Completed $newtime\n\n" >> $RUN_LOG_FILE
|
||||
|
||||
#send report
|
||||
log_user 0
|
||||
if { $EMAIL != " " } {
|
||||
puts [exec mail -s "$SYSTEM/$SVN Automated Build/Test Results" $EMAIL < $RUN_LOG_FILE]
|
||||
send_user "email report sent\n"
|
||||
} else {
|
||||
log_user 1
|
||||
send_user "Report located here: $RUN_LOG_FILE\n"
|
||||
exec cat $RUN_LOG_FILE
|
||||
}
|
||||
|
||||
send_user "\nBuild Test Completed\n"
|
||||
|
||||
exit
|
@ -1,215 +0,0 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/******************************************************************************************
|
||||
* $Id: svnQuery.cpp 64 2006-10-12 22:21:51Z dhill $
|
||||
*
|
||||
*
|
||||
*
|
||||
******************************************************************************************/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
|
||||
#include <iterator>
|
||||
#include <numeric>
|
||||
#include <deque>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <limits.h>
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include "stdio.h"
|
||||
#include "ctype.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "liboamcpp.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace oam;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Oam oam;
|
||||
vector <string> queryDirectory;
|
||||
vector <string> queryID;
|
||||
|
||||
// get latest set of svn queries
|
||||
// system("rm -rf /root/genii/ > /dev/null 2>&1");
|
||||
system("updateGenii.pl > /dev/null 2>&1");
|
||||
|
||||
system("rm -rf /home/qa/bldqry/mysql/* > /dev/null 2>&1");
|
||||
|
||||
string cronFile = "/root/calpontBuildTest";
|
||||
unlink(cronFile.c_str());
|
||||
|
||||
// get query directory list
|
||||
string topQueryfileName = "/tmp/topQuerydirs";
|
||||
string secondQueryfileName = "/tmp/secondQuerydirs";
|
||||
string queryfileName = "/home/qa/bldqry/mysql/querydirs";
|
||||
|
||||
string cmd = "ls /root/genii/mysql/queries/. > " + topQueryfileName;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream file (topQueryfileName.c_str());
|
||||
|
||||
if (!file)
|
||||
{
|
||||
cout << " Error: can't open " + topQueryfileName << endl;
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
char line[200];
|
||||
string topQueryDir;
|
||||
|
||||
while (file.getline(line, 200))
|
||||
{
|
||||
topQueryDir = line;
|
||||
|
||||
if ( topQueryDir.find("queryTester", 0) != string::npos || topQueryDir == "Makefile" )
|
||||
continue;
|
||||
|
||||
// only do working queries for now
|
||||
if ( topQueryDir.find("working", 0) == string::npos)
|
||||
continue;
|
||||
|
||||
string cmd = "ls /root/genii/mysql/queries/" + topQueryDir + "/. > " + secondQueryfileName;
|
||||
system(cmd.c_str());
|
||||
|
||||
ifstream file (secondQueryfileName.c_str());
|
||||
|
||||
if (file)
|
||||
{
|
||||
char line[200];
|
||||
string buf;
|
||||
|
||||
while (file.getline(line, 200))
|
||||
{
|
||||
buf = line;
|
||||
|
||||
if ( buf.empty() )
|
||||
continue;
|
||||
|
||||
string tempdir = topQueryDir + "/" + buf;
|
||||
queryDirectory.push_back(tempdir);
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
if ( queryDirectory.size() == 0 )
|
||||
{
|
||||
cout << endl << "Error: no query sub-directories located" << endl;
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
// get query list for each query directory
|
||||
int test = 1;
|
||||
std::vector<std::string>::iterator pt1 = queryDirectory.begin();
|
||||
|
||||
for ( ; pt1 != queryDirectory.end() ; pt1++)
|
||||
{
|
||||
string directory = *pt1;
|
||||
string::size_type pos = directory.find("/", 0);
|
||||
|
||||
if (pos != string::npos)
|
||||
{
|
||||
string setName;
|
||||
setName = directory.substr(0, pos);
|
||||
setName = setName + "-";
|
||||
setName = setName + directory.substr(pos + 1, 200);
|
||||
|
||||
string cmd = "cd /home/qa/bldqry/mysql/;echo " + setName + ".sql > " + oam.itoa(test) + ".txt";
|
||||
system(cmd.c_str());
|
||||
queryID.push_back(oam.itoa(test));
|
||||
test++;
|
||||
|
||||
cmd = "rm -f /home/qa/bldqry/mysql/" + setName + ".sql";
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "cat /root/genii/mysql/queries/" + directory + "/*.sql >> /home/qa/bldqry/mysql/" + setName + ".sql";
|
||||
system(cmd.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// setup calpontBuildTest cron job with directories
|
||||
string cronFileTemplate = "/root/calpontBuildTest.template";
|
||||
|
||||
ifstream cfile (cronFileTemplate.c_str());
|
||||
|
||||
if (!cfile)
|
||||
{
|
||||
cout << endl << "Error: " + cronFileTemplate + " not found" << endl;
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
vector <string> lines;
|
||||
string newLine;
|
||||
string buf;
|
||||
|
||||
while (cfile.getline(line, 200))
|
||||
{
|
||||
buf = line;
|
||||
string::size_type pos = buf.find("buildTester", 0);
|
||||
|
||||
if (pos != string::npos)
|
||||
{
|
||||
newLine = buf;
|
||||
|
||||
pt1 = queryID.begin();
|
||||
|
||||
for ( ; pt1 != queryID.end() ; pt1++)
|
||||
{
|
||||
newLine.append(" mysql-");
|
||||
newLine.append(*pt1);
|
||||
}
|
||||
|
||||
newLine.append(" mysql-queryTester");
|
||||
|
||||
buf = newLine;
|
||||
}
|
||||
|
||||
//output to temp file
|
||||
lines.push_back(buf);
|
||||
}
|
||||
|
||||
cfile.close();
|
||||
|
||||
ofstream newFile (cronFile.c_str());
|
||||
|
||||
//create new file
|
||||
int fd = open(cronFile.c_str(), O_RDWR | O_CREAT, 0777);
|
||||
|
||||
copy(lines.begin(), lines.end(), ostream_iterator<string>(newFile, "\n"));
|
||||
newFile.close();
|
||||
close(fd);
|
||||
|
||||
cmd = "chmod 777 " + cronFile;
|
||||
system(cmd.c_str());
|
||||
|
||||
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
Creates the stacks table used to track availability / usage of our development stacks.
|
||||
*/
|
||||
|
||||
create database if not exists stacks;
|
||||
use stacks;
|
||||
|
||||
drop table if exists stacks;
|
||||
drop table if exists stacksLog;
|
||||
drop table if exists users;
|
||||
|
||||
CREATE TABLE `stacks` (
|
||||
`stack` varchar(20) DEFAULT NULL,
|
||||
`status` varchar(20) DEFAULT NULL,
|
||||
`user` varchar(20) DEFAULT NULL,
|
||||
`checkedout` datetime DEFAULT NULL,
|
||||
`userModule` varchar(20) DEFAULT NULL,
|
||||
`notes` varchar(200) default null,
|
||||
`version` char(8)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
insert into stacks values
|
||||
('demo', 'Available', null, null, 'srvdemo1', '1 UM x 3 PMs', null),
|
||||
('srvswdev11', 'Available', null, null, 'srvswdev11', '1 UM/PM', null),
|
||||
('qaftest2', 'Available', null, null, 'qaftest2', '1 UM/PM', null),
|
||||
('devint1', 'Available', null, null, 'srvperf7', '2 UM/PMs', null),
|
||||
('devint2', 'Available', null, null, 'srvperf2', '1 UM x 3 PMs (Shared Nothing)', null),
|
||||
('devint3', 'Available', null, null, 'srvperf3', '1 UM/PM (Shared Nothing)', null),
|
||||
('devsn1', 'Available', null, null, 'srvdevsn1', '1 UM x 3 PMs (Shared Nothing)', null),
|
||||
('devsn2', 'Available', null, null, 'srvdevsn5', '1 UM x 2 PMs (Shared Nothing)', null),
|
||||
('devsn3', 'Available', null, null, 'srvdevsn8', '2 UM/PMs (Shared Nothing)', null),
|
||||
('srvalpha2', 'Available', null, null, 'srvalpha2', '1 UM/PM', null),
|
||||
('alphad03', 'Available', null, null, 'srvalpha4', '1 UM x 4 PMs', null),
|
||||
('qperfd01', 'Available', null, null, 'qaftest7', '1 UM X 5 PMs', null),
|
||||
('srvprodtest1', 'Available', null, null, 'srvprodtest1', '1 UM/PM',null, null);
|
||||
|
||||
CREATE TABLE stacksLog (
|
||||
stack varchar(20),
|
||||
user varchar(20),
|
||||
checkedOut datetime,
|
||||
checkedIn datetime,
|
||||
source varchar(20) /* php or commandLine */
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`user` varchar(20) DEFAULT NULL,
|
||||
`mailOnCheckouts` tinyint(1) DEFAULT NULL,
|
||||
`mailOnCheckins` tinyint(1) DEFAULT NULL
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
insert into users values
|
||||
('bpaul', false, false),
|
||||
('chao', false, false),
|
||||
('dcathey', false, false),
|
||||
('dhill', false, false),
|
||||
('pleblanc', false, false),
|
||||
('rdempsey', false, false),
|
||||
('wweeks', false, false),
|
||||
('xlou', false, false),
|
||||
('zzhu', false, false);
|
||||
|
||||
create table testResults (
|
||||
test varchar(20),
|
||||
stack varchar(20),
|
||||
version varchar(10),
|
||||
rel varchar(10),
|
||||
start datetime,
|
||||
stop datetime,
|
||||
buildDtm varchar(30),
|
||||
total int,
|
||||
status varchar(8),
|
||||
failedTests varchar(1000)
|
||||
) engine=MyISAM;
|
@ -1,38 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Automated Nightly Testing Logs</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Automated Nightly Testing Logs</h1>
|
||||
<a href="autoOamRuns.php">Auto OAM Results</a><br>
|
||||
<a href="nightlyResults.php">Nightly Results</a><br>
|
||||
<br>
|
||||
<a href="results.php?title=2.2 Build Results&logFile=/tmp/RHEL5-2.2.log">2.2 Build Results</a><br>
|
||||
<a href="results.php?title=3.0 Build Results&logFile=/tmp/RHEL5-1-3.0.log">3.0 Build Results</a><br>
|
||||
<a href="results.php?title=3.5 Build Results&logFile=/tmp/RHEL5-1-3.5.log">3.5 Build Results</a><br>
|
||||
<a href="results.php?title=3.6 Build Results&logFile=/tmp/RHEL5-3.6.log">3.6 Build Results</a><br>
|
||||
<a href="results.php?title=Trunk (4.0) Build Results&logFile=/tmp/RHEL5-genii.log">Trunk (4.0) Build Results</a><br>
|
||||
<br>
|
||||
<a href="results.php?title=devint3&logFile=/tmp/devint3-3.5.log">3.5 Nightly Regression Test - devint3</a><br>
|
||||
<a href="results.php?title=srvdemo1&logFile=/tmp/demo01-3.5-mysql-timings.log">3.5 Performance Test - demo</a><br>
|
||||
<a href="results.php?title=srvdemo1&logFile=/tmp/demo01-3.5-mysql-query.log">3.5 Nightly Regression Test - demo</a><br>
|
||||
<a href="results.php?title=qaftest7&logFile=/tmp/qperfd01-3.5.log">3.5 Perf Stack Tests - qaftest7 (Mon, Wed, Fri, Sat night builds)</a><br>
|
||||
<br>
|
||||
<a href="results.php?title=srvperf2&logFile=/tmp/devint2-3.6.log">3.6 Nightly Regression Test - devint2</a><br>
|
||||
<a href="results.php?title=srvalpha2&logFile=/tmp/ss2-3.6.log">3.6 Regression Test - srvalpha2</a><br>
|
||||
<a href="results.php?title=srvalpha2&logFile=/tmp/ss2ImportSSB100-3.6.log">3.6 ssb100 Import Validation - srvalpha2</a><br>
|
||||
<a href="results.php?title=qaftest2&logFile=/tmp/qaftest2-3.6-queryTester.log">3.6 Nightly Regression Test - qaftest2</a><br>
|
||||
<a href="results.php?title=qaftest2&logFile=/tmp/qaftest2-3.6-tpch100Import.log">3.6 TPCH Import Test - qaftest2</a><br>
|
||||
<a href="results.php?title=srvbldwin1&logFile=/tmp/srvbldwin1-3.6-queryTester.log">3.6 Windows Regression Test - srvbldwin1</a><br>
|
||||
<br>
|
||||
<a href="results.php?title=srvswdev11&logFile=/tmp/srvswdev11-genii.log">Trunk (4.0) Nightly Regression Test - srvswdev11</a><br>
|
||||
<a href="results.php?title=srvalpha4&logFile=/tmp/srvalpha4-genii.log">Trunk (4.0) Nightly Regression Test - srvalpha4 (Cloudera)</a><br>
|
||||
<a href="results.php?title=devint1&logFile=/tmp/devint1-genii.log">Trunk (4.0) Nightly Regression Test - devint1 (Cloudera)</a><br>
|
||||
<a href="results.php?title=devint1Ssb100&logFile=/tmp/devint1-importSSB100-genii.log">Trunk (4.0) ssb100 Import Validation - devint1 (Cloudera)</a><br>
|
||||
<a href="results.php?title=qaftest7&logFile=/tmp/qperfd01-genii-perfTests.log">Trunk (4.0) Perf Stack Tests - qaftest7 (Sun, Tue, Thu, Fri, Sat night builds)</a><br>
|
||||
<a href="results.php?title=qaftest7&logFile=/tmp/qperfd01-genii-queryTester.log">Trunk (4.0) Nightly Regression Test - qaftest7</a><br>
|
||||
<a href="results.php?title=srvdemo1&logFile=/tmp/demo01-genii-mysql-timings.log">Trunk Performance Test - demo (Sat, Sun)</a><br>
|
||||
<a href="results.php?title=qaftest2&logFile=/tmp/qaftest2-genii-tpch100Import.log">Trunk TPCH Import Test - qaftest2</a><br>
|
||||
<a href="results.php?title=srvbldwin1&logFile=/tmp/srvbldwin1-genii-queryTester.log">Trunk (4.0) Windows Regression Test - srvbldwin1</a><br>
|
||||
</body>
|
||||
</html>
|
@ -1,184 +0,0 @@
|
||||
/*
|
||||
Creates stored procedures used to track availability and usage of our development stacks.
|
||||
*/
|
||||
|
||||
use stacks;
|
||||
|
||||
drop procedure if exists list_stacks;
|
||||
drop procedure if exists list_users;
|
||||
drop procedure if exists reserve_stack;
|
||||
drop procedure if exists reserve_stack2;
|
||||
drop procedure if exists release_stack;
|
||||
drop procedure if exists subscribe_checkins;
|
||||
drop procedure if exists subscribe_checkouts;
|
||||
|
||||
DELIMITER //
|
||||
|
||||
/* Lists the stacks and their availability. */
|
||||
create procedure list_stacks()
|
||||
begin
|
||||
select stack as Stack,
|
||||
userModule as 'User Module',
|
||||
status as Status,
|
||||
ifnull(user, '') User,
|
||||
ifnull(checkedout, '') 'Checked Out',
|
||||
ifnull(timediff(now(), checkedout), '') Time,
|
||||
ifnull(notes, '') Notes,
|
||||
version Version
|
||||
from stacks
|
||||
order by stack;
|
||||
end //
|
||||
|
||||
/* Lists the users. */
|
||||
create procedure list_users()
|
||||
begin
|
||||
select * from users order by 1;
|
||||
end //
|
||||
|
||||
create procedure reserve_stack(in inStack varchar(20), in inUser varchar(20))
|
||||
begin
|
||||
call reserve_stack2(inStack, inUser, 'commandLine');
|
||||
end //
|
||||
|
||||
/* Reserves the given stack on behalf of the given user. */
|
||||
create procedure reserve_stack2(in inStack varchar(20), in inUser varchar(20), in inSource varchar(20))
|
||||
begin
|
||||
declare cnt int default 0;
|
||||
declare err varchar(100) default '';
|
||||
|
||||
/* Validate the stack exists. */
|
||||
select count(*) into cnt from stacks where upper(stack) = upper(inStack);
|
||||
if cnt <> 1 then
|
||||
set err = concat(inStack, ' is not a valid stack.');
|
||||
end if;
|
||||
|
||||
/* Validate that the stack is not already checked out unless the user is nightly in which case he gets it regardless of it */
|
||||
/* being checked out. */
|
||||
if lower(inUser) <> 'nightly' and err = '' then
|
||||
select count(*) into cnt from stacks where status='Available' and upper(stack) = upper(inStack);
|
||||
if cnt <> 1 then
|
||||
set err = concat(inStack, ' is not available.');
|
||||
end if;
|
||||
end if;
|
||||
|
||||
/* Do the check out. */
|
||||
if err = '' then
|
||||
|
||||
update stacks
|
||||
set status='Checked Out', user=inUser, checkedout=now()
|
||||
where upper(stack)=upper(inStack) and (status='Available' or lower(inUser)='nightly');
|
||||
|
||||
insert into stacksLog values (inStack, inUser, now(), null, inSource);
|
||||
|
||||
end if;
|
||||
|
||||
if err <> '' then
|
||||
select err Status;
|
||||
else
|
||||
select concat(inStack, ' successfully checked out by ', inUser, '.') Status;
|
||||
end if;
|
||||
end //
|
||||
|
||||
/* Releases the given stack. Requires the passed user to be the one holding the reservation. */
|
||||
create procedure release_stack(in inStack varchar(20), in inUser varchar(20))
|
||||
begin
|
||||
declare cnt int default 0;
|
||||
declare err varchar(100) default '';
|
||||
|
||||
/* Validate the stack exists. */
|
||||
select count(*) into cnt from stacks where upper(stack) = upper(inStack);
|
||||
if cnt <> 1 then
|
||||
set err = concat(inStack, ' is not a valid stack.');
|
||||
end if;
|
||||
|
||||
/* Validate that the stack is checked out by the user. */
|
||||
if err = '' then
|
||||
select count(*) into cnt
|
||||
from stacks
|
||||
where status='Checked Out' and upper(stack) = upper(inStack) and upper(user) = upper(inUser);
|
||||
|
||||
if cnt <> 1 then
|
||||
set err = concat(inStack, ' is not checked out by ', inUser, '.');
|
||||
end if;
|
||||
end if;
|
||||
|
||||
/* Update the row to release_stack the stack. */
|
||||
if err = '' then
|
||||
update stacks
|
||||
set status='Available', user=null, checkedout=null
|
||||
where upper(stack)=upper(inStack);
|
||||
|
||||
update stacksLog
|
||||
set checkedIn=now()
|
||||
where upper(stack) = upper(inStack) and checkedIn is null and upper(user) = upper(inUser);
|
||||
end if;
|
||||
|
||||
if err <> '' then
|
||||
select err Status;
|
||||
else
|
||||
select concat(inStack, ' successfully released.') Status;
|
||||
end if;
|
||||
end //
|
||||
|
||||
create procedure subscribe_checkins(in inUser varchar(20), in inSubscribe bool)
|
||||
begin
|
||||
declare cnt int default 0;
|
||||
declare err varchar(100) default '';
|
||||
|
||||
/* Validate user. */
|
||||
select count(*) into cnt from users where upper(user)=upper(inUser);
|
||||
if cnt <> 1 then
|
||||
set err = concat(inUser, ' is not a valid user.');
|
||||
end if;
|
||||
|
||||
if err = '' then
|
||||
if inSubscribe then
|
||||
update users
|
||||
set mailOnCheckins = true
|
||||
where upper(user) = upper(inUser);
|
||||
else
|
||||
update users
|
||||
set mailOnCheckins = false
|
||||
where upper(user) = upper(inUser);
|
||||
end if;
|
||||
end if;
|
||||
|
||||
if err <> '' then
|
||||
select err Status;
|
||||
else
|
||||
select concat(inUser, ' checkin mail setting successfully set.') Status;
|
||||
end if;
|
||||
end //
|
||||
|
||||
create procedure subscribe_checkouts(in inUser varchar(20), in inSubscribe bool)
|
||||
begin
|
||||
declare cnt int default 0;
|
||||
declare err varchar(100) default '';
|
||||
|
||||
/* Validate user. */
|
||||
select count(*) into cnt from users where upper(user)=upper(inUser);
|
||||
if cnt < 1 then
|
||||
set err = concat(inUser, ' is not a valid user.');
|
||||
end if;
|
||||
|
||||
if err = '' then
|
||||
if inSubscribe then
|
||||
update users
|
||||
set mailOnCheckouts = true
|
||||
where upper(user) = upper(inUser);
|
||||
else
|
||||
update users
|
||||
set mailOnCheckouts= false
|
||||
where upper(user) = upper(inUser);
|
||||
end if;
|
||||
end if;
|
||||
|
||||
if err <> '' then
|
||||
select err Status;
|
||||
else
|
||||
select concat(inUser, ' checkout mail setting successfully set.') Status;
|
||||
end if;
|
||||
end //
|
||||
|
||||
DELIMITER ;
|
||||
|
@ -1,21 +0,0 @@
|
||||
<html>
|
||||
<head><title><?php echo $_GET["title"]; ?></title></head>
|
||||
<body>
|
||||
<?php
|
||||
echo "<pre>\n";
|
||||
$file = fopen($_GET["logFile"], "r") or exit("Unable to open file!");
|
||||
//Output a line of the file until the end is reached
|
||||
while(!feof($file))
|
||||
{
|
||||
$line = fgets($file);
|
||||
if (!preg_match('/ Failed *= 0/', $line))
|
||||
$line = preg_replace('/ Failed/', ' <font color="red"><b>Failed</b></font>', $line);
|
||||
$line = preg_replace('/ Passed/', ' <font color="green"><b>Passed</b></font>', $line);
|
||||
$line = preg_replace('/ Yellow/', ' <font color="yellow"><b>Yellow</b></font>', $line);
|
||||
echo $line;
|
||||
}
|
||||
fclose($file);
|
||||
echo "</pre>\n";
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -1,82 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# BP 09/16/2011 13:43
|
||||
# This script will give user to
|
||||
# list all the calpont stacks
|
||||
# reserve a calpont stack
|
||||
# release a calpont stack
|
||||
# Help to use a test stack without stepping each other.
|
||||
#
|
||||
|
||||
DB=stacks
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage:" >&2
|
||||
echo " ${0##*/} list" >&2
|
||||
echo " ${0##*/} reserve stackname who" >&2
|
||||
echo " ${0##*/} release stackname who" >&2
|
||||
}
|
||||
|
||||
cmd="$1"
|
||||
argc=$#
|
||||
|
||||
if [ -z "$cmd" -o "$cmd" = "-h" ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $(expr 'list' : "$cmd") -gt 0 ]; then
|
||||
cmd=list
|
||||
INST=$2
|
||||
elif [ $(expr 'reserve' : "$cmd") -gt 2 ]; then
|
||||
cmd=reserve
|
||||
INST=$4
|
||||
elif [ $(expr 'release' : "$cmd") -gt 2 ]; then
|
||||
cmd=release
|
||||
INST=$4
|
||||
fi
|
||||
if [ -z "$INSTALLDIR" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
if [ $INST ]; then
|
||||
INSTALLDIR=$INST
|
||||
fi
|
||||
export INSTALLDIR
|
||||
fi
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
if [ -d "$INSTALLDIR/mysql" ]; then
|
||||
# Linux.
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql -h 10.100.4.51 -u root --database=$DB"
|
||||
else
|
||||
# Windows.
|
||||
MYSQLCMD="$INSTALLDIR/bin/mysql -h 10.100.4.51 -u root --database=$DB"
|
||||
fi
|
||||
export MYSQLCMD
|
||||
fi
|
||||
|
||||
good=0
|
||||
|
||||
if [ "$cmd" = "list" ]; then
|
||||
sql="call list_stacks()"
|
||||
$MYSQLCMD -e "$sql"
|
||||
good=1
|
||||
fi
|
||||
|
||||
if [ "$cmd" = "reserve" -a $argc -ge 3 ]; then
|
||||
sql="call reserve_stack('$2', '$3')"
|
||||
$MYSQLCMD -e "$sql"
|
||||
good=1
|
||||
fi
|
||||
|
||||
if [ "$cmd" = "release" -a $argc -ge 3 ]; then
|
||||
sql="call release_stack('$2', '$3')"
|
||||
$MYSQLCMD -e "$sql"
|
||||
good=1
|
||||
fi
|
||||
|
||||
if [ $good -eq 0 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
@ -1,106 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="60" >
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
|
||||
header('Pragma: no-cache'); // HTTP 1.0.
|
||||
header('Expires: 0'); // Proxies.
|
||||
$con = mysql_connect('localhost','root','',false,65536);
|
||||
|
||||
mysql_select_db ("stacks");
|
||||
|
||||
$query="call list_stacks()";
|
||||
/* $result=mysql_query("call list_stacks()"); */
|
||||
$result=mysql_query($query)
|
||||
or die(mysql_error());
|
||||
|
||||
$num=mysql_numrows($result);
|
||||
|
||||
mysql_close();
|
||||
?>
|
||||
User: <input id="userInput" value="<?php echo $_GET["user"]; ?>" /> <button onClick="javascript:refresh();">Refresh</button>
|
||||
<form action="stackReservationResult.php" method="post" id="form1">
|
||||
<input type="hidden" name="stack" id="stack" value=""/>
|
||||
<input type="hidden" name="action" id="action" value=""/>
|
||||
<input type="hidden" name="user" id="user" value="<?php echo $_GET["user"]; ?>"/>
|
||||
<br>
|
||||
<table border="1" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif"> </font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif"> </font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Stack</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">User Module</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Status</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">User</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Checked Out</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Time</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Stack Notes</font></th>
|
||||
<th align=left><font face="Arial, Helvetica, sans-serif">Version</font></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$i=0;
|
||||
while ($i < $num) {
|
||||
|
||||
$f3=mysql_result($result,$i,"stack");
|
||||
$f4=mysql_result($result,$i,"user module");
|
||||
$f5=mysql_result($result,$i,"status");
|
||||
$f6=mysql_result($result,$i,"user");
|
||||
$f7=mysql_result($result,$i,"checked out");
|
||||
$f8=mysql_result($result,$i,"time");
|
||||
$f9=mysql_result($result,$i,"notes");
|
||||
$f10=mysql_result($result,$i,"version");
|
||||
|
||||
if($f5 == "Available") {
|
||||
$f1 = "Reserve";
|
||||
$f2 = "";
|
||||
}
|
||||
else if($f5 == "Checked Out" && $f6 == $_GET["user"]) {
|
||||
$f1 = "";
|
||||
$f2 = "Release";
|
||||
}
|
||||
else {
|
||||
$f1="";
|
||||
$f2="";
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function submitForm(action, stack)
|
||||
{
|
||||
document.getElementById('stack').value=stack;
|
||||
document.getElementById('action').value=action;
|
||||
document.getElementById('user').value=document.getElementById('userInput').value;
|
||||
document.getElementById('form1').submit();
|
||||
}
|
||||
|
||||
function refresh()
|
||||
{
|
||||
window.location='stack.php?user=' + document.getElementById('userInput').value;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><a href="javascript:submitForm('reserve', '<?php echo $f3; ?>');"><?php echo $f1; ?></a> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><a href="javascript:submitForm('release', '<?php echo $f3; ?>');"><?php echo $f2; ?></a> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f8; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f9; ?> </font></td>
|
||||
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f10; ?> </font></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -1,45 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
|
||||
header('Pragma: no-cache'); // HTTP 1.0.
|
||||
header('Expires: 0'); // Proxies.
|
||||
$con = mysql_connect('localhost','root','',false,65536);
|
||||
|
||||
mysql_select_db ("stacks");
|
||||
|
||||
/*
|
||||
Reserve or release the stack if the user clicked a link to do said reservation wherefore art thou.
|
||||
*/
|
||||
$stack=$_POST["stack"];
|
||||
$action=$_POST["action"];
|
||||
$who=$_POST["user"];
|
||||
if($stack != "" && $who != "") {
|
||||
if($action=="reserve") {
|
||||
$query="call reserve_stack2('" . $stack . "', '". $who . "', 'php');";
|
||||
}
|
||||
else {
|
||||
$query="call release_stack('" . $stack . "', '". $who . "');";
|
||||
}
|
||||
$result = mysql_query($query) or die(mysql_error());
|
||||
if($result) {
|
||||
$line = mysql_result($result,0,"status");
|
||||
if (stripos($line, 'not')) {
|
||||
echo '<b><font color="red">';
|
||||
}
|
||||
else {
|
||||
echo '<b><font color="green">';
|
||||
}
|
||||
echo $line;
|
||||
echo '</font></b><br><br>';
|
||||
}
|
||||
}
|
||||
mysql_close();
|
||||
echo '<a href="stack.php?user=' . $who . '">Return to Stacks</a>';
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -17,8 +17,8 @@ export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
InstallDir=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $InstallDir != "/usr/local/mariadb/columnstore" ]; then
|
||||
export PATH=$InstallDir/bin:$InstallDir/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$InstallDir/lib:$InstallDir/mysql/lib
|
||||
export PATH=$InstallDir/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$InstallDir/lib
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
@ -1,6 +0,0 @@
|
||||
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">
|
||||
<Workspace Version="10.0" VendorName="SlickEdit">
|
||||
<Projects>
|
||||
<Project File="tp.vpj"/>
|
||||
</Projects>
|
||||
</Workspace>
|
@ -22,5 +22,5 @@ add_library(udf_mysql SHARED ${udf_mysql_LIB_SRCS})
|
||||
|
||||
set_target_properties(udf_mysql PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS udf_mysql DESTINATION ${ENGINE_LIBDIR} COMPONENT storage-engine)
|
||||
install(TARGETS udf_mysql DESTINATION ${MARIADB_PLUGINDIR} COMPONENT storage-engine)
|
||||
|
||||
|
Reference in New Issue
Block a user