You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Merge branch 'develop' into MCOL-1793
This commit is contained in:
4
README
4
README
@ -1,5 +1,5 @@
|
||||
This is MariaDB ColumnStore 1.2.0
|
||||
MariaDB ColumnStore 1.2.0 is the development version of MariaDB ColumnStore.
|
||||
This is MariaDB ColumnStore 1.2
|
||||
MariaDB ColumnStore 1.2 is the development version of MariaDB ColumnStore.
|
||||
It is built by porting InfiniDB 4.6.7 on MariaDB 10.2 and adding entirely
|
||||
new features not found anywhere else.
|
||||
|
||||
|
2
VERSION
2
VERSION
@ -1,4 +1,4 @@
|
||||
COLUMNSTORE_VERSION_MAJOR=1
|
||||
COLUMNSTORE_VERSION_MINOR=2
|
||||
COLUMNSTORE_VERSION_PATCH=1
|
||||
COLUMNSTORE_VERSION_PATCH=2
|
||||
COLUMNSTORE_VERSION_RELEASE=1
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
NO_NONROOT_SUDO=yes
|
||||
export NO_NONROOT_SUDO
|
||||
prefix=/usr/local
|
||||
builddir=
|
||||
for arg in "$@"; do
|
||||
|
@ -26,10 +26,10 @@ ENDIF()
|
||||
SET(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}-${ENGINE_ARCH}")
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB Columnstore: a very fast and robust SQL database server")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_PACKAGE_URL "http://mariadb.org")
|
||||
SET(CPACK_PACKAGE_CONTACT "MariaDB Corporation Ab")
|
||||
SET(CPACK_PACKAGE_SUMMARY "MariaDB-Columnstore software")
|
||||
SET(CPACK_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_PACKAGE_VENDOR "MariaDB Corporation Ab")
|
||||
SET(CPACK_PACKAGE_LICENSE "Copyright (c) 2016 MariaDB Corporation Ab., all rights reserved; redistributable under the terms of the GPL, see the file COPYING for details.")
|
||||
|
||||
@ -45,13 +45,13 @@ SET(CPACK_DEBIAN_PACKAGE_LICENSE ${CPACK_PACKAGE_LICENSE})
|
||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DESCRIPTION "MariaDB-Columnstore binary files")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_SUMMARY "MariaDB-Columnstore software binaries")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
|
||||
SET(CPACK_DEBIAN_LIBS_PACKAGE_DESCRIPTION "MariaDB-Columnstore libraries")
|
||||
SET(CPACK_DEBIAN_LIBS_PACKAGE_SUMMARY "MariaDB-Columnstore software libraries")
|
||||
SET(CPACK_DEBIAN_LIBS_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
|
||||
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DESCRIPTION "MariaDB Columnstore connector binary files")
|
||||
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_SUMMARY "MariaDB-Columnstore software MariaDB connector")
|
||||
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
|
||||
|
||||
SET(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "mariadb-columnstore-libs")
|
||||
@ -65,11 +65,11 @@ if (EXISTS "/etc/debian_version")
|
||||
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||
endif ()
|
||||
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1")
|
||||
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5")
|
||||
else()
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, sudo, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools")
|
||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools")
|
||||
endif ()
|
||||
|
||||
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs")
|
||||
|
@ -23,10 +23,10 @@ ENDIF()
|
||||
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${ENGINE_ARCH}-${RPM}")
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB Columnstore: a very fast and robust SQL database server")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_PACKAGE_URL "http://mariadb.org")
|
||||
|
||||
SET(CPACK_PACKAGE_SUMMARY "MariaDB-Columnstore software")
|
||||
SET(CPACK_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_PACKAGE_VENDOR "MariaDB Corporation Ab")
|
||||
SET(CPACK_PACKAGE_LICENSE "Copyright (c) 2016 MariaDB Corporation Ab., all rights reserved; redistributable under the terms of the GPL, see the file COPYING for details.")
|
||||
|
||||
@ -51,14 +51,14 @@ MariaDB bug reports should be submitted through https://jira.mariadb.org
|
||||
")
|
||||
|
||||
SET(CPACK_RPM_platform_PACKAGE_DESCRIPTION "MariaDB-Columnstore binary files")
|
||||
SET(CPACK_RPM_platform_PACKAGE_SUMMARY "MariaDB-Columnstore software binaries")
|
||||
SET(CPACK_RPM_platform_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_RPM_platform_PACKAGE_GROUP "Applications")
|
||||
|
||||
SET(CPACK_RPM_libs_PACKAGE_DESCRIPTION "MariaDB-Columnstore libraries")
|
||||
SET(CPACK_RPM_libs_PACKAGE_SUMMARY "MariaDB-Columnstore software libraries")
|
||||
SET(CPACK_RPM_libs_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_DESCRIPTION "MariaDB Columnstore connector binary files")
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_SUMMARY "MariaDB-Columnstore software MariaDB connector")
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_SUMMARY "MariaDB ColumnStore: A Scale out Columnar storage engine for MariaDB")
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_GROUP "Applications")
|
||||
|
||||
# "set/append array" - append a set of strings, separated by a space
|
||||
@ -132,7 +132,6 @@ SET(CPACK_RPM_platform_USER_FILELIST
|
||||
"/usr/local/mariadb/columnstore/bin/post-mysqld-install"
|
||||
"/usr/local/mariadb/columnstore/bin/pre-uninstall"
|
||||
"/usr/local/mariadb/columnstore/bin/PrimProc"
|
||||
"/usr/local/mariadb/columnstore/bin/upgrade-columnstore.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/run.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstore"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreSyslog"
|
||||
|
@ -66,6 +66,8 @@ using namespace logging;
|
||||
#include "rowgroup.h"
|
||||
using namespace rowgroup;
|
||||
|
||||
#include "installdir.h"
|
||||
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/version.hpp>
|
||||
@ -92,7 +94,8 @@ throw runtime_error("CALPONT_INTERNAL_ERROR"); \
|
||||
#if CSC_DEBUG
|
||||
namespace
|
||||
{
|
||||
std::ofstream csclog("/tmp/csc.log", std::ios::app);
|
||||
string tmpDir = startup::StartUp::tmpDir() + "/csc.log";
|
||||
std::ofstream csclog(tmpDir, std::ios::app);
|
||||
}
|
||||
#define DEBUG csclog
|
||||
#else
|
||||
|
@ -55,7 +55,7 @@ namespace execplan
|
||||
* default value is 1000.
|
||||
* SessionManager/SharedMemoryTmpFile: the file to store the shared memory segment
|
||||
* data in between invocations if DESTROYSHMSEG is defined below. The
|
||||
* default is /tmp/CalpontShm.
|
||||
* default is /tmp/ColumnstoreShm.
|
||||
* SessionManager/TxnIDFile: the file to store the last transaction ID issued
|
||||
*/
|
||||
|
||||
|
@ -54,6 +54,9 @@ using namespace messageqcpp;
|
||||
|
||||
using namespace BRM;
|
||||
|
||||
#include "installdir.h"
|
||||
|
||||
|
||||
namespace execplan
|
||||
{
|
||||
|
||||
@ -102,7 +105,11 @@ SessionMonitor::SessionMonitor()
|
||||
if (stmp != "")
|
||||
fSegmentFilename = strdup(stmp.c_str());
|
||||
else
|
||||
fSegmentFilename = strdup("/tmp/CalpontSessionMonitorShm");
|
||||
{
|
||||
string tmpdir = startup::StartUp::installDir() + "CalpontSessionMonitorShm";
|
||||
|
||||
fSegmentFilename = strdup(tmpdir);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -32,10 +32,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <boost/interprocess/shared_memory_object.hpp>
|
||||
#include <boost/interprocess/mapped_region.hpp>
|
||||
#include <boost/interprocess/sync/interprocess_semaphore.hpp>
|
||||
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "sessionmanager.h"
|
||||
#include "shmkeys.h"
|
||||
@ -58,7 +54,6 @@ namespace execplan
|
||||
* SessionMonitor/SharedMemoryTmpFile: the file to store the shared memory segment
|
||||
* data in. This needs to be a different file than
|
||||
* file used for the SessionManager/SharedMemoryTmpFile.
|
||||
* The default is /tmp/CalpontMonShm.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -286,6 +286,7 @@ void ExpressionStep::addColumn(ReturnedColumn* rc, JobInfo& jobInfo)
|
||||
scs = &(fc->simpleColumnList());
|
||||
wcs = &(fc->windowfunctionColumnList());
|
||||
fVarBinOK = ((strcmp(fc->functionName().c_str(), "hex") == 0) ||
|
||||
(strcmp(fc->functionName().c_str(), "octet_length") == 0) ||
|
||||
(strcmp(fc->functionName().c_str(), "length") == 0));
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,6 @@ template<typename container_t, typename element_t>
|
||||
LargeDataList<container_t, element_t>::LargeDataList(uint32_t nc, uint32_t elementSaveSize1st, uint32_t elementSaveSize2nd, const ResourceManager* rm):
|
||||
base(nc), path(rm.getScTempDiskPath()), fTraceOn(false), fReUse(false), fSaveForReuse(false), fRestoreInfo(NULL)
|
||||
{
|
||||
// config::Config *config = config::Config::makeConfig();
|
||||
|
||||
loadedSet = 0;
|
||||
setCount = 1;
|
||||
@ -214,14 +213,6 @@ LargeDataList<container_t, element_t>::LargeDataList(uint32_t nc, uint32_t eleme
|
||||
multipleProducers = false;
|
||||
fLoadedSetCount = 0;
|
||||
setDiskElemSize ( elementSaveSize1st, elementSaveSize2nd );
|
||||
// try {
|
||||
// path = config->getConfig("SystemConfig", "TempDiskPath");
|
||||
// }
|
||||
// catch (...) {
|
||||
// }
|
||||
// if (path.length() == 0)
|
||||
// path = defaultTempDiskPath;
|
||||
//pthread_cond_init(&consumePhase, NULL);
|
||||
}
|
||||
|
||||
template<typename container_t, typename element_t>
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "configcpp.h"
|
||||
#include "calpontselectexecutionplan.h"
|
||||
#include "resourcedistributor.h"
|
||||
#include "installdir.h"
|
||||
|
||||
#include "atomicops.h"
|
||||
|
||||
@ -82,7 +83,7 @@ const uint32_t defaultProcessorThreadsPerScan = 16;
|
||||
const uint32_t defaultJoinerChunkSize = 16 * 1024 * 1024;
|
||||
|
||||
//bucketreuse
|
||||
const std::string defaultTempDiskPath = "/var/tmp";
|
||||
const std::string defaultTempDiskPath = "/tmp";
|
||||
const std::string defaultWorkingDir = "."; //"/tmp";
|
||||
|
||||
//largedatalist
|
||||
@ -282,7 +283,7 @@ public:
|
||||
|
||||
std::string getScTempDiskPath() const
|
||||
{
|
||||
return getStringVal(fSystemConfigStr, "TempDiskPath", defaultTempDiskPath );
|
||||
return startup::StartUp::tmpDir();
|
||||
}
|
||||
uint64_t getScTempSaveSize() const
|
||||
{
|
||||
@ -290,7 +291,7 @@ public:
|
||||
}
|
||||
std::string getScWorkingDir() const
|
||||
{
|
||||
return getStringVal(fSystemConfigStr, "WorkingDir", defaultWorkingDir );
|
||||
return startup::StartUp::tmpDir();
|
||||
}
|
||||
|
||||
uint32_t getTwMaxSize() const
|
||||
|
@ -1139,10 +1139,76 @@ static MYSQL_SYSVAR_ULONG(
|
||||
0);
|
||||
#endif
|
||||
|
||||
/*@brief check_walk - It traverses filter conditions*/
|
||||
/************************************************************
|
||||
* DESCRIPTION:
|
||||
* It traverses filter predicates looking for unsupported
|
||||
* JOIN types: non-equi JOIN, e.g t1.c1 > t2.c2;
|
||||
* logical OR.
|
||||
* PARAMETERS:
|
||||
* thd - THD pointer.
|
||||
* derived - TABLE_LIST* to work with.
|
||||
* RETURN:
|
||||
* derived_handler if possible
|
||||
* NULL in other case
|
||||
***********************************************************/
|
||||
void check_walk(const Item* item, void* arg)
|
||||
{
|
||||
bool* unsupported_feature = static_cast<bool*>(arg);
|
||||
if ( *unsupported_feature )
|
||||
return;
|
||||
switch (item->type())
|
||||
{
|
||||
case Item::FUNC_ITEM:
|
||||
{
|
||||
Item_func* ifp = (Item_func*)item;
|
||||
|
||||
if ( ifp->functype() != Item_func::EQ_FUNC )
|
||||
{
|
||||
if ( ifp->argument_count() == 2 &&
|
||||
ifp->arguments()[0]->type() == Item::FIELD_ITEM &&
|
||||
ifp->arguments()[1]->type() == Item::FIELD_ITEM )
|
||||
{
|
||||
Item_field* left= static_cast<Item_field*>(ifp->arguments()[0]);
|
||||
Item_field* right= static_cast<Item_field*>(ifp->arguments()[1]);
|
||||
|
||||
if ( left->field->table != right->field->table )
|
||||
{
|
||||
*unsupported_feature = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Item::COND_ITEM:
|
||||
{
|
||||
Item_cond* icp = (Item_cond*)item;
|
||||
if ( is_cond_or(icp) )
|
||||
{
|
||||
*unsupported_feature = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
|
||||
/*@brief create_calpont_group_by_handler- Creates handler*/
|
||||
/***********************************************************
|
||||
* DESCRIPTION:
|
||||
* Creates a group_by pushdown handler.
|
||||
* Creates a group_by pushdown handler if there is no:
|
||||
* non-equi JOIN, e.g * t1.c1 > t2.c2
|
||||
* logical OR in the filter predicates
|
||||
* Impossible WHERE
|
||||
* Impossible HAVING
|
||||
* Valid queries with the last two crashes the server if processed.
|
||||
* Details are in server/sql/group_by_handler.h
|
||||
* PARAMETERS:
|
||||
* thd - THD pointer.
|
||||
@ -1155,12 +1221,40 @@ static group_by_handler*
|
||||
create_calpont_group_by_handler(THD* thd, Query* query)
|
||||
{
|
||||
ha_calpont_group_by_handler* handler = NULL;
|
||||
LEX* lex = thd->lex;
|
||||
SELECT_LEX *select_lex = &lex->select_lex;
|
||||
|
||||
// Create a handler if there is an agregate or a GROUP BY
|
||||
// and if vtable was explicitly disabled.
|
||||
// Create a handler if query is valid. See comments for details.
|
||||
if ( thd->infinidb_vtable.vtable_state == THD::INFINIDB_DISABLE_VTABLE
|
||||
&& thd->variables.infinidb_vtable_mode == 0
|
||||
&& ( query->group_by || thd->lex->select_lex.with_sum_func) )
|
||||
&& ( thd->variables.infinidb_vtable_mode == 0
|
||||
|| thd->variables.infinidb_vtable_mode == 2 )
|
||||
&& ( query->group_by || thd->lex->select_lex.with_sum_func ) )
|
||||
{
|
||||
bool unsupported_feature = false;
|
||||
// Impossible HAVING or WHERE
|
||||
if ( ( select_lex->having && select_lex->having_value == Item::COND_FALSE )
|
||||
|| ( select_lex->cond_value && select_lex->cond_value == Item::COND_FALSE ) )
|
||||
{
|
||||
unsupported_feature = true;
|
||||
}
|
||||
|
||||
// Unsupported JOIN conditions check.
|
||||
if ( !unsupported_feature )
|
||||
{
|
||||
JOIN *join = select_lex->join;
|
||||
Item_cond *icp = 0;
|
||||
|
||||
if (join != 0)
|
||||
icp = reinterpret_cast<Item_cond*>(join->conds);
|
||||
|
||||
if ( unsupported_feature == false
|
||||
&& join->table_count > 1 && icp )
|
||||
{
|
||||
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !unsupported_feature )
|
||||
{
|
||||
handler = new ha_calpont_group_by_handler(thd, query);
|
||||
|
||||
@ -1169,6 +1263,9 @@ create_calpont_group_by_handler(THD* thd, Query* query)
|
||||
query->order_by = NULL;
|
||||
query->having = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "create_calpont_group_by_handler handler " << handler << std::endl;
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
@ -1887,6 +1887,7 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Fails with `/` sign in table name
|
||||
pair<string, string> parseTableName(const string& tn)
|
||||
{
|
||||
string db;
|
||||
@ -2342,6 +2343,58 @@ int ha_calpont_impl_delete_table_(const char* db, const char* name, cal_connecti
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief
|
||||
Find and return a pointer to the last slash in the name.
|
||||
|
||||
@details
|
||||
This f() finds and returns position of the last slash sign found in
|
||||
the path or NULL.
|
||||
|
||||
Called from ha_calpont_ddl.cpp by decode_table_name().
|
||||
*/
|
||||
const char* last_slash_pos(const char *name, size_t name_len)
|
||||
{
|
||||
#ifdef MCS_DEBUG
|
||||
cout << "Entering last_slash_pos()" << endl;
|
||||
#endif
|
||||
const char *slash_pos = name + name_len - 1;
|
||||
while ( *slash_pos != '/' && slash_pos != name )
|
||||
slash_pos--;
|
||||
|
||||
return ( slash_pos != name ) ? slash_pos : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief
|
||||
Decodes the table name.
|
||||
|
||||
@details
|
||||
Replaces the encoded table name in the path with a decoded variant,
|
||||
e.g if path contains ./test/d@0024. This f() makes it ./test/d$
|
||||
|
||||
Called from ha_calpont_ddl.cpp by ha_calpont_impl_rename_table_().
|
||||
*/
|
||||
void decode_table_name(char *buf, const char *path, size_t pathLen)
|
||||
{
|
||||
#ifdef MCS_DEBUG
|
||||
cout << "Entering decode_table_name()" << endl;
|
||||
#endif
|
||||
strncpy(buf, path, pathLen);
|
||||
|
||||
const char *lastSlashPos = last_slash_pos(path, pathLen);
|
||||
if ( lastSlashPos )
|
||||
{
|
||||
size_t prefixLen = ( lastSlashPos - path ) / sizeof(*path);
|
||||
size_t tableLen = strlen(lastSlashPos + 1);
|
||||
char tblBuf[FN_REFLEN];
|
||||
(void) filename_to_tablename(lastSlashPos + 1, tblBuf, sizeof(tblBuf));
|
||||
|
||||
strncpy(buf + ( pathLen - tableLen ), tblBuf, tableLen);
|
||||
buf[prefixLen + tableLen + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
int ha_calpont_impl_rename_table_(const char* from, const char* to, cal_connection_info& ci)
|
||||
{
|
||||
THD* thd = current_thd;
|
||||
@ -2364,8 +2417,16 @@ int ha_calpont_impl_rename_table_(const char* from, const char* to, cal_connecti
|
||||
return 1;
|
||||
}
|
||||
|
||||
fromPair = parseTableName(from);
|
||||
toPair = parseTableName(to);
|
||||
// MCOL-1855 Decode the table name if it contains encoded symbols.
|
||||
// This approach fails when `/` is used in the paths.
|
||||
size_t pathLen = strlen(from);
|
||||
char pathCopy[pathLen];
|
||||
decode_table_name(pathCopy, from, pathLen);
|
||||
fromPair = parseTableName(const_cast<const char*>(pathCopy));
|
||||
|
||||
pathLen = strlen(to);
|
||||
decode_table_name(pathCopy, to, pathLen);
|
||||
toPair = parseTableName(const_cast<const char*>(pathCopy));
|
||||
|
||||
if (fromPair.first != toPair.first)
|
||||
{
|
||||
|
@ -4929,7 +4929,6 @@ void gp_walk(const Item* item, void* arg)
|
||||
|
||||
if (isp)
|
||||
{
|
||||
// @bug 3669. trim trailing spaces for the compare value
|
||||
if (isp->result_type() == STRING_RESULT)
|
||||
{
|
||||
String val, *str = isp->val_str(&val);
|
||||
@ -4940,11 +4939,6 @@ void gp_walk(const Item* item, void* arg)
|
||||
cval.assign(str->ptr(), str->length());
|
||||
}
|
||||
|
||||
size_t spos = cval.find_last_not_of(" ");
|
||||
|
||||
if (spos != string::npos)
|
||||
cval = cval.substr(0, spos + 1);
|
||||
|
||||
gwip->rcWorkStack.push(new ConstantColumn(cval));
|
||||
break;
|
||||
}
|
||||
@ -6189,7 +6183,9 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
|
||||
if (filters)
|
||||
{
|
||||
csep->filters(filters);
|
||||
filters->drawTree("/tmp/filter1.dot");
|
||||
std::string aTmpDir(startup::StartUp::tmpDir());
|
||||
aTmpDir = aTmpDir + "/filter1.dot";
|
||||
filters->drawTree(aTmpDir);
|
||||
}
|
||||
|
||||
gwi.clauseType = SELECT;
|
||||
@ -8614,7 +8610,9 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
||||
{
|
||||
csep->filters(filters);
|
||||
#ifdef DEBUG_WALK_COND
|
||||
filters->drawTree("/tmp/filter1.dot");
|
||||
std::string aTmpDir(startup::StartUp::tmpDir());
|
||||
aTmpDir = aTmpDir + "/filter1.dot";
|
||||
filters->drawTree(aTmpDir);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2096,6 +2096,58 @@ extern "C"
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
// Return non-zero if this is the primary UM; 0 if not primary
|
||||
long long mcssystemprimary(UDF_INIT* initid, UDF_ARGS* args,
|
||||
char* is_null, char* error)
|
||||
{
|
||||
long long rtn = 0;
|
||||
Oam oam;
|
||||
string PrimaryUMModuleName;
|
||||
string localModule;
|
||||
oamModuleInfo_t st;
|
||||
|
||||
try
|
||||
{
|
||||
st = oam.getModuleInfo();
|
||||
localModule = boost::get<0>(st);
|
||||
PrimaryUMModuleName = config::Config::makeConfig()->getConfig("SystemConfig", "PrimaryUMModuleName");
|
||||
|
||||
if (boost::iequals(localModule, PrimaryUMModuleName))
|
||||
rtn = 1;
|
||||
if (PrimaryUMModuleName == "unassigned")
|
||||
rtn = 1;
|
||||
}
|
||||
catch (runtime_error& e)
|
||||
{
|
||||
// It's difficult to return an error message from a numerical UDF
|
||||
//string msg = string("ERROR: Problem getting Primary UM Module Name. ") + e.what();
|
||||
*error = 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
*error = 1;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
my_bool mcssystemprimary_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void mcssystemprimary_deinit(UDF_INIT* initid)
|
||||
{
|
||||
}
|
||||
|
||||
#define MAXSTRINGLENGTH 50
|
||||
|
||||
const char* PmSmallSideMaxMemory = "pmmaxmemorysmallside";
|
||||
@ -2720,16 +2772,16 @@ int ha_calpont_impl_rnd_init(TABLE* table)
|
||||
#ifdef DEBUG_SETENV
|
||||
string home(getenv("HOME"));
|
||||
|
||||
if (!getenv("CALPONT_HOME"))
|
||||
if (!getenv("COLUMNSTORE_HOME"))
|
||||
{
|
||||
string calpontHome(home + "/Calpont/etc/");
|
||||
setenv("CALPONT_HOME", calpontHome.c_str(), 1);
|
||||
setenv("COLUMNSTORE_HOME", calpontHome.c_str(), 1);
|
||||
}
|
||||
|
||||
if (!getenv("CALPONT_CONFIG_FILE"))
|
||||
if (!getenv("COLUMNSTORE_CONFIG_FILE"))
|
||||
{
|
||||
string calpontConfigFile(home + "/Calpont/etc/Columnstore.xml");
|
||||
setenv("CALPONT_CONFIG_FILE", calpontConfigFile.c_str(), 1);
|
||||
string calpontConfigFile(home + "/mariadb/columnstore/etc/Columnstore.xml");
|
||||
setenv("COLUMNSTORE_CONFIG_FILE", calpontConfigFile.c_str(), 1);
|
||||
}
|
||||
|
||||
if (!getenv("CALPONT_CSC_IDENT"))
|
||||
@ -3056,7 +3108,9 @@ int ha_calpont_impl_rnd_init(TABLE* table)
|
||||
|
||||
#ifdef PLAN_HEX_FILE
|
||||
// plan serialization
|
||||
ifstream ifs("/tmp/li1-plan.hex");
|
||||
string tmpDir = aTmpDir + "/li1-plan.hex";
|
||||
|
||||
ifstream ifs(tmpDir.c_str());
|
||||
ByteStream bs1;
|
||||
ifs >> bs1;
|
||||
ifs.close();
|
||||
@ -3982,6 +4036,8 @@ void ha_calpont_impl_start_bulk_insert(ha_rows rows, TABLE* table)
|
||||
//set up for cpimport
|
||||
std::vector<char*> Cmds;
|
||||
std::string aCmdLine(startup::StartUp::installDir());
|
||||
std::string aTmpDir(startup::StartUp::tmpDir());
|
||||
|
||||
//If local module type is not PM and Local PM query is set, error out
|
||||
char escapechar[2] = "";
|
||||
|
||||
@ -4390,6 +4446,8 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
|
||||
{
|
||||
THD* thd = current_thd;
|
||||
|
||||
std::string aTmpDir(startup::StartUp::tmpDir());
|
||||
|
||||
if (!thd->infinidb_vtable.cal_conn_info)
|
||||
thd->infinidb_vtable.cal_conn_info = (void*)(new cal_connection_info());
|
||||
|
||||
@ -4516,7 +4574,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
|
||||
rc = 1;
|
||||
ifstream dmlFile;
|
||||
ostringstream oss;
|
||||
oss << "/tmp/" << ci->tableOid << ".txt";
|
||||
oss << aTmpDir << ci->tableOid << ".txt";
|
||||
dmlFile.open(oss.str().c_str());
|
||||
|
||||
if (dmlFile.is_open())
|
||||
@ -4533,7 +4591,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
|
||||
rc = 1;
|
||||
ifstream dmlFile;
|
||||
ostringstream oss;
|
||||
oss << "/tmp/" << ci->tableOid << ".txt";
|
||||
oss << aTmpDir << ci->tableOid << ".txt";
|
||||
dmlFile.open(oss.str().c_str());
|
||||
|
||||
if (dmlFile.is_open())
|
||||
@ -4567,7 +4625,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
|
||||
//get extra warning count if any
|
||||
ifstream dmlFile;
|
||||
ostringstream oss;
|
||||
oss << "/tmp/" << ci->tableOid << ".txt";
|
||||
oss << aTmpDir << ci->tableOid << ".txt";
|
||||
dmlFile.open(oss.str().c_str());
|
||||
int totalWarnCount = 0;
|
||||
int colWarns = 0;
|
||||
@ -5235,7 +5293,9 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE
|
||||
|
||||
#ifdef PLAN_HEX_FILE
|
||||
// plan serialization
|
||||
ifstream ifs("/tmp/li1-plan.hex");
|
||||
string tmpDir = aTmpDir + "/li1-plan.hex";
|
||||
|
||||
ifstream ifs(tmpDir);
|
||||
ByteStream bs1;
|
||||
ifs >> bs1;
|
||||
ifs.close();
|
||||
|
@ -17,6 +17,8 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
|
||||
tmpdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
else
|
||||
echo "ignoring unknown argument: $arg" 1>&2
|
||||
fi
|
||||
@ -24,7 +26,7 @@ done
|
||||
|
||||
df=$installdir/mysql/my.cnf
|
||||
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --force --user=root mysql 2>/tmp/mysql_install.log <<EOD
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --force --user=root mysql 2> ${tmpdir}/mysql_install.log <<EOD
|
||||
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
|
||||
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
|
||||
INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so';
|
||||
@ -84,6 +86,7 @@ CREATE FUNCTION idbpartition RETURNS STRING soname 'libcalmysql.so';
|
||||
CREATE FUNCTION idblocalpm RETURNS INTEGER soname 'libcalmysql.so';
|
||||
CREATE FUNCTION mcssystemready RETURNS INTEGER soname 'libcalmysql.so';
|
||||
CREATE FUNCTION mcssystemreadonly RETURNS INTEGER soname 'libcalmysql.so';
|
||||
CREATE FUNCTION mcssystemprimary RETURNS INTEGER soname 'libcalmysql.so';
|
||||
CREATE AGGREGATE FUNCTION regr_avgx RETURNS REAL soname 'libregr_mysql.so';
|
||||
CREATE AGGREGATE FUNCTION regr_avgy RETURNS REAL soname 'libregr_mysql.so';
|
||||
CREATE AGGREGATE FUNCTION regr_count RETURNS INTEGER soname 'libregr_mysql.so';
|
||||
@ -112,7 +115,7 @@ CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats
|
||||
query varchar(8000),
|
||||
startTime timestamp NOT NULL,
|
||||
endTime timestamp NOT NULL,
|
||||
`rows` bigint,
|
||||
\`rows\` bigint,
|
||||
errno int,
|
||||
phyIO bigint,
|
||||
cacheIO bigint,
|
||||
|
@ -1,480 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
|
||||
# This file is public domain and comes with NO WARRANTY of any kind
|
||||
|
||||
# MySQL daemon start/stop script.
|
||||
|
||||
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
|
||||
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
|
||||
# When this is done the mysql server will be started when the machine is
|
||||
# started and shut down when the systems goes down.
|
||||
|
||||
# Comments to support chkconfig on RedHat Linux
|
||||
# chkconfig: 2345 64 36
|
||||
# description: A very fast and reliable SQL database engine.
|
||||
|
||||
# Comments to support LSB init script conventions
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mysql
|
||||
# Required-Start: $local_fs $network $remote_fs
|
||||
# Should-Start: ypbind nscd ldap ntpd xntpd
|
||||
# Required-Stop: $local_fs $network $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: start and stop MySQL
|
||||
# Description: MySQL is a very fast and reliable SQL database engine.
|
||||
### END INIT INFO
|
||||
|
||||
# If you install MySQL on some other places than /usr/local/Calpont/mysql, then you
|
||||
# have to do one of the following things for this script to work:
|
||||
#
|
||||
# - Run this script from within the MySQL installation directory
|
||||
# - Create a /etc/my.cnf file with the following information:
|
||||
# [mysqld]
|
||||
# basedir=<path-to-mysql-installation-directory>
|
||||
# - Add the above to any other configuration file (for example ~/.my.ini)
|
||||
# and copy my_print_defaults to /usr/bin
|
||||
# - Add the path to the mysql-installation-directory to the basedir variable
|
||||
# below.
|
||||
#
|
||||
# If you want to affect other MySQL variables, you should make your changes
|
||||
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
|
||||
|
||||
# If you change base dir, you must also change datadir. These may get
|
||||
# overwritten by settings in the MySQL configuration files.
|
||||
|
||||
basedir=/usr/local/Calpont/mysql
|
||||
datadir=/usr/local/Calpont/mysql/db
|
||||
|
||||
# Default value, in seconds, afterwhich the script should timeout waiting
|
||||
# for server start.
|
||||
# Value here is overriden by value in my.cnf.
|
||||
# 0 means don't wait at all
|
||||
# Negative numbers mean to wait indefinitely
|
||||
service_startup_timeout=30
|
||||
|
||||
# Lock directory for RedHat / SuSE.
|
||||
lockdir='/var/lock/subsys'
|
||||
lock_file_path="$lockdir/mysql-Columnstore"
|
||||
|
||||
# The following variables are only set for letting mysql.server find things.
|
||||
|
||||
# Set some defaults
|
||||
mysqld_pid_file_path=
|
||||
if test -z "$basedir"
|
||||
then
|
||||
basedir=/usr/local/Calpont/mysql
|
||||
bindir=/usr/local/bin
|
||||
if test -z "$datadir"
|
||||
then
|
||||
datadir=/var/lib/mysql
|
||||
fi
|
||||
sbindir=/usr/local/sbin
|
||||
libexecdir=/usr/local/sbin
|
||||
else
|
||||
bindir="$basedir/bin"
|
||||
if test -z "$datadir"
|
||||
then
|
||||
datadir="$basedir/data"
|
||||
fi
|
||||
sbindir="$basedir/sbin"
|
||||
if test -f "$basedir/sbin/mysqld"
|
||||
then
|
||||
libexecdir="$basedir/sbin"
|
||||
else
|
||||
libexecdir="$basedir/libexec"
|
||||
fi
|
||||
fi
|
||||
|
||||
# datadir_set is used to determine if datadir was set (and so should be
|
||||
# *not* set inside of the --basedir= handler.)
|
||||
datadir_set=
|
||||
|
||||
#
|
||||
# Use LSB init script functions for printing messages, if possible
|
||||
#
|
||||
lsb_functions="/lib/lsb/init-functions"
|
||||
if test -f $lsb_functions ; then
|
||||
. $lsb_functions
|
||||
else
|
||||
# Include non-LSB RedHat init functions to make systemctl redirect work
|
||||
init_functions="/etc/init.d/functions"
|
||||
if test -f $init_functions; then
|
||||
. $init_functions
|
||||
fi
|
||||
log_success_msg()
|
||||
{
|
||||
echo " SUCCESS! $@"
|
||||
}
|
||||
log_failure_msg()
|
||||
{
|
||||
echo " ERROR! $@"
|
||||
}
|
||||
fi
|
||||
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
|
||||
export PATH
|
||||
|
||||
mode=$1 # start or stop
|
||||
|
||||
[ $# -ge 1 ] && shift
|
||||
|
||||
case `echo "testing\c"`,`echo -n testing` in
|
||||
*c*,-n*) echo_n= echo_c= ;;
|
||||
*c*,*) echo_n=-n echo_c= ;;
|
||||
*) echo_n= echo_c='\c' ;;
|
||||
esac
|
||||
|
||||
parse_server_arguments() {
|
||||
for arg do
|
||||
case "$arg" in
|
||||
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
|
||||
bindir="$basedir/bin"
|
||||
if test -z "$datadir_set"; then
|
||||
datadir="$basedir/data"
|
||||
fi
|
||||
sbindir="$basedir/sbin"
|
||||
if test -f "$basedir/sbin/mysqld"
|
||||
then
|
||||
libexecdir="$basedir/sbin"
|
||||
else
|
||||
libexecdir="$basedir/libexec"
|
||||
fi
|
||||
#libexecdir="$basedir/libexec"
|
||||
;;
|
||||
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
|
||||
datadir_set=1
|
||||
;;
|
||||
--log-basename=*|--hostname=*|--loose-log-basename=*)
|
||||
mysqld_pid_file_path=`echo "$arg.pid" | sed -e 's/^[^=]*=//'`
|
||||
;;
|
||||
--pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Get arguments from the my.cnf file,
|
||||
# the only group, which is read from now on is [mysqld]
|
||||
if test -x ./bin/my_print_defaults
|
||||
then
|
||||
print_defaults="./bin/my_print_defaults"
|
||||
elif test -x $bindir/my_print_defaults
|
||||
then
|
||||
print_defaults="$bindir/my_print_defaults"
|
||||
elif test -x $bindir/mysql_print_defaults
|
||||
then
|
||||
print_defaults="$bindir/mysql_print_defaults"
|
||||
else
|
||||
# Try to find basedir in /etc/my.cnf
|
||||
conf=/etc/my.cnf
|
||||
print_defaults=
|
||||
if test -r $conf
|
||||
then
|
||||
subpat='^[^=]*basedir[^=]*=\(.*\)$'
|
||||
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
|
||||
for d in $dirs
|
||||
do
|
||||
d=`echo $d | sed -e 's/[ ]//g'`
|
||||
if test -x "$d/bin/my_print_defaults"
|
||||
then
|
||||
print_defaults="$d/bin/my_print_defaults"
|
||||
break
|
||||
fi
|
||||
if test -x "$d/bin/mysql_print_defaults"
|
||||
then
|
||||
print_defaults="$d/bin/mysql_print_defaults"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Hope it's in the PATH ... but I doubt it
|
||||
test -z "$print_defaults" && print_defaults="my_print_defaults"
|
||||
fi
|
||||
|
||||
#
|
||||
# Read defaults file from 'basedir'. If there is no defaults file there
|
||||
# check if it's in the old (depricated) place (datadir) and read it from there
|
||||
#
|
||||
|
||||
extra_args=""
|
||||
if test -r "$basedir/my.cnf"
|
||||
then
|
||||
extra_args="-e $basedir/my.cnf"
|
||||
else
|
||||
if test -r "$datadir/my.cnf"
|
||||
then
|
||||
extra_args="-e $datadir/my.cnf"
|
||||
fi
|
||||
fi
|
||||
|
||||
parse_server_arguments `$print_defaults $extra_args --mysqld mysql.server`
|
||||
parse_server_arguments "$@"
|
||||
|
||||
# wait for the pid file to disappear
|
||||
wait_for_gone () {
|
||||
pid="$1" # process ID of the program operating on the pid-file
|
||||
pid_file_path="$2" # path to the PID file.
|
||||
|
||||
i=0
|
||||
crash_protection="by checking again"
|
||||
|
||||
while test $i -ne $service_startup_timeout ; do
|
||||
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
: # the server still runs
|
||||
else
|
||||
if test ! -s "$pid_file_path"; then
|
||||
# no server process and no pid-file? great, we're done!
|
||||
log_success_msg
|
||||
return 0
|
||||
fi
|
||||
|
||||
# pid-file exists, the server process doesn't.
|
||||
# it must've crashed, and mysqld_safe will restart it
|
||||
if test -n "$crash_protection"; then
|
||||
crash_protection=""
|
||||
sleep 5
|
||||
continue # Check again.
|
||||
fi
|
||||
|
||||
kill_by_pid
|
||||
# Cannot help it
|
||||
log_failure_msg "The server quit without updating PID file ($pid_file_path)."
|
||||
return 1 # not waiting any more.
|
||||
fi
|
||||
|
||||
echo $echo_n ".$echo_c"
|
||||
i=`expr $i + 1`
|
||||
sleep 1
|
||||
|
||||
done
|
||||
|
||||
log_failure_msg
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_ready () {
|
||||
|
||||
i=0
|
||||
while test $i -ne $service_startup_timeout ; do
|
||||
|
||||
if $bindir/mysqladmin ping --socket=/usr/local/Calpont/mysql/lib/mysql/mysql.sock >/dev/null 2>&1; then
|
||||
log_success_msg
|
||||
return 0
|
||||
elif kill -0 $! 2>/dev/null ; then
|
||||
: # mysqld_safe is still running
|
||||
else
|
||||
# mysqld_safe is no longer running, abort the wait loop
|
||||
break
|
||||
fi
|
||||
|
||||
echo $echo_n ".$echo_c"
|
||||
i=`expr $i + 1`
|
||||
sleep 1
|
||||
|
||||
done
|
||||
|
||||
log_failure_msg
|
||||
return 1
|
||||
}
|
||||
#
|
||||
# Set pid file if not given
|
||||
#
|
||||
if test -z "$mysqld_pid_file_path"
|
||||
then
|
||||
mysqld_pid_file_path=$datadir/`hostname`.pid
|
||||
else
|
||||
case "$mysqld_pid_file_path" in
|
||||
/* ) ;;
|
||||
* ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# source other config files
|
||||
[ -f /etc/default/mysql ] && . /etc/default/mysql
|
||||
[ -f /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql
|
||||
[ -f /etc/conf.d/mysql ] && . /etc/conf.d/mysql
|
||||
|
||||
kill_by_pid() {
|
||||
# let's see if we can kill the 2 mysql procs by hand
|
||||
# get the our mysql from ps
|
||||
eval $(ps -ef | grep "$COLUMNSTORE_INSTALL_DIR/mysql//sbin/mysqld" | grep -v grep | head -1 | awk '{printf "pid=%d\n", $2}')
|
||||
|
||||
if [ -n "$pid" ]; then
|
||||
ppid=$(ps -o ppid= -p $pid)
|
||||
$SUDO kill -9 $ppid
|
||||
kill -9 $ppid
|
||||
sleep 1
|
||||
$SUDO kill -9 $pid
|
||||
kill -9 $pid
|
||||
echo $echo_n "Force shutting down (no/bad pid file)"
|
||||
log_success_msg
|
||||
exit 0
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
case "$mode" in
|
||||
'start')
|
||||
# Start daemon
|
||||
|
||||
# Safeguard (relative paths, core dumps..)
|
||||
cd $basedir
|
||||
|
||||
echo $echo_n "Starting MySQL"
|
||||
if test -x $bindir/mysqld_safe
|
||||
then
|
||||
# Give extra arguments to mysqld with the my.cnf file. This script
|
||||
# may be overwritten at next upgrade.
|
||||
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "--ledir=$libexecdir" "$@" >/dev/null 2>&1 &
|
||||
wait_for_ready; return_value=$?
|
||||
|
||||
# Make lock for RedHat / SuSE
|
||||
if test -w "$lockdir"
|
||||
then
|
||||
touch "$lock_file_path"
|
||||
fi
|
||||
|
||||
exit $return_value
|
||||
else
|
||||
log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
|
||||
fi
|
||||
;;
|
||||
|
||||
'stop')
|
||||
# Stop daemon. We use a signal here to avoid having to know the
|
||||
# root password.
|
||||
|
||||
if test -s "$mysqld_pid_file_path"
|
||||
then
|
||||
mysqld_pid=`cat "$mysqld_pid_file_path"`
|
||||
|
||||
if (kill -0 $mysqld_pid 2>/dev/null)
|
||||
then
|
||||
echo $echo_n "Shutting down MySQL"
|
||||
kill $mysqld_pid
|
||||
# mysqld should remove the pid file when it exits, so wait for it.
|
||||
wait_for_gone $mysqld_pid "$mysqld_pid_file_path"; return_value=$?
|
||||
else
|
||||
log_failure_msg "MySQL server process #$mysqld_pid is not running!"
|
||||
rm "$mysqld_pid_file_path"
|
||||
fi
|
||||
|
||||
# Delete lock for RedHat / SuSE
|
||||
if test -f "$lock_file_path"
|
||||
then
|
||||
rm -f "$lock_file_path"
|
||||
fi
|
||||
exit $return_value
|
||||
else
|
||||
kill_by_pid
|
||||
log_failure_msg "MySQL server PID file could not be found!"
|
||||
fi
|
||||
;;
|
||||
|
||||
'restart')
|
||||
# Stop the service and regardless of whether it was
|
||||
# running or not, start it again.
|
||||
if $0 stop "$@"; then
|
||||
if ! $0 start "$@"; then
|
||||
log_failure_msg "Failed to restart server."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
log_failure_msg "Failed to stop running server, so refusing to try to start."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
'reload'|'force-reload')
|
||||
if test -s "$mysqld_pid_file_path" ; then
|
||||
read mysqld_pid < "$mysqld_pid_file_path"
|
||||
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
|
||||
touch "$mysqld_pid_file_path"
|
||||
else
|
||||
log_failure_msg "MySQL PID file could not be found!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
'status')
|
||||
# First, check to see if pid file exists
|
||||
if test -s "$mysqld_pid_file_path" ; then
|
||||
read mysqld_pid < "$mysqld_pid_file_path"
|
||||
if kill -0 $mysqld_pid 2>/dev/null ; then
|
||||
log_success_msg "MySQL running ($mysqld_pid)"
|
||||
exit 0
|
||||
else
|
||||
log_failure_msg "MySQL is not running, but PID file exists"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Try to find appropriate mysqld process
|
||||
mysqld_pid=`pidof $libexecdir/mysqld`
|
||||
|
||||
# test if multiple pids exist
|
||||
pid_count=`echo $mysqld_pid | wc -w`
|
||||
if test $pid_count -gt 1 ; then
|
||||
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
|
||||
exit 5
|
||||
elif test -z $mysqld_pid ; then
|
||||
if test -f "$lock_file_path" ; then
|
||||
log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
|
||||
exit 2
|
||||
fi
|
||||
log_failure_msg "MySQL is not running"
|
||||
exit 3
|
||||
else
|
||||
log_failure_msg "MySQL is running but PID file could not be found"
|
||||
exit 4
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
'configtest')
|
||||
# Safeguard (relative paths, core dumps..)
|
||||
cd $basedir
|
||||
echo $echo_n "Testing MySQL configuration syntax"
|
||||
daemon=$bindir/mysqld
|
||||
if test -x $libexecdir/mysqld
|
||||
then
|
||||
daemon=$libexecdir/mysqld
|
||||
elif test -x $sbindir/mysqld
|
||||
then
|
||||
daemon=$sbindir/mysqld
|
||||
elif test -x `which mysqld`
|
||||
then
|
||||
daemon=`which mysqld`
|
||||
else
|
||||
log_failure_msg "Unable to locate the mysqld binary!"
|
||||
exit 1
|
||||
fi
|
||||
help_out=`$daemon --help 2>&1`; r=$?
|
||||
if test "$r" != 0 ; then
|
||||
log_failure_msg "$help_out"
|
||||
log_failure_msg "There are syntax errors in the server configuration. Please fix them!"
|
||||
else
|
||||
log_success_msg "Syntax OK"
|
||||
fi
|
||||
exit $r
|
||||
;;
|
||||
'bootstrap')
|
||||
if test "$_use_systemctl" == 1 ; then
|
||||
log_failure_msg "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
|
||||
exit 1
|
||||
fi
|
||||
# Bootstrap the cluster, start the first node
|
||||
# that initiate the cluster
|
||||
echo $echo_n "Bootstrapping the cluster.. "
|
||||
$0 start $other_args --wsrep-new-cluster
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
# usage
|
||||
basename=`basename "$0"`
|
||||
echo "Usage: $basename {start|stop|restart|reload|force-reload|status|configtest|bootstrap} [ MySQL server options ]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -43,8 +43,29 @@
|
||||
# If you change base dir, you must also change datadir. These may get
|
||||
# overwritten by settings in the MySQL configuration files.
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
@ -62,9 +83,11 @@ datadir=$basedir/db
|
||||
# 0 means don't wait at all
|
||||
# Negative numbers mean to wait indefinitely
|
||||
service_startup_timeout=90
|
||||
user=`whoami 2>/dev/null`
|
||||
|
||||
# Lock directory
|
||||
lockdir=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation LockFileDirectory`
|
||||
|
||||
# Lock directory for RedHat / SuSE.
|
||||
lockdir='/var/lock/subsys'
|
||||
lock_file_path="$lockdir/mysql-Columnstore"
|
||||
|
||||
# The following variables are only set for letting mysql.server find things.
|
||||
@ -316,10 +339,8 @@ kill_by_pid() {
|
||||
|
||||
if [ -n "$pid" ]; then
|
||||
ppid=$(ps -o ppid= -p $pid)
|
||||
$SUDO kill -9 $ppid
|
||||
kill -9 $ppid
|
||||
sleep 1
|
||||
$SUDO kill -9 $pid
|
||||
kill -9 $pid
|
||||
echo $echo_n "Force shutting down (no/bad pid file)"
|
||||
log_success_msg
|
||||
|
@ -54,6 +54,8 @@ using namespace querystats;
|
||||
|
||||
#include "sm.h"
|
||||
|
||||
#include "installdir.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace sm;
|
||||
@ -254,7 +256,10 @@ void sighandler(int sig_num)
|
||||
FILE* p;
|
||||
char buf[1024];
|
||||
|
||||
if ((p = fopen("/tmp/f1.dat", "a")) != NULL)
|
||||
string tmpDir = startup::StartUp::tmpDir() + "/f1.dat";
|
||||
const char *cstr = tmpDir.c_str();
|
||||
|
||||
if ((p = fopen(cstr, "a")) != NULL)
|
||||
{
|
||||
snprintf(buf, 1024, "sighandler() hit with %d\n", sig_num);
|
||||
fwrite(buf, 1, strlen(buf), p);
|
||||
|
@ -62,6 +62,8 @@ using namespace execplan;
|
||||
#include "utils_utf8.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@ -71,15 +73,12 @@ DistributedEngineComm* Dec;
|
||||
|
||||
void setupCwd()
|
||||
{
|
||||
string workdir = config::Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
|
||||
string workdir = startup::StartUp::tmpDir();
|
||||
|
||||
if (workdir.length() == 0)
|
||||
workdir = ".";
|
||||
|
||||
(void)chdir(workdir.c_str());
|
||||
|
||||
if (access(".", W_OK) != 0)
|
||||
(void)chdir("/tmp");
|
||||
}
|
||||
|
||||
void added_a_pm(int)
|
||||
|
@ -83,6 +83,7 @@ using namespace joblist;
|
||||
#include "utils_utf8.h"
|
||||
|
||||
#include "crashtrace.h"
|
||||
#include "installdir.h"
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@ -493,7 +494,7 @@ void rollbackAll(DBRM* dbrm)
|
||||
|
||||
void setupCwd()
|
||||
{
|
||||
string workdir = Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
|
||||
string workdir = startup::StartUp::tmpDir();
|
||||
|
||||
if (workdir.length() == 0)
|
||||
workdir = ".";
|
||||
@ -605,27 +606,12 @@ int main(int argc, char* argv[])
|
||||
if (temp > 0)
|
||||
serverQueueSize = temp;
|
||||
|
||||
|
||||
bool rootUser = true;
|
||||
#ifndef _MSC_VER
|
||||
//check if root-user
|
||||
int user;
|
||||
user = getuid();
|
||||
|
||||
if (user != 0)
|
||||
rootUser = false;
|
||||
|
||||
#endif
|
||||
|
||||
//read and cleanup port before trying to use
|
||||
try
|
||||
{
|
||||
string port = cf->getConfig(DMLProc, "Port");
|
||||
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
||||
|
||||
if ( !rootUser)
|
||||
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
|
||||
|
||||
(void)::system(cmd.c_str());
|
||||
}
|
||||
catch (...)
|
||||
|
@ -105,6 +105,9 @@ using namespace querytele;
|
||||
#include "dbrm.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "installdir.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -1,44 +0,0 @@
|
||||
#! /bin/sh
|
||||
# IDBCloudGetIP.sh
|
||||
# Get IP Address from a Cloud environment
|
||||
#
|
||||
# 1. Amazon EC2
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
#get instance name from called
|
||||
instanceName="$1"
|
||||
|
||||
ec2=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_HOME`
|
||||
|
||||
if [ $ec2 == "unassigned" ]; then
|
||||
echo "stopped"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
java=`$prefix/mariadb/columnstore/bin/getConfig Installation JAVA_HOME`
|
||||
path=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_PATH`
|
||||
|
||||
export PATH=$path
|
||||
export EC2_HOME=$ec2
|
||||
export JAVA_HOME=$java
|
||||
|
||||
# get x509 Certification and Private Key
|
||||
x509Cert=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonX509Certificate`
|
||||
x509PriKey=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonX509PrivateKey`
|
||||
|
||||
#get instance info
|
||||
ec2-describe-instances -C $x509Cert -K $x509PriKey $instanceName > /tmp/instanceInfo 2> /dev/null
|
||||
|
||||
#check if running
|
||||
cat /tmp/instanceInfo | grep running > /tmp/instanceStatus
|
||||
if [ `cat /tmp/instanceStatus | wc -c` -eq 0 ]; then
|
||||
echo "stopped"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#get priviate IP Address
|
||||
IpAddr=`cat /tmp/instanceInfo | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $15}'`
|
||||
|
||||
echo $IpAddr
|
||||
exit 0
|
@ -1,574 +0,0 @@
|
||||
#! /bin/sh
|
||||
# IDBInstanceCmds.sh
|
||||
# get-local-instance-ID, get-zone, getPrivateIP from a Cloud environment
|
||||
#
|
||||
# 1. Amazon EC2
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
#check command
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Enter Command Name: {launchInstance|getInstance|getZone|getPrivateIP|getKey|getAMI|getType|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet}
|
||||
}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "getPrivateIP" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
fi
|
||||
instanceName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "launchInstance" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
IPaddress="unassigned"
|
||||
else
|
||||
IPaddress="$2"
|
||||
fi
|
||||
if [ "$3" = "" ]; then
|
||||
instanceType="unassigned"
|
||||
else
|
||||
instanceType="$3"
|
||||
fi
|
||||
if [ "$4" = "" ]; then
|
||||
group="unassigned"
|
||||
else
|
||||
group="$4"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "terminateInstance" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
fi
|
||||
instanceName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "stopInstance" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
fi
|
||||
instanceName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "startInstance" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
fi
|
||||
instanceName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "assignElasticIP" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
else
|
||||
instanceName="$2"
|
||||
fi
|
||||
if [ "$3" = "" ]; then
|
||||
echo "Enter Elastic IP Address"
|
||||
exit 1
|
||||
else
|
||||
IPAddress="$3"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "deassignElasticIP" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Elastic IP Address"
|
||||
exit 1
|
||||
else
|
||||
IPAddress="$2"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
|
||||
ec2=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_HOME`
|
||||
|
||||
if [ $ec2 == "unassigned" ]; then
|
||||
if [ "$1" = "getPrivateIP" ]; then
|
||||
echo "stopped"
|
||||
exit 1
|
||||
else
|
||||
echo "unknown"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
java=`$prefix/mariadb/columnstore/bin/getConfig Installation JAVA_HOME`
|
||||
path=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_PATH`
|
||||
|
||||
export PATH=$path
|
||||
export EC2_HOME=$ec2
|
||||
export JAVA_HOME=$java
|
||||
|
||||
# get Keys and region
|
||||
AmazonAccessKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonAccessKey`
|
||||
if [ $AmazonAccessKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonSecretKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSecretKey`
|
||||
if [ $AmazonSecretKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonSecretKeyFile : $AmazonSecretKeyFile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonAccessKey=`cat $AmazonAccessKeyFile`
|
||||
AmazonSecretKey=`cat $AmazonSecretKeyFile`
|
||||
|
||||
Region=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonRegion`
|
||||
subnet=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSubNetID`
|
||||
|
||||
if test ! -f $AmazonAccessKeyfile ; then
|
||||
echo "FAILED: missing AmazonAccessKeyfile : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f $AmazonSecretKeyfile ; then
|
||||
echo "FAILED: missing AmazonSecretKeyfile : $AmazonSecretKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#default instance to null
|
||||
instance=""
|
||||
|
||||
describeInstanceFile="/tmp/describeInstance.txt"
|
||||
touch $describeInstanceFile
|
||||
|
||||
describeInstance() {
|
||||
ec2-describe-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region > $describeInstanceFile 2>&1
|
||||
}
|
||||
|
||||
#call at start up
|
||||
describeInstance
|
||||
|
||||
getInstance() {
|
||||
if [ "$instance" != "" ]; then
|
||||
echo $instance
|
||||
return
|
||||
fi
|
||||
|
||||
# first get local IP Address
|
||||
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
||||
|
||||
#get local Instance ID
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$instance" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
|
||||
echo $instance
|
||||
return
|
||||
}
|
||||
|
||||
getInstancePrivate() {
|
||||
if [ "$instance" != "" ]; then
|
||||
echo $instance
|
||||
return
|
||||
fi
|
||||
|
||||
# first get local IP Address
|
||||
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
||||
|
||||
#get local Instance ID
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$instance" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
getZone() {
|
||||
#get from Columnstore.xml if it's there, if not, get from instance then store
|
||||
zone=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonZone`
|
||||
|
||||
if [ "$zone" = "unassigned" ] || [ "$zone" = "" ]; then
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get zone
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
if [ "$zone" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
|
||||
else
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
if [ "$zone" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
fi
|
||||
$prefix/mariadb/columnstore/bin/setConfig Installation AmazonZone $zone
|
||||
fi
|
||||
|
||||
echo $zone
|
||||
return
|
||||
}
|
||||
|
||||
getPrivateIP() {
|
||||
#get instance info
|
||||
grep -B1 -A4 -m 1 $instanceName $describeInstanceFile > /tmp/instanceInfo_$instanceName 2>&1
|
||||
if [ `cat /tmp/instanceInfo_$instanceName | wc -c` -eq 0 ]; then
|
||||
describeInstance
|
||||
fi
|
||||
grep -B1 -A4 -m 1 $instanceName $describeInstanceFile > /tmp/instanceInfo_$instanceName 2>&1
|
||||
|
||||
#check if running or terminated
|
||||
cat /tmp/instanceInfo_$instanceName | grep running > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
# not running
|
||||
cat /tmp/instanceInfo_$instanceName | grep pending > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
describeInstance
|
||||
echo "stopped"
|
||||
exit 1
|
||||
else
|
||||
cat /tmp/instanceInfo_$instanceName | grep terminated > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
echo "terminated"
|
||||
exit 1
|
||||
else
|
||||
cat /tmp/instanceInfo_$instanceName | grep shutting-down > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
echo "terminated"
|
||||
exit 1
|
||||
else
|
||||
echo "stopped"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#running, get priviate IP Address
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
IpAddr=`head -n 2 /tmp/instanceInfo_$instanceName | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $15}'`
|
||||
else
|
||||
IpAddr=`head -n 2 /tmp/instanceInfo_$instanceName | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $14}'`
|
||||
fi
|
||||
|
||||
echo $IpAddr
|
||||
exit 0
|
||||
}
|
||||
|
||||
getType() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Type
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
if [ "$instanceType" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
|
||||
else
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
if [ "$instanceType" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
|
||||
fi
|
||||
|
||||
echo $instanceType
|
||||
return
|
||||
}
|
||||
|
||||
getKey() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Key
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
if [ "$key" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
|
||||
else
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
if [ "$key" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
|
||||
fi
|
||||
|
||||
echo $key
|
||||
return
|
||||
}
|
||||
|
||||
getAMI() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get AMI
|
||||
ami=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||
if [ "$ami" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
ami=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||
|
||||
echo $ami
|
||||
return
|
||||
}
|
||||
|
||||
getGroup() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get group
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 RESERVATION | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
if [ "$group" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 RESERVATION | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
if [ "$group" == "" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $22}'`
|
||||
fi
|
||||
else
|
||||
group=`grep -B1 -A6 -m 1 $instance $describeInstanceFile | grep -m 1 GROUP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$group" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
group=`grep -B1 -A6 -m 1 $instance $describeInstanceFile | grep -m 1 GROUP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$group" == "" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $21}'`
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $group
|
||||
return
|
||||
}
|
||||
|
||||
getProfile() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Type
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $23}'`
|
||||
if [ "$instanceProfile" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $23}'`
|
||||
|
||||
else
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $22}'`
|
||||
if [ "$instanceProfile" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $22}'`
|
||||
|
||||
fi
|
||||
|
||||
echo $instanceProfile
|
||||
return
|
||||
}
|
||||
|
||||
launchInstance() {
|
||||
#get publickey
|
||||
getKey >/dev/null 2>&1
|
||||
if [ "$group" = "unassigned" ]; then
|
||||
#get group
|
||||
getGroup >/dev/null 2>&1
|
||||
fi
|
||||
#get AMI
|
||||
getAMI >/dev/null 2>&1
|
||||
#get Zone
|
||||
getZone >/dev/null 2>&1
|
||||
if [ "$instanceType" = "unassigned" ]; then
|
||||
#get type
|
||||
getType >/dev/null 2>&1
|
||||
fi
|
||||
#get AMI Profile
|
||||
getProfile >/dev/null 2>&1
|
||||
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
#NOT VPC
|
||||
if [ "$instanceProfile" = "" ] || [ "$instanceProfile" = "default" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
else # VPC
|
||||
if [ "$instanceProfile" = "" ] || [ "$instanceProfile" = "default" ]; then
|
||||
if [ "$group" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
else
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances --O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ "$group" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
else
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo $newInstance
|
||||
return
|
||||
}
|
||||
|
||||
terminateInstance() {
|
||||
#terminate Instance
|
||||
ec2-terminate-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/termInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
stopInstance() {
|
||||
#terminate Instance
|
||||
ec2-stop-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/stopInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
startInstance() {
|
||||
#terminate Instance
|
||||
ec2-start-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/startInstanceInfo_$instanceName 2>&1
|
||||
|
||||
cat /tmp/startInstanceInfo_$instanceName | grep INSTANCE > /tmp/startInstanceStatus_$instanceName
|
||||
if [ `cat /tmp/startInstanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check /tmp/startInstanceInfo_$instanceName"
|
||||
exit 1
|
||||
fi
|
||||
echo "Success"
|
||||
exit 0
|
||||
}
|
||||
|
||||
assignElasticIP() {
|
||||
#terminate Instance
|
||||
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
ec2-associate-address -O $AmazonAccessKey -W $AmazonSecretKey -i $instanceName $IPAddress > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
else
|
||||
EIP=`ec2-describe-addresses -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $IPAddress | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
ec2-associate-address -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -i $instanceName -a $EIP > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
fi
|
||||
|
||||
cat /tmp/assignElasticIPInfo_$IPAddress | grep ADDRESS > /tmp/assignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/assignElasticIPStatus_$IPAddress | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check /tmp/assignElasticIPInfo_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Success"
|
||||
exit 0
|
||||
}
|
||||
|
||||
deassignElasticIP() {
|
||||
#terminate Instance
|
||||
ec2-disassociate-address -O $AmazonAccessKey -W $AmazonSecretKey $IPAddress > /tmp/deassignElasticIPInfo_$IPAddress 2>&1
|
||||
|
||||
cat /tmp/deassignElasticIPInfo_$IPAddress | grep ADDRESS > /tmp/deassignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/deassignElasticIPStatus_$IPAddress | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check /tmp/deassignElasticIPStatus_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Success"
|
||||
exit 0
|
||||
}
|
||||
|
||||
getSubnet() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Subnet
|
||||
subnet=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $16}'`
|
||||
if [ "$subnet" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
subnet=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $16}'`
|
||||
|
||||
if [[ $subnet == *"subnet"* ]]
|
||||
then
|
||||
echo $subnet
|
||||
else
|
||||
echo "failed"
|
||||
fi
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
getInstance)
|
||||
getInstance
|
||||
;;
|
||||
getZone)
|
||||
getZone
|
||||
;;
|
||||
getPrivateIP)
|
||||
getPrivateIP
|
||||
;;
|
||||
getKey)
|
||||
getKey
|
||||
;;
|
||||
getAMI)
|
||||
getAMI
|
||||
;;
|
||||
getType)
|
||||
getType
|
||||
;;
|
||||
launchInstance)
|
||||
launchInstance
|
||||
;;
|
||||
terminateInstance)
|
||||
terminateInstance
|
||||
;;
|
||||
stopInstance)
|
||||
stopInstance
|
||||
;;
|
||||
startInstance)
|
||||
startInstance
|
||||
;;
|
||||
assignElasticIP)
|
||||
assignElasticIP
|
||||
;;
|
||||
deassignElasticIP)
|
||||
deassignElasticIP
|
||||
;;
|
||||
getProfile)
|
||||
getProfile
|
||||
;;
|
||||
getGroup)
|
||||
getGroup
|
||||
;;
|
||||
getSubnet)
|
||||
getSubnet
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {launchInstance|getInstance|getZone|getPrivateIP|getType|getKey|getAMI|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
@ -1,337 +0,0 @@
|
||||
#! /bin/sh
|
||||
# IDBVolumeCmds.sh
|
||||
# describe, detach and attach Volume Storage from a Cloud environment
|
||||
#
|
||||
# 1. Amazon EC2
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
#check command
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Enter Command Name: {create|describe|detach|attach|delete|createTag}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "create" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter size of the volume, in GiB (1-1024)"
|
||||
exit 1
|
||||
fi
|
||||
volumeSize="$2"
|
||||
|
||||
#get module-type
|
||||
if [ "$3" = "" ]; then
|
||||
echo "Enter Module Type"
|
||||
exit 1
|
||||
fi
|
||||
moduleType="$3"
|
||||
fi
|
||||
|
||||
if [ "$1" = "describe" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Volume Name"
|
||||
exit 1
|
||||
fi
|
||||
volumeName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "detach" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Volume Name"
|
||||
exit 1
|
||||
fi
|
||||
volumeName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "attach" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Volume Name"
|
||||
exit 1
|
||||
fi
|
||||
volumeName="$2"
|
||||
|
||||
#get instance-name and device-name
|
||||
if [ "$3" = "" ]; then
|
||||
echo "Enter Instance Name"
|
||||
exit 1
|
||||
fi
|
||||
instanceName="$3"
|
||||
|
||||
if [ "$4" = "" ]; then
|
||||
echo "Enter Device Name"
|
||||
exit 1
|
||||
fi
|
||||
deviceName="$4"
|
||||
fi
|
||||
|
||||
if [ "$1" = "delete" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Volume Name"
|
||||
exit 1
|
||||
fi
|
||||
volumeName="$2"
|
||||
fi
|
||||
|
||||
if [ "$1" = "createTag" ]; then
|
||||
if [ "$2" = "" ]; then
|
||||
echo "Enter Resource Name"
|
||||
exit 1
|
||||
fi
|
||||
resourceName="$2"
|
||||
|
||||
if [ "$3" = "" ]; then
|
||||
echo "Enter Tag Name"
|
||||
exit 1
|
||||
fi
|
||||
tagName="$3"
|
||||
|
||||
if [ "$4" = "" ]; then
|
||||
echo "Enter Tag Value"
|
||||
exit 1
|
||||
fi
|
||||
tagValue="$4"
|
||||
fi
|
||||
|
||||
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
|
||||
ec2=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_HOME`
|
||||
|
||||
if [ $ec2 == "unassigned" ]; then
|
||||
STATUS="unknown"
|
||||
RETVAL=1
|
||||
fi
|
||||
|
||||
java=`$prefix/mariadb/columnstore/bin/getConfig Installation JAVA_HOME`
|
||||
path=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_PATH`
|
||||
|
||||
export PATH=$path
|
||||
export EC2_HOME=$ec2
|
||||
export JAVA_HOME=$java
|
||||
|
||||
# get Keys and region
|
||||
AmazonAccessKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonAccessKey`
|
||||
if [ $AmazonAccessKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonSecretKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSecretKey`
|
||||
if [ $AmazonSecretKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonSecretKeyFile : $AmazonSecretKeyFile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonAccessKey=`cat $AmazonAccessKeyFile`
|
||||
AmazonSecretKey=`cat $AmazonSecretKeyFile`
|
||||
|
||||
if test ! -f $AmazonAccessKeyfile ; then
|
||||
echo "FAILED: missing AmazonAccessKeyfile : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f $AmazonSecretKeyfile ; then
|
||||
echo "FAILED: missing AmazonSecretKeyfile : $AmazonSecretKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Region=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonRegion`
|
||||
|
||||
|
||||
checkInfostatus() {
|
||||
#check if attached
|
||||
cat /tmp/volumeInfo_$volumeName | grep attached > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="attached"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if available
|
||||
cat /tmp/volumeInfo_$volumeName | grep available > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="available"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if detaching
|
||||
cat /tmp/volumeInfo_$volumeName | grep detaching > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="detaching"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if attaching
|
||||
cat /tmp/volumeInfo_$volumeName | grep attaching > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="attaching"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if doesn't exist
|
||||
cat /tmp/volumeInfo_$volumeName | grep "does not exist" > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="does-not-exist"
|
||||
RETVAL=1
|
||||
return
|
||||
fi
|
||||
#check if reports already attached from attach command
|
||||
cat /tmp/volumeInfo_$volumeName | grep "already attached" > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="already-attached"
|
||||
RETVAL=1
|
||||
return
|
||||
fi
|
||||
#any other, unknown error
|
||||
STATUS="unknown"
|
||||
RETVAL=1
|
||||
return
|
||||
}
|
||||
|
||||
createvolume() {
|
||||
# get zone
|
||||
zone=`$prefix/mariadb/columnstore/bin/IDBInstanceCmds.sh getZone`
|
||||
|
||||
if [ $moduleType == "um" ]; then
|
||||
# get type
|
||||
volumeType=`$prefix/mariadb/columnstore/bin/getConfig Installation UMVolumeType`
|
||||
if [ $volumeType == "io1" ]; then
|
||||
# get IOPS
|
||||
volumeIOPS=`$prefix/mariadb/columnstore/bin/getConfig Installation UMVolumeIOPS`
|
||||
fi
|
||||
else # pm
|
||||
# get type
|
||||
volumeType=`$prefix/mariadb/columnstore/bin/getConfig Installation PMVolumeType`
|
||||
if [ $volumeType == "io1" ]; then
|
||||
# get IOPS
|
||||
volumeIOPS=`$prefix/mariadb/columnstore/bin/getConfig Installation PMVolumeIOPS`
|
||||
fi
|
||||
fi
|
||||
|
||||
#create volume
|
||||
if [ $volumeType == "io1" ]; then
|
||||
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
|
||||
echo $volume
|
||||
return
|
||||
}
|
||||
|
||||
describevolume() {
|
||||
#describe volume
|
||||
ec2-describe-volumes -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
echo $STATUS
|
||||
return
|
||||
}
|
||||
|
||||
detachvolume() {
|
||||
#detach volume
|
||||
ec2-detach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "detaching" ]; then
|
||||
retries=1
|
||||
while [ $retries -ne 60 ]; do
|
||||
#retry until it's attached
|
||||
ec2-detach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "available" ]; then
|
||||
echo "available"
|
||||
exit 0
|
||||
fi
|
||||
((retries++))
|
||||
sleep 1
|
||||
done
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
cplogger -w 100 "detachvolume failed: $STATUS"
|
||||
echo "failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $STATUS == "available" ]; then
|
||||
echo "available"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
cplogger -w 100 "detachvolume failed status: $STATUS"
|
||||
echo $STATUS
|
||||
exit 1
|
||||
}
|
||||
|
||||
attachvolume() {
|
||||
|
||||
#detach volume
|
||||
ec2-attach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName -i $instanceName -d $deviceName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "attaching" -o $STATUS == "already-attached" ]; then
|
||||
retries=1
|
||||
while [ $retries -ne 60 ]; do
|
||||
#check status until it's attached
|
||||
describevolume
|
||||
if [ $STATUS == "attached" ]; then
|
||||
echo "attached"
|
||||
exit 0
|
||||
fi
|
||||
((retries++))
|
||||
sleep 1
|
||||
done
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
cplogger -w 100 "attachvolume failed: $STATUS"
|
||||
echo "failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $STATUS == "attached" ]; then
|
||||
echo "attached"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
cplogger -w 100 "attachvolume failed: $STATUS"
|
||||
echo $STATUS
|
||||
exit 1
|
||||
}
|
||||
|
||||
deletevolume() {
|
||||
#delete volume
|
||||
ec2-delete-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/deletevolume_$volumeName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
createTag() {
|
||||
#create tag
|
||||
ec2-create-tags -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $resourceName --tag $tagName=$tagValue > /tmp/createTag_$volumeName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
create)
|
||||
createvolume
|
||||
;;
|
||||
describe)
|
||||
describevolume
|
||||
;;
|
||||
detach)
|
||||
detachvolume
|
||||
;;
|
||||
attach)
|
||||
attachvolume
|
||||
;;
|
||||
delete)
|
||||
deletevolume
|
||||
;;
|
||||
createTag)
|
||||
createTag
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {create|describe|detach|attach|delete|}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
@ -10,6 +10,8 @@ fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
#get temp directory
|
||||
tmpdir=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
#check command
|
||||
if [ "$1" = "" ]; then
|
||||
@ -102,7 +104,7 @@ instance=""
|
||||
AWSCLI="aws ec2 "
|
||||
|
||||
getRegion() {
|
||||
Region=`curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document/region | grep region | cut -d':' -f2 | sed 's/\"//g' | sed 's/\,//g' | sed -e 's/^[ \t]*//'`
|
||||
Region=`curl --fail --silent /dev/null http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | cut -d':' -f2 | sed 's/\"//g' | sed 's/\,//g' | sed -e 's/^[ \t]*//'`
|
||||
|
||||
echo $Region
|
||||
return
|
||||
@ -310,7 +312,7 @@ terminateInstance() {
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#terminate Instance
|
||||
$AWSCLI terminate-instances --instance-ids $instanceName --region $Region > /tmp/termInstanceInfo_$instanceName 2>&1
|
||||
$AWSCLI terminate-instances --instance-ids $instanceName --region $Region > ${tmpdir}/termInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
@ -319,7 +321,7 @@ stopInstance() {
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#terminate Instance
|
||||
$AWSCLI stop-instances --instance-ids $instanceName --region $Region > /tmp/stopInstanceInfo_$instanceName 2>&1
|
||||
$AWSCLI stop-instances --instance-ids $instanceName --region $Region > ${tmpdir}/stopInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
@ -328,11 +330,11 @@ startInstance() {
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#terminate Instance
|
||||
$AWSCLI start-instances --instance-ids $instanceName --region $Region > /tmp/startInstanceInfo_$instanceName 2>&1
|
||||
$AWSCLI start-instances --instance-ids $instanceName --region $Region > ${tmpdir}/startInstanceInfo_$instanceName 2>&1
|
||||
|
||||
cat /tmp/startInstanceInfo_$instanceName | grep InstanceId > /tmp/startInstanceStatus_$instanceName
|
||||
if [ `cat /tmp/startInstanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check /tmp/startInstanceInfo_$instanceName"
|
||||
cat ${tmpdir}/startInstanceInfo_$instanceName | grep InstanceId > ${tmpdir}/startInstanceStatus_$instanceName
|
||||
if [ `cat ${tmpdir}/startInstanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check ${tmpdir}/startInstanceInfo_$instanceName"
|
||||
exit 1
|
||||
fi
|
||||
echo "Success"
|
||||
@ -345,11 +347,11 @@ assignElasticIP() {
|
||||
|
||||
EIP=`$AWSCLI describe-addresses --region $Region --public-ips $IPAddress --query 'Addresses[*].AllocationId' --output text`
|
||||
|
||||
$AWSCLI associate-address --region $Region --instance-id $instanceName --allocation-id $EIP > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
$AWSCLI associate-address --region $Region --instance-id $instanceName --allocation-id $EIP > ${tmpdir}/assignElasticIPInfo_$IPAddress 2>&1
|
||||
|
||||
cat /tmp/assignElasticIPInfo_$IPAddress | grep error > /tmp/assignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/assignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check /tmp/assignElasticIPInfo_$IPAddress"
|
||||
cat ${tmpdir}/assignElasticIPInfo_$IPAddress | grep error > ${tmpdir}/assignElasticIPStatus_$IPAddress
|
||||
if [ `cat ${tmpdir}/assignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check ${tmpdir}/assignElasticIPInfo_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -363,10 +365,10 @@ deassignElasticIP() {
|
||||
|
||||
EIP=`$AWSCLI describe-addresses --region $Region --public-ips $IPAddress --query 'Addresses[*].AssociationId' --output text`
|
||||
|
||||
$AWSCLI disassociate-address --region $Region --association-id $EIP > /tmp/deassignElasticIPInfo_$IPAddress 2>&1
|
||||
cat /tmp/deassignElasticIPInfo_$IPAddress | grep error > /tmp/deassignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/deassignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check /tmp/deassignElasticIPStatus_$IPAddress"
|
||||
$AWSCLI disassociate-address --region $Region --association-id $EIP > ${tmpdir}/deassignElasticIPInfo_$IPAddress 2>&1
|
||||
cat ${tmpdir}/deassignElasticIPInfo_$IPAddress | grep error > ${tmpdir}/deassignElasticIPStatus_$IPAddress
|
||||
if [ `cat ${tmpdir}/deassignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check ${tmpdir}/deassignElasticIPStatus_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -10,6 +10,9 @@ fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
#get temp directory
|
||||
tmpdir=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
#check command
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Enter Command Name: {create|describe|detach|attach|delete|createTag}"
|
||||
@ -108,43 +111,43 @@ Region=`$COLUMNSTORE_INSTALL_DIR/bin/MCSInstanceCmds.sh getRegion`
|
||||
|
||||
checkInfostatus() {
|
||||
#check if attached
|
||||
cat /tmp/volumeInfo_$volumeName | grep attached > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep attached > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="attached"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if available
|
||||
cat /tmp/volumeInfo_$volumeName | grep available > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep available > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="available"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if detaching
|
||||
cat /tmp/volumeInfo_$volumeName | grep detaching > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep detaching > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="detaching"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if attaching
|
||||
cat /tmp/volumeInfo_$volumeName | grep attaching > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep attaching > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="attaching"
|
||||
RETVAL=0
|
||||
return
|
||||
fi
|
||||
#check if doesn't exist
|
||||
cat /tmp/volumeInfo_$volumeName | grep "does not exist" > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep "does not exist" > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="does-not-exist"
|
||||
RETVAL=1
|
||||
return
|
||||
fi
|
||||
#check if reports already attached from attach command
|
||||
cat /tmp/volumeInfo_$volumeName | grep "already attached" > /tmp/volumeStatus_$volumeName
|
||||
if [ `cat /tmp/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
cat ${tmpdir}/volumeInfo_$volumeName | grep "already attached" > ${tmpdir}/volumeStatus_$volumeName
|
||||
if [ `cat ${tmpdir}/volumeStatus_$volumeName | wc -c` -ne 0 ]; then
|
||||
STATUS="already-attached"
|
||||
RETVAL=1
|
||||
return
|
||||
@ -188,7 +191,7 @@ createvolume() {
|
||||
|
||||
describevolume() {
|
||||
#describe volume
|
||||
$AWSCLI describe-volumes --volume-ids $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI describe-volumes --volume-ids $volumeName --region $Region > ${tmpdir}/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
echo $STATUS
|
||||
@ -197,14 +200,14 @@ describevolume() {
|
||||
|
||||
detachvolume() {
|
||||
#detach volume
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > ${tmpdir}/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "detaching" ]; then
|
||||
retries=1
|
||||
while [ $retries -ne 10 ]; do
|
||||
#retry until it's attached
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > ${tmpdir}/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "available" ]; then
|
||||
@ -234,7 +237,7 @@ detachvolume() {
|
||||
attachvolume() {
|
||||
|
||||
#detach volume
|
||||
$AWSCLI attach-volume --volume-id $volumeName --instance-id $instanceName --device $deviceName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI attach-volume --volume-id $volumeName --instance-id $instanceName --device $deviceName --region $Region > ${tmpdir}/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "attaching" -o $STATUS == "already-attached" ]; then
|
||||
@ -268,13 +271,13 @@ attachvolume() {
|
||||
|
||||
deletevolume() {
|
||||
#delete volume
|
||||
$AWSCLI delete-volume --volume-id $volumeName --region $Region > /tmp/deletevolume_$volumeName 2>&1
|
||||
$AWSCLI delete-volume --volume-id $volumeName --region $Region > ${tmpdir}/deletevolume_$volumeName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
createTag() {
|
||||
#create tag
|
||||
$AWSCLI create-tags --resources $resourceName --tags Key=$tagName,Value=$tagValue --region $Region > /tmp/createTag_$volumeName 2>&1
|
||||
$AWSCLI create-tags --resources $resourceName --tags Key=$tagName,Value=$tagValue --region $Region > ${tmpdir}/createTag_$resourceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,4 @@ install(FILES AlarmConfig.xml
|
||||
Columnstore.xml
|
||||
ProcessConfig.xml
|
||||
ConsoleCmds.xml
|
||||
Columnstore.xml.singleserver
|
||||
ProcessConfig.xml.singleserver
|
||||
DESTINATION ${ENGINE_ETCDIR} COMPONENT platform)
|
||||
|
@ -1,544 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Id: Columnstore.xml 3713 2013-08-16 20:04:47Z wweeks $ -->
|
||||
<!--
|
||||
WARNING: Do not make changes to this file unless directed to do so by
|
||||
Calpont service engineers. Incorrect settings can render your system
|
||||
unusable and will require a service call to correct.
|
||||
-->
|
||||
<Calpont Version="V1.0.0">
|
||||
<ExeMgr1>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8601</Port>
|
||||
<Module>unassigned</Module>
|
||||
</ExeMgr1>
|
||||
<JobProc>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8602</Port>
|
||||
</JobProc>
|
||||
<ProcMgr>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8603</Port>
|
||||
</ProcMgr>
|
||||
<ProcStatusControl>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8604</Port>
|
||||
</ProcStatusControl>
|
||||
<ProcStatusControlStandby>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8605</Port>
|
||||
</ProcStatusControlStandby>
|
||||
<!-- Disabled
|
||||
<ProcHeartbeatControl>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8605</Port>
|
||||
</ProcHeartbeatControl>
|
||||
-->
|
||||
<!-- ProcessMonitor Port: 8800 - 8820 is reserved to support External Modules-->
|
||||
<localhost_ProcessMonitor>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</localhost_ProcessMonitor>
|
||||
<dm1_ProcessMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</dm1_ProcessMonitor>
|
||||
<um1_ProcessMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</um1_ProcessMonitor>
|
||||
<pm1_ProcessMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</pm1_ProcessMonitor>
|
||||
<dm1_ServerMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</dm1_ServerMonitor>
|
||||
<um1_ServerMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</um1_ServerMonitor>
|
||||
<pm1_ServerMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</pm1_ServerMonitor>
|
||||
<pm1_WriteEngineServer>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8630</Port>
|
||||
</pm1_WriteEngineServer>
|
||||
<DDLProc>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8612</Port>
|
||||
</DDLProc>
|
||||
<DMLProc>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8614</Port>
|
||||
</DMLProc>
|
||||
<BatchInsert>
|
||||
<RowsPerBatch>10000</RowsPerBatch>
|
||||
</BatchInsert>
|
||||
<PrimitiveServers>
|
||||
<Count>1</Count>
|
||||
<ConnectionsPerPrimProc>8</ConnectionsPerPrimProc>
|
||||
<ProcessorThreshold>128</ProcessorThreshold>
|
||||
<ProcessorQueueSize>10K</ProcessorQueueSize> <!-- minimum of extent size 8192 -->
|
||||
<DebugLevel>0</DebugLevel>
|
||||
<LBID_Shift>13</LBID_Shift>
|
||||
<ColScanBufferSizeBlocks>512</ColScanBufferSizeBlocks>
|
||||
<ColScanReadAheadBlocks>512</ColScanReadAheadBlocks> <!-- s/b factor of extent size 8192 -->
|
||||
<!-- <BPPCount>16</BPPCount> --> <!-- Default num cores * 2. A cap on the number of simultaneous primitives per jobstep -->
|
||||
<PrefetchThreshold>1</PrefetchThreshold>
|
||||
<PTTrace>0</PTTrace>
|
||||
<RotatingDestination>y</RotatingDestination> <!-- Iterate thru UM ports; set to 'n' if UM/PM on same server -->
|
||||
<!-- <HighPriorityPercentage>60</HighPriorityPercentage> -->
|
||||
<!-- <MediumPriorityPercentage>30</MediumPriorityPercentage> -->
|
||||
<!-- <LowPriorityPercentage>10</LowPriorityPercentage> -->
|
||||
<DirectIO>y</DirectIO>
|
||||
</PrimitiveServers>
|
||||
<PMS1>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS1>
|
||||
<PMS2>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS2>
|
||||
<PMS3>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS3>
|
||||
<PMS4>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS4>
|
||||
<PMS5>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS5>
|
||||
<PMS6>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS6>
|
||||
<PMS7>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS7>
|
||||
<PMS8>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS8>
|
||||
<PMS9>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS9>
|
||||
<PMS10>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS10>
|
||||
<PMS11>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS11>
|
||||
<PMS12>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS12>
|
||||
<PMS13>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS13>
|
||||
<PMS14>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS14>
|
||||
<PMS15>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS15>
|
||||
<PMS16>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS16>
|
||||
<PMS17>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS17>
|
||||
<PMS18>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS18>
|
||||
<PMS19>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS19>
|
||||
<PMS20>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS20>
|
||||
<PMS21>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS21>
|
||||
<PMS22>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS22>
|
||||
<PMS23>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS23>
|
||||
<PMS24>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS24>
|
||||
<PMS25>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS25>
|
||||
<PMS26>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS26>
|
||||
<PMS27>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS27>
|
||||
<PMS28>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS28>
|
||||
<PMS29>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS29>
|
||||
<PMS30>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS30>
|
||||
<PMS31>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS31>
|
||||
<PMS32>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS32>
|
||||
<SystemConfig>
|
||||
<SystemLang>C</SystemLang>
|
||||
<SystemName>columnstore-1</SystemName>
|
||||
<ParentOAMModuleName>pm1</ParentOAMModuleName>
|
||||
<StandbyOAMModuleName>unassigned</StandbyOAMModuleName>
|
||||
<PrimaryUMModuleName>unassigned</PrimaryUMModuleName>
|
||||
<ModuleHeartbeatPeriod>1</ModuleHeartbeatPeriod>
|
||||
<ModuleHeartbeatCount>3</ModuleHeartbeatCount>
|
||||
<ModuleProcMonWaitCount>6</ModuleProcMonWaitCount> // 2.5 minutes
|
||||
<!-- Disabled
|
||||
<ProcessHeartbeatPeriod>-1</ProcessHeartbeatPeriod>
|
||||
-->
|
||||
<!-- Warning: Do not change this value once database is built -->
|
||||
<DBRootCount>1</DBRootCount>
|
||||
<DBRoot1>$INSTALLDIR/data1</DBRoot1>
|
||||
<DBRMRoot>$INSTALLDIR/data1/systemFiles/dbrm/BRM_saves</DBRMRoot>
|
||||
<TableLockSaveFile>$INSTALLDIR/data1/systemFiles/dbrm/tablelocks</TableLockSaveFile>
|
||||
<DBRMTimeOut>20</DBRMTimeOut> <!-- in seconds -->
|
||||
<DBRMSnapshotInterval>100000</DBRMSnapshotInterval>
|
||||
<ExternalCriticalThreshold>90</ExternalCriticalThreshold>
|
||||
<ExternalMajorThreshold>80</ExternalMajorThreshold>
|
||||
<ExternalMinorThreshold>70</ExternalMinorThreshold>
|
||||
<TempDiskPath>/tmp</TempDiskPath>
|
||||
<WorkingDir>/tmp</WorkingDir>
|
||||
<TransactionArchivePeriod>10</TransactionArchivePeriod>
|
||||
<NMSIPAddress>0.0.0.0</NMSIPAddress>
|
||||
<TempSaveSize>128M</TempSaveSize> <!-- default SWSDL max element save size -->
|
||||
<WaitPeriod>10</WaitPeriod> <!-- in seconds -->
|
||||
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
|
||||
<CalpontHome>$INSTALLDIR</CalpontHome>
|
||||
<ProcessRestartCount>10</ProcessRestartCount>
|
||||
<ProcessRestartPeriod>120</ProcessRestartPeriod>
|
||||
<SwapAction>restartSystem</SwapAction> <!-- OAM command (or 'none') to run when swap space exceeds Major Threshold -->
|
||||
<ActivePmFailoverDisabled>n</ActivePmFailoverDisabled>
|
||||
<MemoryCheckPercent>95</MemoryCheckPercent> <!-- Max real memory to limit growth of buffers to -->
|
||||
<DataFileLog>OFF</DataFileLog>
|
||||
<!-- enable if you want to limit how much memory may be used for hdfs read/write memory buffers.
|
||||
<hdfsRdwrBufferMaxSize>8G</hdfsRdwrBufferMaxSize>
|
||||
-->
|
||||
<hdfsRdwrScratch>/tmp/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
|
||||
</SystemConfig>
|
||||
<SystemModuleConfig>
|
||||
<ModuleType1>dm</ModuleType1>
|
||||
<ModuleDesc1>Director Module</ModuleDesc1>
|
||||
<RunType1>SIMPLEX</RunType1>
|
||||
<ModuleCount1>0</ModuleCount1>
|
||||
<ModuleIPAddr1-1-1>0.0.0.0</ModuleIPAddr1-1-1>
|
||||
<ModuleHostName1-1-1>unassigned</ModuleHostName1-1-1>
|
||||
<ModuleDisableState1-1>ENABLED</ModuleDisableState1-1>
|
||||
<ModuleCPUCriticalThreshold1>0</ModuleCPUCriticalThreshold1>
|
||||
<ModuleCPUMajorThreshold1>0</ModuleCPUMajorThreshold1>
|
||||
<ModuleCPUMinorThreshold1>0</ModuleCPUMinorThreshold1>
|
||||
<ModuleCPUMinorClearThreshold1>0</ModuleCPUMinorClearThreshold1>
|
||||
<ModuleDiskCriticalThreshold1>90</ModuleDiskCriticalThreshold1>
|
||||
<ModuleDiskMajorThreshold1>80</ModuleDiskMajorThreshold1>
|
||||
<ModuleDiskMinorThreshold1>70</ModuleDiskMinorThreshold1>
|
||||
<ModuleMemCriticalThreshold1>90</ModuleMemCriticalThreshold1>
|
||||
<ModuleMemMajorThreshold1>0</ModuleMemMajorThreshold1>
|
||||
<ModuleMemMinorThreshold1>0</ModuleMemMinorThreshold1>
|
||||
<ModuleSwapCriticalThreshold1>90</ModuleSwapCriticalThreshold1>
|
||||
<ModuleSwapMajorThreshold1>80</ModuleSwapMajorThreshold1>
|
||||
<ModuleSwapMinorThreshold1>70</ModuleSwapMinorThreshold1>
|
||||
<ModuleDiskMonitorFileSystem1-1>/</ModuleDiskMonitorFileSystem1-1>
|
||||
<ModuleDBRootCount1-1>unassigned</ModuleDBRootCount1-1>
|
||||
<ModuleDBRootID1-1-1>unassigned</ModuleDBRootID1-1-1>
|
||||
<ModuleType2>um</ModuleType2>
|
||||
<ModuleDesc2>User Module</ModuleDesc2>
|
||||
<RunType2>SIMPLEX</RunType2>
|
||||
<ModuleCount2>1</ModuleCount2>
|
||||
<ModuleIPAddr1-1-2>0.0.0.0</ModuleIPAddr1-1-2>
|
||||
<ModuleHostName1-1-2>unassigned</ModuleHostName1-1-2>
|
||||
<ModuleDisableState1-2>ENABLED</ModuleDisableState1-2>
|
||||
<ModuleCPUCriticalThreshold2>0</ModuleCPUCriticalThreshold2>
|
||||
<ModuleCPUMajorThreshold2>0</ModuleCPUMajorThreshold2>
|
||||
<ModuleCPUMinorThreshold2>0</ModuleCPUMinorThreshold2>
|
||||
<ModuleCPUMinorClearThreshold2>0</ModuleCPUMinorClearThreshold2>
|
||||
<ModuleDiskCriticalThreshold2>90</ModuleDiskCriticalThreshold2>
|
||||
<ModuleDiskMajorThreshold2>80</ModuleDiskMajorThreshold2>
|
||||
<ModuleDiskMinorThreshold2>70</ModuleDiskMinorThreshold2>
|
||||
<ModuleMemCriticalThreshold2>90</ModuleMemCriticalThreshold2>
|
||||
<ModuleMemMajorThreshold2>0</ModuleMemMajorThreshold2>
|
||||
<ModuleMemMinorThreshold2>0</ModuleMemMinorThreshold2>
|
||||
<ModuleSwapCriticalThreshold2>90</ModuleSwapCriticalThreshold2>
|
||||
<ModuleSwapMajorThreshold2>80</ModuleSwapMajorThreshold2>
|
||||
<ModuleSwapMinorThreshold2>70</ModuleSwapMinorThreshold2>
|
||||
<ModuleDiskMonitorFileSystem1-2>/</ModuleDiskMonitorFileSystem1-2>
|
||||
<ModuleDBRootCount1-2>unassigned</ModuleDBRootCount1-2>
|
||||
<ModuleDBRootID1-1-2>unassigned</ModuleDBRootID1-1-2>
|
||||
<ModuleType3>pm</ModuleType3>
|
||||
<ModuleDesc3>Performance Module</ModuleDesc3>
|
||||
<RunType3>SIMPLEX</RunType3>
|
||||
<ModuleCount3>1</ModuleCount3>
|
||||
<ModuleIPAddr1-1-3>0.0.0.0</ModuleIPAddr1-1-3>
|
||||
<ModuleHostName1-1-3>unassigned</ModuleHostName1-1-3>
|
||||
<ModuleDisableState1-3>ENABLED</ModuleDisableState1-3>
|
||||
<ModuleCPUCriticalThreshold3>0</ModuleCPUCriticalThreshold3>
|
||||
<ModuleCPUMajorThreshold3>0</ModuleCPUMajorThreshold3>
|
||||
<ModuleCPUMinorThreshold3>0</ModuleCPUMinorThreshold3>
|
||||
<ModuleCPUMinorClearThreshold3>0</ModuleCPUMinorClearThreshold3>
|
||||
<ModuleDiskCriticalThreshold3>90</ModuleDiskCriticalThreshold3>
|
||||
<ModuleDiskMajorThreshold3>80</ModuleDiskMajorThreshold3>
|
||||
<ModuleDiskMinorThreshold3>70</ModuleDiskMinorThreshold3>
|
||||
<ModuleMemCriticalThreshold3>90</ModuleMemCriticalThreshold3>
|
||||
<ModuleMemMajorThreshold3>0</ModuleMemMajorThreshold3>
|
||||
<ModuleMemMinorThreshold3>0</ModuleMemMinorThreshold3>
|
||||
<ModuleSwapCriticalThreshold3>90</ModuleSwapCriticalThreshold3>
|
||||
<ModuleSwapMajorThreshold3>80</ModuleSwapMajorThreshold3>
|
||||
<ModuleSwapMinorThreshold3>70</ModuleSwapMinorThreshold3>
|
||||
<ModuleDiskMonitorFileSystem1-3>/</ModuleDiskMonitorFileSystem1-3>
|
||||
<ModuleDBRootCount1-3>1</ModuleDBRootCount1-3>
|
||||
<ModuleDBRootID1-1-3>1</ModuleDBRootID1-1-3>
|
||||
</SystemModuleConfig>
|
||||
<SystemExtDeviceConfig>
|
||||
<Count>0</Count>
|
||||
<Name1>unassigned</Name1>
|
||||
<IPAddr1>0.0.0.0</IPAddr1>
|
||||
<DisableState1>ENABLED</DisableState1>
|
||||
</SystemExtDeviceConfig>
|
||||
<SessionManager>
|
||||
<MaxConcurrentTransactions>1000</MaxConcurrentTransactions>
|
||||
<TxnIDFile>$INSTALLDIR/data1/systemFiles/dbrm/SMTxnID</TxnIDFile>
|
||||
</SessionManager>
|
||||
<VersionBuffer>
|
||||
<!-- VersionBufferFileSize must be a multiple of 8192.
|
||||
One version buffer file will be put on each DB root. -->
|
||||
<VersionBufferFileSize>1GB</VersionBufferFileSize>
|
||||
</VersionBuffer>
|
||||
<OIDManager>
|
||||
<!-- Do not change this file after database built -->
|
||||
<OIDBitmapFile>$INSTALLDIR/data1/systemFiles/dbrm/oidbitmap</OIDBitmapFile>
|
||||
<!-- Do not change this value after database built -->
|
||||
<FirstOID>3000</FirstOID>
|
||||
</OIDManager>
|
||||
<WriteEngine>
|
||||
<BulkRoot>$INSTALLDIR/data/bulk</BulkRoot>
|
||||
<BulkRollbackDir>$INSTALLDIR/data1/systemFiles/bulkRollback</BulkRollbackDir>
|
||||
<MaxFileSystemDiskUsagePct>98</MaxFileSystemDiskUsagePct>
|
||||
<CompressedPaddingBlocks>1</CompressedPaddingBlocks> <!-- Number of blocks used to pad compressed chunks -->
|
||||
</WriteEngine>
|
||||
<DBRM_Controller>
|
||||
<NumWorkers>1</NumWorkers>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8616</Port>
|
||||
</DBRM_Controller>
|
||||
<!-- Worker Port: 8700 - 8720 is reserved to support External Modules-->
|
||||
<DBRM_Worker1>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker1>
|
||||
<DBRM_Worker2>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker2>
|
||||
<DBRM_Worker3>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker3>
|
||||
<DBRM_Worker4>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker4>
|
||||
<DBRM_Worker5>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker5>
|
||||
<DBRM_Worker6>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker6>
|
||||
<DBRM_Worker7>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker7>
|
||||
<DBRM_Worker8>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker8>
|
||||
<DBRM_Worker9>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker9>
|
||||
<DBRM_Worker10>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker10>
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
|
||||
<!-- <NumBlocksPct>70</NumBlocksPct> -->
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
<IOMTracing>0</IOMTracing>
|
||||
<BRPTracing>0</BRPTracing>
|
||||
<ReportFrequency>65536</ReportFrequency>
|
||||
<MaxOpenFiles>2K</MaxOpenFiles>
|
||||
<DecreaseOpenFilesCount>200</DecreaseOpenFilesCount>
|
||||
<FDCacheTrace>0</FDCacheTrace>
|
||||
</DBBC>
|
||||
<Installation>
|
||||
<SystemStartupOffline>n</SystemStartupOffline>
|
||||
<InitialInstallFlag>n</InitialInstallFlag>
|
||||
<SingleServerInstall>n</SingleServerInstall>
|
||||
<ServerTypeInstall>2</ServerTypeInstall>
|
||||
<PMwithUM>n</PMwithUM>
|
||||
<MySQLRep>n</MySQLRep>
|
||||
<DBRootStorageType>internal</DBRootStorageType>
|
||||
<UMStorageType>internal</UMStorageType>
|
||||
<EEPackageType>rpm</EEPackageType>
|
||||
<SystemLogConfigFile>unassigned</SystemLogConfigFile>
|
||||
<rpw>mariadb1</rpw>
|
||||
<Cloud>unassigned</Cloud>
|
||||
<AmazonAccessKey>unassigned</AmazonAccessKey>
|
||||
<AmazonSecretKey>unassigned</AmazonSecretKey>
|
||||
<AmazonRegion>us-east-1</AmazonRegion>
|
||||
<AmazonZone>unassigned</AmazonZone>
|
||||
<AmazonSubNetID>unassigned</AmazonSubNetID>
|
||||
<AmazonVPCNextPrivateIP>autoassign</AmazonVPCNextPrivateIP>
|
||||
<UMInstanceType>unassigned</UMInstanceType>
|
||||
<UMSecurityGroup>unassigned</UMSecurityGroup>
|
||||
<UMVolumeSize>unassigned</UMVolumeSize>
|
||||
<UMVolumeType>standard</UMVolumeType>
|
||||
<UMVolumeIOPS>unassigned</UMVolumeIOPS>
|
||||
<PMInstanceType>unassigned</PMInstanceType>
|
||||
<PMVolumeSize>unassigned</PMVolumeSize>
|
||||
<PMVolumeType>standard</PMVolumeType>
|
||||
<PMVolumeIOPS>unassigned</PMVolumeIOPS>
|
||||
<AmazonPMFailover>y</AmazonPMFailover>
|
||||
<AmazonAutoTagging>y</AmazonAutoTagging>
|
||||
<AmazonElasticIPCount>0</AmazonElasticIPCount>
|
||||
<AmazonElasticIPAddr1>unassigned</AmazonElasticIPAddr1>
|
||||
<AmazonElasticModule1>unassigned</AmazonElasticModule1>
|
||||
<GlusterConfig>n</GlusterConfig>
|
||||
<GlusterCopies>0</GlusterCopies>
|
||||
<GlusterStorageType>unassigned</GlusterStorageType>
|
||||
<CoreFileFlag>n</CoreFileFlag>
|
||||
<JavaHome>unassigned</JavaHome>
|
||||
<JavaPath>unassigned</JavaPath>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
WARNING: these can only be changed on an empty system. Once any object has been allocated
|
||||
it cannot be changed!. Extent size is 8M rows.
|
||||
-->
|
||||
<FilesPerColumnPartition>4</FilesPerColumnPartition> <!-- should be multiple of DBRootCount -->
|
||||
<ExtentsPerSegmentFile>2</ExtentsPerSegmentFile>
|
||||
<BRM_UID>0x0</BRM_UID>
|
||||
</ExtentMap>
|
||||
<HashJoin>
|
||||
<MaxBuckets>128</MaxBuckets>
|
||||
<MaxElems>128K</MaxElems> <!-- 128 buckets * 128K * 16 = 256 MB -->
|
||||
<FifoSizeLargeSide>128</FifoSizeLargeSide>
|
||||
<PmMaxMemorySmallSide>64M</PmMaxMemorySmallSide><!-- divide by 48 to getapproximate row count -->
|
||||
<TotalUmMemory>50%</TotalUmMemory>
|
||||
<TotalPmUmMemory>10%</TotalPmUmMemory>
|
||||
<CPUniqueLimit>100</CPUniqueLimit>
|
||||
<AllowDiskBasedJoin>N</AllowDiskBasedJoin>
|
||||
<!-- Be careful modifying TempFilePath! On start, ExeMgr deletes
|
||||
the entire directory and recreates it to make sure no
|
||||
files are left behind. -->
|
||||
<TempFilePath>$INSTALLDIR/tmp</TempFilePath>
|
||||
<TempFileCompression>Y</TempFileCompression>
|
||||
</HashJoin>
|
||||
<JobList>
|
||||
<FlushInterval>16K</FlushInterval>
|
||||
<FifoSize>32</FifoSize>
|
||||
<RequestSize>1</RequestSize> <!-- Number of extents per request, should be
|
||||
less than MaxOutstandingRequests. Otherwise, default value 1 is used. -->
|
||||
<!-- ProcessorThreadsPerScan is the number of jobs issued to process
|
||||
each extent. The default is 16. MaxOutstandingRequests is the size of
|
||||
the window of work in terms of extents. A value of 20 means there
|
||||
is 20 extents worth of work for the PMs to process at any given time.
|
||||
ProcessorThreadsPerScan * MaxOutstandingRequests should be at least
|
||||
as many threads are available across all PMs. -->
|
||||
<!-- <ProcessorThreadsPerScan>16</ProcessorThreadsPerScan> -->
|
||||
<MaxOutstandingRequests>20</MaxOutstandingRequests>
|
||||
</JobList>
|
||||
<TupleWSDL>
|
||||
<MaxSize>1M</MaxSize> <!-- Max size in bytes per bucket -->
|
||||
<InitialCapacity>1M</InitialCapacity> <!-- Initial capacity per bucket -->
|
||||
<MaxBuckets>512</MaxBuckets> <!-- Number of buckets -->
|
||||
</TupleWSDL>
|
||||
<RowAggregation>
|
||||
<!-- <RowAggrThreads>4</RowAggrThreads> --> <!-- Default value is 4 or number of cores when less than 4 -->
|
||||
<!-- <RowAggrBuckets>32</RowAggrBuckets> --> <!-- Default value is number of cores * 4 -->
|
||||
<!-- <RowAggrRowGroupsPerThread>20</RowAggrRowGroupsPerThread> --> <!-- Default value is 20 -->
|
||||
</RowAggregation>
|
||||
<CrossEngineSupport>
|
||||
<Host>unassigned</Host>
|
||||
<Port>3306</Port>
|
||||
<User>unassigned</User>
|
||||
<Password></Password>
|
||||
</CrossEngineSupport>
|
||||
<QueryStats>
|
||||
<Enabled>N</Enabled>
|
||||
</QueryStats>
|
||||
<UserPriority>
|
||||
<Enabled>N</Enabled>
|
||||
</UserPriority>
|
||||
<NetworkCompression>
|
||||
<Enabled>Y</Enabled>
|
||||
</NetworkCompression>
|
||||
<QueryTele>
|
||||
<Host>127.0.0.1</Host>
|
||||
<Port>0</Port>
|
||||
</QueryTele>
|
||||
</Calpont>
|
||||
|
@ -1,530 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Id: Columnstore.xml 1286 2009-03-30 22:39:41Z dcathey $ -->
|
||||
<Calpont Version="V1.0.0">
|
||||
<ExeMgr1>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8601</Port>
|
||||
<Module>pm1</Module>
|
||||
</ExeMgr1>
|
||||
<JobProc>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8602</Port>
|
||||
</JobProc>
|
||||
<ProcMgr>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8603</Port>
|
||||
</ProcMgr>
|
||||
<ProcStatusControl>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8604</Port>
|
||||
</ProcStatusControl>
|
||||
<ProcStatusControlStandby>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8605</Port>
|
||||
</ProcStatusControlStandby>
|
||||
<localhost_ProcessMonitor>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</localhost_ProcessMonitor>
|
||||
<dm1_ProcessMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</dm1_ProcessMonitor>
|
||||
<um1_ProcessMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</um1_ProcessMonitor>
|
||||
<pm1_ProcessMonitor>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8800</Port>
|
||||
</pm1_ProcessMonitor>
|
||||
<dm1_ServerMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</dm1_ServerMonitor>
|
||||
<um1_ServerMonitor>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</um1_ServerMonitor>
|
||||
<pm1_ServerMonitor>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8622</Port>
|
||||
</pm1_ServerMonitor>
|
||||
<pm1_WriteEngineServer>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8630</Port>
|
||||
</pm1_WriteEngineServer>
|
||||
<DDLProc>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8612</Port>
|
||||
</DDLProc>
|
||||
<DMLProc>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8614</Port>
|
||||
</DMLProc>
|
||||
<BatchInsert>
|
||||
<RowsPerBatch>10000</RowsPerBatch>
|
||||
</BatchInsert>
|
||||
<PrimitiveServers>
|
||||
<Count>1</Count>
|
||||
<ConnectionsPerPrimProc>8</ConnectionsPerPrimProc>
|
||||
<ProcessorThreshold>128</ProcessorThreshold>
|
||||
<!-- <ProcessorThreads>16</ProcessorThreads> --> <!-- defaults to num cores * 2 -->
|
||||
<ProcessorQueueSize>10K</ProcessorQueueSize> <!-- minimum of extent size 8192 -->
|
||||
<DebugLevel>0</DebugLevel>
|
||||
<LBID_Shift>13</LBID_Shift>
|
||||
<ColScanBufferSizeBlocks>512</ColScanBufferSizeBlocks>
|
||||
<ColScanReadAheadBlocks>512</ColScanReadAheadBlocks> <!-- s/b factor of extent size 8192 -->
|
||||
<!-- <BPPCount>16</BPPCount> --> <!-- Default num cores * 2. A cap on the number of simultaneous primitives per jobstep -->
|
||||
<PrefetchThreshold>1</PrefetchThreshold>
|
||||
<PTTrace>0</PTTrace>
|
||||
<RotatingDestination>n</RotatingDestination>
|
||||
<!-- <HighPriorityPercentage>60</HighPriorityPercentage> -->
|
||||
<!-- <MediumPriorityPercentage>30</MediumPriorityPercentage> -->
|
||||
<!-- <LowPriorityPercentage>10</LowPriorityPercentage> -->
|
||||
<AggregationMemoryCheck>95</AggregationMemoryCheck>
|
||||
</PrimitiveServers>
|
||||
<PMS1>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS1>
|
||||
<PMS2>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS2>
|
||||
<PMS3>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS3>
|
||||
<PMS4>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS4>
|
||||
<PMS5>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS5>
|
||||
<PMS6>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS6>
|
||||
<PMS7>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS7>
|
||||
<PMS8>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS8>
|
||||
<PMS9>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS9>
|
||||
<PMS10>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS10>
|
||||
<PMS11>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS11>
|
||||
<PMS12>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS12>
|
||||
<PMS13>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS13>
|
||||
<PMS14>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS14>
|
||||
<PMS15>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS15>
|
||||
<PMS16>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS16>
|
||||
<PMS17>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS17>
|
||||
<PMS18>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS18>
|
||||
<PMS19>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS19>
|
||||
<PMS20>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS20>
|
||||
<PMS21>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS21>
|
||||
<PMS22>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS22>
|
||||
<PMS23>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS23>
|
||||
<PMS24>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS24>
|
||||
<PMS25>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS25>
|
||||
<PMS26>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS26>
|
||||
<PMS27>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS27>
|
||||
<PMS28>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS28>
|
||||
<PMS29>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS29>
|
||||
<PMS30>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS30>
|
||||
<PMS31>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS31>
|
||||
<PMS32>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8620</Port>
|
||||
</PMS32>
|
||||
<SystemConfig>
|
||||
<SystemLang>C</SystemLang>
|
||||
<SystemName>columnstore-1</SystemName>
|
||||
<ParentOAMModuleName>pm1</ParentOAMModuleName>
|
||||
<StandbyOAMModuleName>unassigned</StandbyOAMModuleName>
|
||||
<!-- Disabled
|
||||
<ProcessHeartbeatPeriod>-1</ProcessHeartbeatPeriod>
|
||||
-->
|
||||
<!-- Warning: Do not change this value once database is built -->
|
||||
<DBRootCount>1</DBRootCount>
|
||||
<DBRoot1>$INSTALLDIR/data1</DBRoot1>
|
||||
<DBRMRoot>$INSTALLDIR/data1/systemFiles/dbrm/BRM_saves</DBRMRoot>
|
||||
<TableLockSaveFile>$INSTALLDIR/data1/systemFiles/dbrm/tablelocks</TableLockSaveFile>
|
||||
<DBRMTimeOut>20</DBRMTimeOut> <!-- in seconds -->
|
||||
<DBRMSnapshotInterval>100000</DBRMSnapshotInterval>
|
||||
<ExternalCriticalThreshold>90</ExternalCriticalThreshold>
|
||||
<ExternalMajorThreshold>80</ExternalMajorThreshold>
|
||||
<ExternalMinorThreshold>70</ExternalMinorThreshold>
|
||||
<TempDiskPath>/tmp</TempDiskPath>
|
||||
<WorkingDir>/tmp</WorkingDir>
|
||||
<TransactionArchivePeriod>10</TransactionArchivePeriod>
|
||||
<NMSIPAddress>0.0.0.0</NMSIPAddress>
|
||||
<TempSaveSize>128M</TempSaveSize> <!-- default SWSDL max element save size -->
|
||||
<WaitPeriod>10</WaitPeriod> <!-- in seconds -->
|
||||
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
|
||||
<CalpontHome>$INSTALLDIR</CalpontHome>
|
||||
<ModuleHeartbeatPeriod>10</ModuleHeartbeatPeriod>
|
||||
<ModuleHeartbeatCount>3</ModuleHeartbeatCount>
|
||||
<ProcessRestartCount>10</ProcessRestartCount>
|
||||
<ProcessRestartPeriod>120</ProcessRestartPeriod>
|
||||
<SwapAction>restartSystem</SwapAction> <!-- OAM command (or 'none') to run when swap space exceeds Major Threshold -->
|
||||
<ActivePmFailoverDisabled>n</ActivePmFailoverDisabled>
|
||||
<MemoryCheckPercent>95</MemoryCheckPercent> <!-- Max real memory to limit growth of buffers to -->
|
||||
<DataFileLog>OFF</DataFileLog>
|
||||
<!-- enable if you want to limit how much memory may be used for hdfs read/write memory buffers.
|
||||
<hdfsRdwrBufferMaxSize>8G</hdfsRdwrBufferMaxSize>
|
||||
-->
|
||||
<hdfsRdwrScratch>/tmp/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
|
||||
</SystemConfig>
|
||||
<SystemModuleConfig>
|
||||
<ModuleType1>dm</ModuleType1>
|
||||
<ModuleDesc1>Director Module</ModuleDesc1>
|
||||
<RunType1>SIMPLEX</RunType1>
|
||||
<ModuleCount1>0</ModuleCount1>
|
||||
<ModuleIPAddr1-1-1>0.0.0.0</ModuleIPAddr1-1-1>
|
||||
<ModuleHostName1-1-1>unassigned</ModuleHostName1-1-1>
|
||||
<ModuleDisableState1-1>ENABLED</ModuleDisableState1-1>
|
||||
<ModuleCPUCriticalThreshold1>0</ModuleCPUCriticalThreshold1>
|
||||
<ModuleCPUMajorThreshold1>0</ModuleCPUMajorThreshold1>
|
||||
<ModuleCPUMinorThreshold1>0</ModuleCPUMinorThreshold1>
|
||||
<ModuleCPUMinorClearThreshold1>0</ModuleCPUMinorClearThreshold1>
|
||||
<ModuleDiskCriticalThreshold1>90</ModuleDiskCriticalThreshold1>
|
||||
<ModuleDiskMajorThreshold1>80</ModuleDiskMajorThreshold1>
|
||||
<ModuleDiskMinorThreshold1>70</ModuleDiskMinorThreshold1>
|
||||
<ModuleMemCriticalThreshold1>90</ModuleMemCriticalThreshold1>
|
||||
<ModuleMemMajorThreshold1>0</ModuleMemMajorThreshold1>
|
||||
<ModuleMemMinorThreshold1>0</ModuleMemMinorThreshold1>
|
||||
<ModuleSwapCriticalThreshold1>90</ModuleSwapCriticalThreshold1>
|
||||
<ModuleSwapMajorThreshold1>80</ModuleSwapMajorThreshold1>
|
||||
<ModuleSwapMinorThreshold1>70</ModuleSwapMinorThreshold1>
|
||||
<ModuleDiskMonitorFileSystem1-1>/</ModuleDiskMonitorFileSystem1-1>
|
||||
<ModuleDBRootCount1-1>unassigned</ModuleDBRootCount1-1>
|
||||
<ModuleDBRootID1-1-1>unassigned</ModuleDBRootID1-1-1>
|
||||
<ModuleType2>um</ModuleType2>
|
||||
<ModuleDesc2>User Module</ModuleDesc2>
|
||||
<RunType2>SIMPLEX</RunType2>
|
||||
<ModuleCount2>0</ModuleCount2>
|
||||
<ModuleIPAddr1-1-2>0.0.0.0</ModuleIPAddr1-1-2>
|
||||
<ModuleHostName1-1-2>unassigned</ModuleHostName1-1-2>
|
||||
<ModuleDisableState1-2>ENABLED</ModuleDisableState1-2>
|
||||
<ModuleCPUCriticalThreshold2>0</ModuleCPUCriticalThreshold2>
|
||||
<ModuleCPUMajorThreshold2>0</ModuleCPUMajorThreshold2>
|
||||
<ModuleCPUMinorThreshold2>0</ModuleCPUMinorThreshold2>
|
||||
<ModuleCPUMinorClearThreshold2>0</ModuleCPUMinorClearThreshold2>
|
||||
<ModuleDiskCriticalThreshold2>90</ModuleDiskCriticalThreshold2>
|
||||
<ModuleDiskMajorThreshold2>80</ModuleDiskMajorThreshold2>
|
||||
<ModuleDiskMinorThreshold2>70</ModuleDiskMinorThreshold2>
|
||||
<ModuleMemCriticalThreshold2>90</ModuleMemCriticalThreshold2>
|
||||
<ModuleMemMajorThreshold2>0</ModuleMemMajorThreshold2>
|
||||
<ModuleMemMinorThreshold2>0</ModuleMemMinorThreshold2>
|
||||
<ModuleSwapCriticalThreshold2>90</ModuleSwapCriticalThreshold2>
|
||||
<ModuleSwapMajorThreshold2>80</ModuleSwapMajorThreshold2>
|
||||
<ModuleSwapMinorThreshold2>70</ModuleSwapMinorThreshold2>
|
||||
<ModuleDiskMonitorFileSystem1-2>/</ModuleDiskMonitorFileSystem1-2>
|
||||
<ModuleDBRootCount1-2>unassigned</ModuleDBRootCount1-2>
|
||||
<ModuleDBRootID1-1-2>unassigned</ModuleDBRootID1-1-2>
|
||||
<ModuleType3>pm</ModuleType3>
|
||||
<ModuleDesc3>Performance Module</ModuleDesc3>
|
||||
<RunType3>SIMPLEX</RunType3>
|
||||
<ModuleCount3>1</ModuleCount3>
|
||||
<ModuleIPAddr1-1-3>127.0.0.1</ModuleIPAddr1-1-3>
|
||||
<ModuleHostName1-1-3>localhost</ModuleHostName1-1-3>
|
||||
<ModuleDisableState1-3>ENABLED</ModuleDisableState1-3>
|
||||
<ModuleCPUCriticalThreshold3>0</ModuleCPUCriticalThreshold3>
|
||||
<ModuleCPUMajorThreshold3>0</ModuleCPUMajorThreshold3>
|
||||
<ModuleCPUMinorThreshold3>0</ModuleCPUMinorThreshold3>
|
||||
<ModuleCPUMinorClearThreshold3>0</ModuleCPUMinorClearThreshold3>
|
||||
<ModuleDiskCriticalThreshold3>90</ModuleDiskCriticalThreshold3>
|
||||
<ModuleDiskMajorThreshold3>80</ModuleDiskMajorThreshold3>
|
||||
<ModuleDiskMinorThreshold3>70</ModuleDiskMinorThreshold3>
|
||||
<ModuleMemCriticalThreshold3>90</ModuleMemCriticalThreshold3>
|
||||
<ModuleMemMajorThreshold3>0</ModuleMemMajorThreshold3>
|
||||
<ModuleMemMinorThreshold3>0</ModuleMemMinorThreshold3>
|
||||
<ModuleSwapCriticalThreshold3>90</ModuleSwapCriticalThreshold3>
|
||||
<ModuleSwapMajorThreshold3>80</ModuleSwapMajorThreshold3>
|
||||
<ModuleSwapMinorThreshold3>70</ModuleSwapMinorThreshold3>
|
||||
<ModuleDiskMonitorFileSystem1-3>/</ModuleDiskMonitorFileSystem1-3>
|
||||
<ModuleDBRootCount1-3>1</ModuleDBRootCount1-3>
|
||||
<ModuleDBRootID1-1-3>1</ModuleDBRootID1-1-3>
|
||||
</SystemModuleConfig>
|
||||
<SystemExtDeviceConfig>
|
||||
<Count>0</Count>
|
||||
<Name1>unassigned</Name1>
|
||||
<IPAddr1>0.0.0.0</IPAddr1>
|
||||
<DisableState1>ENABLED</DisableState1>
|
||||
</SystemExtDeviceConfig>
|
||||
<SessionManager>
|
||||
<MaxConcurrentTransactions>1000</MaxConcurrentTransactions>
|
||||
<SharedMemoryTmpFile>$INSTALLDIR/data1/systemFiles/dbrm/CalpontShm</SharedMemoryTmpFile>
|
||||
<TxnIDFile>$INSTALLDIR/data1/systemFiles/dbrm/SMTxnID</TxnIDFile>
|
||||
</SessionManager>
|
||||
<SessionMonitor>
|
||||
<SharedMemoryTmpFile>$INSTALLDIR/data1/systemFiles/dbrm/CalpontSessionMonitorShm</SharedMemoryTmpFile>
|
||||
<TransactionAgeLimit>10</TransactionAgeLimit>
|
||||
</SessionMonitor>
|
||||
<VersionBuffer>
|
||||
<!-- VersionBufferFileSize must be a multiple of 8192.
|
||||
One version buffer file will be put on each DB root. -->
|
||||
<VersionBufferFileSize>1GB</VersionBufferFileSize>
|
||||
</VersionBuffer>
|
||||
<OIDManager>
|
||||
<!-- XXXPAT: This is located in tmp so we all have R/W access.
|
||||
It should be relocated to $INSTALLDIR/share/oidbitmap
|
||||
on the production machine-->
|
||||
<!-- Do not change this file after database built -->
|
||||
<OIDBitmapFile>$INSTALLDIR/data1/systemFiles/dbrm/oidbitmap</OIDBitmapFile>
|
||||
<!-- Do not change this value after database built -->
|
||||
<FirstOID>3000</FirstOID>
|
||||
</OIDManager>
|
||||
<WriteEngine>
|
||||
<BulkRoot>$INSTALLDIR/data/bulk</BulkRoot>
|
||||
<BulkRollbackDir>$INSTALLDIR/data/bulk/rollback</BulkRollbackDir>
|
||||
<MaxFileSystemDiskUsagePct>98</MaxFileSystemDiskUsagePct>
|
||||
<CompressedPaddingBlocks>1</CompressedPaddingBlocks> <!-- Number of blocks used to pad compressed chunks -->
|
||||
</WriteEngine>
|
||||
<DBRM_Controller>
|
||||
<NumWorkers>1</NumWorkers>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8616</Port>
|
||||
</DBRM_Controller>
|
||||
<!-- Worker Port: 8700 - 8720 is reserved to support External Modules-->
|
||||
<DBRM_Worker1>
|
||||
<IPAddr>127.0.0.1</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>pm1</Module>
|
||||
</DBRM_Worker1>
|
||||
<DBRM_Worker2>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker2>
|
||||
<DBRM_Worker3>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker3>
|
||||
<DBRM_Worker4>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker4>
|
||||
<DBRM_Worker5>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker5>
|
||||
<DBRM_Worker6>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker6>
|
||||
<DBRM_Worker7>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker7>
|
||||
<DBRM_Worker8>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker8>
|
||||
<DBRM_Worker9>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker9>
|
||||
<DBRM_Worker10>
|
||||
<IPAddr>0.0.0.0</IPAddr>
|
||||
<Port>8700</Port>
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker10>
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 86% -->
|
||||
<NumBlocksPct>50</NumBlocksPct>
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
<IOMTracing>0</IOMTracing>
|
||||
<BRPTracing>0</BRPTracing>
|
||||
<ReportFrequency>65536</ReportFrequency>
|
||||
<MaxOpenFiles>2K</MaxOpenFiles>
|
||||
<DecreaseOpenFilesCount>200</DecreaseOpenFilesCount>
|
||||
<FDCacheTrace>0</FDCacheTrace>
|
||||
</DBBC>
|
||||
<Installation>
|
||||
<SystemStartupOffline>n</SystemStartupOffline>
|
||||
<InitialInstallFlag>y</InitialInstallFlag>
|
||||
<SingleServerInstall>y</SingleServerInstall>
|
||||
<ServerTypeInstall>2</ServerTypeInstall>
|
||||
<PMwithUM>n</PMwithUM>
|
||||
<MySQLRep>n</MySQLRep>
|
||||
<DBRootStorageType>internal</DBRootStorageType>
|
||||
<UMStorageType>internal</UMStorageType>
|
||||
<SystemLogConfigFile>unassigned</SystemLogConfigFile>
|
||||
<rpw>unassigned</rpw>
|
||||
<Cloud>unassigned</Cloud>
|
||||
<EEPackageType>rpm</EEPackageType>
|
||||
<AmazonAccessKey>unassigned</AmazonAccessKey>
|
||||
<AmazonSecretKey>unassigned</AmazonSecretKey>
|
||||
<AmazonRegion>us-east-1</AmazonRegion>
|
||||
<AmazonZone>unassigned</AmazonZone>
|
||||
<AmazonSubNetID>unassigned</AmazonSubNetID>
|
||||
<AmazonVPCNextPrivateIP>unassigned</AmazonVPCNextPrivateIP>
|
||||
<PMInstanceType>unassigned</PMInstanceType>
|
||||
<UMInstanceType>unassigned</UMInstanceType>
|
||||
<UMSecurityGroup>unassigned</UMSecurityGroup>
|
||||
<UMVolumeSize>unassigned</UMVolumeSize>
|
||||
<PMVolumeSize>unassigned</PMVolumeSize>
|
||||
<AmazonPMFailover>n</AmazonPMFailover>
|
||||
<AmazonAutoTagging>n</AmazonAutoTagging>
|
||||
<AmazonElasticIPCount>0</AmazonElasticIPCount>
|
||||
<AmazonElasticIPAddr1>unassigned</AmazonElasticIPAddr1>
|
||||
<AmazonElasticModule1>unassigned</AmazonElasticModule1>
|
||||
<CoreFileFlag>n</CoreFileFlag>
|
||||
<JavaHome>unassigned</JavaHome>
|
||||
<JavaPath>unassigned</JavaPath>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
WARNING: these can only be changed on an empty system. Once any object has been allocated
|
||||
it cannot be changed!. Valid values for ExtentRows are: 64M, 8M and 1M. The default is 8M.
|
||||
-->
|
||||
<FilesPerColumnPartition>4</FilesPerColumnPartition> <!-- should be multiple of DBRootCount -->
|
||||
<ExtentsPerSegmentFile>2</ExtentsPerSegmentFile>
|
||||
<BRM_UID>0x0</BRM_UID>
|
||||
</ExtentMap>
|
||||
<HashJoin>
|
||||
<MaxBuckets>128</MaxBuckets>
|
||||
<MaxElems>128K</MaxElems> <!-- 128 buckets * 128K * 16 = 256 MB -->
|
||||
<FifoSizeLargeSide>128</FifoSizeLargeSide>
|
||||
<PmMaxMemorySmallSide>64M</PmMaxMemorySmallSide><!-- divide by 48 to get element count -->
|
||||
<TotalUmMemory>25%</TotalUmMemory>
|
||||
<TotalPmUmMemory>10%</TotalPmUmMemory>
|
||||
<CPUniqueLimit>100</CPUniqueLimit>
|
||||
<AllowDiskBasedJoin>N</AllowDiskBasedJoin>
|
||||
<!-- Be careful modifying TempFilePath! On start, ExeMgr deletes
|
||||
the entire directory and recreates it to make sure no
|
||||
files are left behind. -->
|
||||
<TempFilePath>$INSTALLDIR/tmp</TempFilePath>
|
||||
<TempFileCompression>Y</TempFileCompression>
|
||||
</HashJoin>
|
||||
<JobList>
|
||||
<FlushInterval>16K</FlushInterval>
|
||||
<FifoSize>32</FifoSize>
|
||||
<RequestSize>1</RequestSize> <!-- Number of extents per request, should be
|
||||
less than MaxOutstandingRequests. Otherwise, default value 1 is used. -->
|
||||
<!-- ProcessorThreadsPerScan is the number of jobs issued to process
|
||||
each extent. The default is 16. MaxOutstandingRequests is the size of
|
||||
the window of work in terms of extents. A value of 20 means there
|
||||
is 20 extents worth of work for the PMs to process at any given time.
|
||||
ProcessorThreadsPerScan * MaxOutstandingRequests should be at least
|
||||
as many threads are available across all PMs. -->
|
||||
<!-- <ProcessorThreadsPerScan>16</ProcessorThreadsPerScan> -->
|
||||
<MaxOutstandingRequests>20</MaxOutstandingRequests>
|
||||
</JobList>
|
||||
<TupleWSDL>
|
||||
<MaxSize>1M</MaxSize> <!-- Max size in bytes per bucket -->
|
||||
<InitialCapacity>1M</InitialCapacity> <!-- Initial capacity per bucket -->
|
||||
<MaxBuckets>512</MaxBuckets> <!-- Number of buckets -->
|
||||
</TupleWSDL>
|
||||
<RowAggregation>
|
||||
<!-- <RowAggrThreads>4</RowAggrThreads> --> <!-- Default value is 4 or number of cores when less than 4 -->
|
||||
<!-- <RowAggrBuckets>32</RowAggrBuckets> --> <!-- Default value is number of cores * 4 -->
|
||||
<!-- <RowAggrRowGroupsPerThread>20</RowAggrRowGroupsPerThread> --> <!-- Default value is 20 -->
|
||||
</RowAggregation>
|
||||
<CrossEngineSupport>
|
||||
<Host>unassigned</Host>
|
||||
<Port>3306</Port>
|
||||
<User>unassigned</User>
|
||||
<Password></Password>
|
||||
</CrossEngineSupport>
|
||||
<QueryStats>
|
||||
<Enabled>N</Enabled>
|
||||
</QueryStats>
|
||||
<UserPriority>
|
||||
<Enabled>N</Enabled>
|
||||
</UserPriority>
|
||||
<NetworkCompression>
|
||||
<Enabled>Y</Enabled>
|
||||
</NetworkCompression>
|
||||
<QueryTele>
|
||||
<Host>127.0.0.1</Host>
|
||||
<Port>0</Port>
|
||||
</QueryTele>
|
||||
</Calpont>
|
@ -249,13 +249,14 @@
|
||||
<ExternalCriticalThreshold>90</ExternalCriticalThreshold>
|
||||
<ExternalMajorThreshold>80</ExternalMajorThreshold>
|
||||
<ExternalMinorThreshold>70</ExternalMinorThreshold>
|
||||
<TempDiskPath>/tmp</TempDiskPath>
|
||||
<!-- <TempDiskPath>/tmp</TempDiskPath>
|
||||
<WorkingDir>/tmp</WorkingDir>
|
||||
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
|
||||
-->
|
||||
<TransactionArchivePeriod>10</TransactionArchivePeriod>
|
||||
<NMSIPAddress>0.0.0.0</NMSIPAddress>
|
||||
<TempSaveSize>128M</TempSaveSize> <!-- default SWSDL max element save size -->
|
||||
<WaitPeriod>10</WaitPeriod> <!-- in seconds -->
|
||||
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
|
||||
<CalpontHome>$INSTALLDIR</CalpontHome>
|
||||
<ProcessRestartCount>10</ProcessRestartCount>
|
||||
<ProcessRestartPeriod>120</ProcessRestartPeriod>
|
||||
@ -266,7 +267,9 @@
|
||||
<!-- enable if you want to limit how much memory may be used for hdfs read/write memory buffers.
|
||||
<hdfsRdwrBufferMaxSize>8G</hdfsRdwrBufferMaxSize>
|
||||
-->
|
||||
<hdfsRdwrScratch>/tmp/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
|
||||
<hdfsRdwrScratch>/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
|
||||
<TempFileDir>/columnstore_tmp_files</TempFileDir>
|
||||
<SystemTempFileDir>/tmp/columnstore_tmp_files</SystemTempFileDir>
|
||||
</SystemConfig>
|
||||
<SystemModuleConfig>
|
||||
<ModuleType1>dm</ModuleType1>
|
||||
@ -424,6 +427,8 @@
|
||||
</DBRM_Worker10>
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
|
||||
<!-- Alternatively, this can be specified in absolute terms using
|
||||
the suffixes 'm' or 'g' to denote size in megabytes or gigabytes.-->
|
||||
<!-- <NumBlocksPct>70</NumBlocksPct> -->
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
@ -445,7 +450,6 @@
|
||||
<UMStorageType>internal</UMStorageType>
|
||||
<EEPackageType>rpm</EEPackageType>
|
||||
<SystemLogConfigFile>unassigned</SystemLogConfigFile>
|
||||
<rpw>mariadb1</rpw>
|
||||
<Cloud>unassigned</Cloud>
|
||||
<AmazonVPCNextPrivateIP>autoassign</AmazonVPCNextPrivateIP>
|
||||
<UMInstanceType>unassigned</UMInstanceType>
|
||||
@ -469,6 +473,8 @@
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||
<DistributedInstall>n</DistributedInstall>
|
||||
<LockFileDirectory>/var/lock/subsys</LockFileDirectory>
|
||||
<ProfileFile>unassigned</ProfileFile>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
@ -490,8 +496,8 @@
|
||||
<AllowDiskBasedJoin>N</AllowDiskBasedJoin>
|
||||
<!-- Be careful modifying TempFilePath! On start, ExeMgr deletes
|
||||
the entire directory and recreates it to make sure no
|
||||
files are left behind. -->
|
||||
<TempFilePath>$INSTALLDIR/tmp</TempFilePath>
|
||||
files are left behind.
|
||||
<TempFilePath>/tmp</TempFilePath> -->
|
||||
<TempFileCompression>Y</TempFileCompression>
|
||||
</HashJoin>
|
||||
<JobList>
|
||||
|
@ -418,7 +418,9 @@
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker10>
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 86% -->
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
|
||||
<!-- Alternatively, this can be specified in absolute terms using
|
||||
the suffixes 'm' or 'g' to denote size in megabytes or gigabytes.-->
|
||||
<NumBlocksPct>50</NumBlocksPct>
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
@ -463,6 +465,7 @@
|
||||
<JavaPath>unassigned</JavaPath>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<DistributedInstall>y</DistributedInstall>
|
||||
<LockFileDirectory>/var/lock/subsys</LockFileDirectory>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
|
@ -260,7 +260,8 @@
|
||||
<Arg3>Optional: Module-name and Parameter-name will display the Module Name Configuration parameter</Arg3>
|
||||
</Cmd38>
|
||||
<Cmd39>
|
||||
<Name>AVAILABLE</Name>
|
||||
<Name>getSystemDirectories</Name>
|
||||
<Desc1>Get System Installation and Temporary Logging Directories</Desc1>
|
||||
</Cmd39>
|
||||
<Cmd40>
|
||||
<Name>AVAILABLE</Name>
|
||||
|
@ -11,7 +11,6 @@ install(PROGRAMS post-install
|
||||
remote_scp_get.sh
|
||||
columnstoreAlias
|
||||
run.sh
|
||||
upgrade-columnstore.sh
|
||||
post-mysql-install
|
||||
post-mysqld-install
|
||||
binary_installer.sh
|
||||
|
@ -67,7 +67,7 @@ send_user "\n"
|
||||
|
||||
|
||||
send_user "Stop ColumnStore service "
|
||||
send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore stop'\n"
|
||||
send "ssh -v $USERNAME@$SERVER 'export COLUMNSTORE_INSTALL_DIR=$INSTALLDIR; $INSTALLDIR/bin/columnstore stop'\n"
|
||||
set timeout 60
|
||||
# check return
|
||||
expect {
|
||||
@ -133,7 +133,7 @@ send_user "\n"
|
||||
#
|
||||
send_user "Install MariaDB Columnstore Package on Module "
|
||||
send_user " \n"
|
||||
send "ssh -v $USERNAME@$SERVER 'tar -C $PREFIX --exclude db -zxvf $CALPONTPKG'\n"
|
||||
send "ssh -v $USERNAME@$SERVER 'tar -C $PREFIX --exclude db -zxf $CALPONTPKG'\n"
|
||||
set timeout 360
|
||||
expect {
|
||||
"word: " { send "$PASSWORD\n"
|
||||
@ -214,7 +214,7 @@ send_user "\n"
|
||||
|
||||
send_user "Start ColumnStore service "
|
||||
send_user " \n"
|
||||
send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore restart'\n"
|
||||
send "ssh -v $USERNAME@$SERVER 'export COLUMNSTORE_INSTALL_DIR=$INSTALLDIR; $INSTALLDIR/bin/columnstore restart'\n"
|
||||
set timeout 120
|
||||
# check return
|
||||
expect {
|
||||
|
@ -1,13 +0,0 @@
|
||||
# InfiniDB Alias Commands
|
||||
#
|
||||
alias mcsmysql='/usr/local/Calpont/mysql/bin/mysql --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root'
|
||||
alias ma=/usr/local/Calpont/bin/mcsadmin
|
||||
alias mcsadmin=/usr/local/Calpont/bin/mcsadmin
|
||||
alias home='cd /usr/local/mariadb/columnstore'
|
||||
alias log='cd /var/log/mariadb/columnstore/'
|
||||
alias core='cd /var/log/mariadb/columnstore/corefiles'
|
||||
alias tmsg='tail -f /var/log/messages'
|
||||
alias tdebug='tail -f /var/log/mariadb/columnstore/debug.log'
|
||||
alias tinfo='tail -f /var/log/mariadb/columnstore/info.log'
|
||||
alias dbrm='cd /usr/local/Calpont/data1/systemFiles/dbrm'
|
||||
alias module='cat /usr/local/Calpont/local/module'
|
@ -1,167 +0,0 @@
|
||||
#!/usr/bin/expect
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Install Package on system
|
||||
|
||||
set timeout 30
|
||||
set USERNAME "root"
|
||||
set RPMVERSION " "
|
||||
set PASSWORD " "
|
||||
set MYSQLPASSWORD dummymysqlpw
|
||||
set PACKAGE " "
|
||||
set CONFIGFILE " "
|
||||
set DEBUG 0
|
||||
set NODEPS "-h"
|
||||
set INSTALLDIR "/usr/local/mariadb/columnstore"
|
||||
|
||||
spawn -noecho /bin/bash
|
||||
|
||||
for {set i 0} {$i<[llength $argv]} {incr i} {
|
||||
set arg($i) [lindex $argv $i]
|
||||
}
|
||||
|
||||
set i 0
|
||||
while true {
|
||||
if { $i == [llength $argv] } { break }
|
||||
if { $arg($i) == "-h" } {
|
||||
send_user "\n"
|
||||
send_user "'calpontInstaller.sh' performs a system install of the Calpont InfiniDB Packages\n"
|
||||
send_user "from the /root/ directory. These Packages would have already been installed\n"
|
||||
send_user "on the local Module.\n"
|
||||
send_user "Usage: calpontInstaller.sh -v 'infinidb-version' -p 'password' -t 'package-type' -c 'config-file'-m 'mysql-password' -d\n"
|
||||
send_user " infinidb-version - InfiniDB Version, i.e. 1.0.0-1\n"
|
||||
send_user " password - root password on the servers being installed'\n"
|
||||
send_user " package-type - Package Type being installed (rpm, deb, or binary)\n"
|
||||
send_user " config-file - Optional: Columnstore.xml config file with directory location, i.e. /root/Columnstore.xml\n"
|
||||
send_user " Default version is $INSTALLDIR/etc/Columnstore.xml.rpmsave\n"
|
||||
send_user " mysql-password - MySQL password on the servers being installed'\n"
|
||||
send_user " -d - Debug flag, output verbose information\n"
|
||||
exit 0
|
||||
} elseif { $arg($i) == "-v" } {
|
||||
incr i
|
||||
set RPMVERSION $arg($i)
|
||||
} elseif { $arg($i) == "-p" } {
|
||||
incr i
|
||||
set PASSWORD $arg($i)
|
||||
} elseif { $arg($i) == "-t" } {
|
||||
incr i
|
||||
set PACKAGE $arg($i)
|
||||
} elseif { $arg($i) == "-c" } {
|
||||
incr i
|
||||
set CONFIGFILE $arg($i)
|
||||
} elseif { $arg($i) == "-d" } {
|
||||
set DEBUG 1
|
||||
} elseif { $arg($i) == "-f" } {
|
||||
set NODEPS "--nodeps"
|
||||
} elseif { $arg($i) == "-m" } {
|
||||
incr i
|
||||
set MYSQLPASSWORD $arg($i)
|
||||
} elseif { $arg($i) == "-i" } {
|
||||
incr i
|
||||
set INSTALLDIR $arg($i)
|
||||
} elseif { $arg($i) == "-u" } {
|
||||
incr i
|
||||
set USERNAME $arg($i)
|
||||
}
|
||||
incr i
|
||||
}
|
||||
|
||||
log_user $DEBUG
|
||||
|
||||
set timeout 2
|
||||
send "$INSTALLDIR/bin/infinidb status\n"
|
||||
expect {
|
||||
"is running" { puts "InfiniDB is running, can't run calpontInstall.sh while InfiniDB is running. Exiting..\n";
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
if { $CONFIGFILE == " " } {
|
||||
set CONFIGFILE $INSTALLDIR/etc/Columnstore.xml.rpmsave
|
||||
}
|
||||
|
||||
if { [catch { open $CONFIGFILE "r"} handle ] } {
|
||||
puts "Calpont Config file not found: $CONFIGFILE"; exit 1
|
||||
}
|
||||
|
||||
exec rm -f $INSTALLDIR/etc/Columnstore.xml.new > /dev/null 2>&1
|
||||
exec mv -f $INSTALLDIR/etc/Columnstore.xml $INSTALLDIR/etc/Columnstore.xml.new > /dev/null 2>&1
|
||||
exec /bin/cp -f $CONFIGFILE $INSTALLDIR/etc/Columnstore.xml > /dev/null 2>&1
|
||||
|
||||
set timeout 2
|
||||
set INSTALL 2
|
||||
send "$INSTALLDIR/bin/getConfig DBRM_Controller NumWorkers\n"
|
||||
expect {
|
||||
1 { set INSTALL 1
|
||||
set PASSWORD "dummy"
|
||||
set RPMVERSION "rpm" }
|
||||
}
|
||||
|
||||
|
||||
if { $INSTALL == "2" && $PASSWORD == " "} {puts "please enter the remote server root password, enter ./calpontInstaller.sh -h for additional info"; exit 1}
|
||||
|
||||
if { $INSTALL == "2" && $RPMVERSION == " " } {puts "please enter Package version, enter ./calpontInstaller.sh -h for additional info"; exit 1}
|
||||
|
||||
send_user "\n"
|
||||
|
||||
if { $INSTALL == "2" } {
|
||||
if { $PACKAGE == "rpm" } {
|
||||
set CALPONTPACKAGE1 /root/infinidb-libs-$RPMVERSION*.rpm
|
||||
set CALPONTPACKAGE2 /root/infinidb-platform-$RPMVERSION*.rpm
|
||||
set CALPONTPACKAGE3 /root/infinidb-enterprise-$RPMVERSION*.rpm
|
||||
set CONNECTORPACKAGE1 /root/infinidb-mysql-$RPMVERSION*.rpm
|
||||
set CONNECTORPACKAGE2 /root/infinidb-storage-engine-$RPMVERSION*.rpm
|
||||
send_user "Installing InfiniDB Packages: $CALPONTPACKAGE1, $CALPONTPACKAGE2, $CALPONTPACKAGE3, $CONNECTORPACKAGE1, $CONNECTORPACKAGE2\n\n"
|
||||
set EEPKG "rpm"
|
||||
} elseif { $PACKAGE == "deb" } {
|
||||
set CALPONTPACKAGE1 /root/infinidb-libs_$RPMVERSION*.deb
|
||||
set CALPONTPACKAGE2 /root/infinidb-platform_$RPMVERSION*.deb
|
||||
set CALPONTPACKAGE3 /root/infinidb-enterprise_$RPMVERSION*.deb
|
||||
set CONNECTORPACKAGE1 /root/infinidb-mysql_$RPMVERSION*.deb
|
||||
set CONNECTORPACKAGE2 /root/infinidb-storage-engine_$RPMVERSION*.deb
|
||||
send_user "Installing InfiniDB Packages: $CALPONTPACKAGE1, $CALPONTPACKAGE2, $CALPONTPACKAGE3, $CONNECTORPACKAGE1, $CONNECTORPACKAGE2\n\n"
|
||||
set EEPKG "deb"
|
||||
} elseif { $PACKAGE == "binary" } {
|
||||
set CALPONTPACKAGE /root/infinidb-ent-$RPMVERSION*bin.tar.gz
|
||||
set CONNECTORPACKAGE1 "nopkg"
|
||||
set CONNECTORPACKAGE2 "nopkg"
|
||||
send_user "Installing InfiniDB Package: $CALPONTPACKAGE\n\n"
|
||||
set EEPKG "binary"
|
||||
} else {
|
||||
puts "please enter Valid Package Type, enter ./calpontInstaller.sh -h for additional info"; exit 1
|
||||
}
|
||||
} else {
|
||||
set CALPONTPACKAGE1 "dummy.rpm"
|
||||
set CALPONTPACKAGE2 "dummy.rpm"
|
||||
set CALPONTPACKAGE3 "dummy.rpm"
|
||||
set CONNECTORPACKAGE1 "dummy.rpm"
|
||||
set CONNECTORPACKAGE2 "dummy.rpm"
|
||||
set EEPKG "rpm"
|
||||
}
|
||||
|
||||
send_user "Performing InfiniDB System Install, please wait...\n"
|
||||
|
||||
send "$INSTALLDIR/bin/setConfig -d Installation EEPackageType $EEPKG\n"
|
||||
expect {
|
||||
-re {[$#] } { }
|
||||
}
|
||||
|
||||
send_user "\n"
|
||||
set timeout 600
|
||||
#
|
||||
# Run installer
|
||||
#
|
||||
send "$INSTALLDIR/bin/installer $CALPONTPACKAGE1 $CALPONTPACKAGE2 $CALPONTPACKAGE3 $CONNECTORPACKAGE1 $CONNECTORPACKAGE2 initial $PASSWORD n $NODEPS $MYSQLPASSWORD $DEBUG\n"
|
||||
expect {
|
||||
"InfiniDB Install Successfully Completed" { }
|
||||
"ERROR" { send_user "FAILED: error returned from installer, execute with debug mode on to determine error\n" ; exit 1 }
|
||||
"Enter MySQL password" { send_user "FAILED: a MySQL password is set\n" ; exit 1 }
|
||||
timeout { send_user "FAILED: Timeout while running installer, execute with debug mode on to determine error\n" ; exit 1 }
|
||||
}
|
||||
|
||||
send_user "\nCalpont Package System Install Completed\n\n"
|
||||
|
||||
exit 0
|
||||
# vim:ts=4 sw=4:
|
||||
|
@ -1,35 +0,0 @@
|
||||
#
|
||||
# Calpont Log Rotate file that gets installed in /etc/logrotate.d
|
||||
# as part of the RPM installation
|
||||
#
|
||||
|
||||
/var/log/mariadb/columnstore/*.log {
|
||||
missingok
|
||||
rotate 7
|
||||
daily
|
||||
dateext
|
||||
copytruncate
|
||||
olddir /var/log/mariadb/columnstore/archive
|
||||
}
|
||||
/var/log/mariadb/columnstore/*.log1 {
|
||||
missingok
|
||||
rotate 7
|
||||
daily
|
||||
nocreate
|
||||
compress
|
||||
olddir /var/log/mariadb/columnstore/archive
|
||||
}
|
||||
/usr/local/Calpont/etc/Columnstore.xml {
|
||||
daily
|
||||
dateext
|
||||
copy
|
||||
olddir /usr/local/Calpont/etc/
|
||||
}
|
||||
/usr/local/Calpont/mysql/db/*.err {
|
||||
missingok
|
||||
rotate 7
|
||||
daily
|
||||
dateext
|
||||
copytruncate
|
||||
olddir /usr/local/Calpont/mysql/db
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
# Calpont Database Platform Logging
|
||||
local1.=crit -/var/log/mariadb/columnstore/crit.log
|
||||
local1.=err -/var/log/mariadb/columnstore/err.log
|
||||
local1.=warning -/var/log/mariadb/columnstore/warning.log
|
||||
local1.=info -/var/log/mariadb/columnstore/info.log
|
||||
local1.=debug -/var/log/mariadb/columnstore/debug.log
|
@ -1,67 +0,0 @@
|
||||
# MariaDB Columnstore Database Platform Logging
|
||||
|
||||
source s_columnstore {
|
||||
# message generated by Syslog-NG
|
||||
internal();
|
||||
# standard Linux log source (this is the default place for the syslog()
|
||||
# function to send logs to)
|
||||
unix-stream("/dev/log");
|
||||
# messages from the kernel
|
||||
file("/proc/kmsg" log_prefix("kernel: "));
|
||||
# use the following line if you want to receive remote UDP logging messages
|
||||
# (this is equivalent to the "-r" syslogd flag)
|
||||
# udp();
|
||||
};
|
||||
|
||||
filter f_local1crit { facility(local1) and level(crit); };
|
||||
filter f_local1err { facility(local1) and level(err); };
|
||||
filter f_local1warning { facility(local1) and level(warning); };
|
||||
filter f_local1info { facility(local1) and level(info); };
|
||||
filter f_local1debug { facility(local1) and level(debug); };
|
||||
|
||||
destination d_crit{
|
||||
file("/var/log/mariadb/columnstore/crit.log");
|
||||
};
|
||||
|
||||
destination d_err{
|
||||
file("/var/log/mariadb/columnstore/err.log");
|
||||
};
|
||||
|
||||
destination d_warning{
|
||||
file("/var/log/mariadb/columnstore/warning.log");
|
||||
};
|
||||
|
||||
destination d_info{
|
||||
file("/var/log/mariadb/columnstore/info.log");
|
||||
};
|
||||
|
||||
destination d_debug{
|
||||
file("/var/log/mariadb/columnstore/debug.log");
|
||||
};
|
||||
|
||||
log{
|
||||
source(s_columnstore);
|
||||
filter(f_local1crit);
|
||||
destination(d_crit);
|
||||
};
|
||||
|
||||
log{
|
||||
source(s_columnstore);
|
||||
filter(f_local1err);
|
||||
destination(d_err);
|
||||
};
|
||||
log{
|
||||
source(s_columnstore);
|
||||
filter(f_local1warning);
|
||||
destination(d_warning);
|
||||
};
|
||||
log{
|
||||
source(s_columnstore);
|
||||
filter(f_local1info);
|
||||
destination(d_info);
|
||||
};
|
||||
log{
|
||||
source(s_columnstore);
|
||||
filter(f_local1debug);
|
||||
destination(d_debug);
|
||||
};
|
@ -1,7 +0,0 @@
|
||||
# MariaDB Columnstore Database Platform Logging
|
||||
local1.crit -/var/log/mariadb/columnstore/crit.log
|
||||
local1.err -/var/log/mariadb/columnstore/err.log
|
||||
local1.warning -/var/log/mariadb/columnstore/warning.log
|
||||
local1.info -/var/log/mariadb/columnstore/info.log
|
||||
local1.debug -/var/log/mariadb/columnstore/debug.log
|
||||
|
@ -1,118 +0,0 @@
|
||||
#!/usr/bin/expect
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Uninstall Package from system
|
||||
|
||||
set COLUMNSTORE_INSTALL_DIR "/usr/local/mariadb/columnstore"
|
||||
set env(COLUMNSTORE_INSTALL_DIR) $COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
set USERNAME $env(USER)
|
||||
set PASSWORD " "
|
||||
set DEBUG 0
|
||||
|
||||
set INFINIDBRPM1 "infinidb-libs"
|
||||
set INFINIDBRPM2 "infinidb-platform"
|
||||
set INFINIDBRPM3 "infinidb-enterprise"
|
||||
set CONNECTORRPM1 "infinidb-mysql"
|
||||
set CONNECTORRPM2 "infinidb-storage-engine"
|
||||
|
||||
spawn -noecho /bin/bash
|
||||
|
||||
for {set i 0} {$i<[llength $argv]} {incr i} {
|
||||
set arg($i) [lindex $argv $i]
|
||||
}
|
||||
|
||||
set i 0
|
||||
while true {
|
||||
if { $i == [llength $argv] } { break }
|
||||
if { $arg($i) == "-h" } {
|
||||
send_user "\n"
|
||||
send_user "'calpontUninstall.sh' performs a system uninstall of the Calpont InfiniDB Packages.\n"
|
||||
send_user "It will perform a shutdown of the InfiniDB software and the \n"
|
||||
send_user "remove the Packages from all configured servers of the InfiniDB System.\n"
|
||||
send_user "\n"
|
||||
send_user "Usage: calpontUninstall.sh -p 'password' -d\n"
|
||||
send_user " password - root password of the remote servers being un-installed'\n"
|
||||
send_user " -d - Debug flag, output verbose information\n"
|
||||
exit
|
||||
} elseif { $arg($i) == "-p" } {
|
||||
incr i
|
||||
set PASSWORD $arg($i)
|
||||
} elseif { $arg($i) == "-d" } {
|
||||
set DEBUG 1
|
||||
} elseif { $arg($i) == "-i" } {
|
||||
incr i
|
||||
set INSTALLDIR $arg($i)
|
||||
} elseif { $arg($i) == "-u" } {
|
||||
incr i
|
||||
set USERNAME $arg($i)
|
||||
}
|
||||
incr i
|
||||
}
|
||||
|
||||
log_user $DEBUG
|
||||
|
||||
set timeout 2
|
||||
set INSTALL 2
|
||||
send "$COLUMNSTORE_INSTALL_DIR/bin/getConfig DBRM_Controller NumWorkers\n"
|
||||
expect {
|
||||
1 { set INSTALL 1 }
|
||||
}
|
||||
|
||||
set PACKAGE "rpm"
|
||||
send "$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation EEPackageType\n"
|
||||
expect {
|
||||
rpm { set PACKAGE rpm }
|
||||
deb { set PACKAGE deb }
|
||||
binary { set PACKAGE binary }
|
||||
}
|
||||
|
||||
set timeout 60
|
||||
log_user $DEBUG
|
||||
if { $INSTALL == "2" && $PASSWORD == " "} {puts "please enter the remote server root password, enter ./calpontUninstall.sh -h for additional info"; exit -1}
|
||||
|
||||
send_user "\nPerforming InfiniDB System Uninstall\n\n"
|
||||
|
||||
#
|
||||
# shutdownSystem
|
||||
#
|
||||
send_user "Shutdown InfiniDB System "
|
||||
expect -re {[$#] }
|
||||
send "$COLUMNSTORE_INSTALL_DIR/bin/mcsadmin shutdownsystem y\n"
|
||||
expect {
|
||||
"shutdownSystem " { send_user "DONE" }
|
||||
}
|
||||
send_user "\n"
|
||||
|
||||
|
||||
if { $INSTALL == "2"} {
|
||||
set timeout 600
|
||||
#
|
||||
# Run installer
|
||||
#
|
||||
send_user "Run System Uninstaller "
|
||||
send "$COLUMNSTORE_INSTALL_DIR/bin/installer $INFINIDBRPM1 $INFINIDBRPM2 $INFINIDBRPM3 $CONNECTORRPM1 $CONNECTORRPM2 uninstall $PASSWORD n --nodeps dummymysqlpw $DEBUG\n"
|
||||
expect {
|
||||
"uninstall request successful" { send_user "DONE" }
|
||||
"ERROR" { send_user "FAILED" ; exit -1 }
|
||||
}
|
||||
send_user "\n"
|
||||
}
|
||||
|
||||
if { $PACKAGE == "binary" } {
|
||||
send "$COLUMNSTORE_INSTALL_DIR/bin/pre-uninstall\n"
|
||||
expect {
|
||||
-re {[$#] } { }
|
||||
}
|
||||
|
||||
send_user "\n"
|
||||
|
||||
send_user "\nCalpont Package System Uninstall Completed\n\n"
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
send_user "\nCalpont Package System Uninstall Completed\n\n"
|
||||
|
||||
exit 0
|
@ -17,15 +17,31 @@
|
||||
# Short-Description: Start/stop MariaDB Columnstore DW DBMS
|
||||
### END INIT INFO
|
||||
|
||||
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
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
fi
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
|
||||
fi
|
||||
@ -40,7 +56,7 @@ if [ $InstallDir != "/usr/local/mariadb/columnstore" ]; then
|
||||
fi
|
||||
|
||||
#hadoop
|
||||
plugin=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
|
||||
plugin=`$InstallDir/bin/getConfig SystemConfig DataFilePlugin`
|
||||
if [ -n "$plugin" ]; then
|
||||
setenv=`$InstallDir/bin/getConfig SystemConfig DataFileEnvFile`
|
||||
. $InstallDir/bin/$setenv >/dev/null 2>&1
|
||||
@ -56,18 +72,18 @@ if [ "x$has_um" = x ]; then
|
||||
has_um=0
|
||||
fi
|
||||
|
||||
user=`whoami 2>/dev/null`
|
||||
SUDO=" "
|
||||
if [ $user != "root" ]; then
|
||||
SUDO="sudo "
|
||||
fi
|
||||
lockdir=`$InstallDir/bin/getConfig Installation LockFileDirectory`
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$InstallDir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
|
||||
checkInstallSetup() {
|
||||
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation InitialInstallFlag`
|
||||
if [ $InitialInstallFlag != "y" ]; then
|
||||
echo "Please run the postConfigure install script, check the Installation Guide"
|
||||
echo "for additional details"
|
||||
$SUDO rm -f /var/lock/subsys/columnstore
|
||||
rm -f $lockdir/columnstore
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@ -75,18 +91,18 @@ checkInstallSetup() {
|
||||
[ -f $InstallDir/bin/ProcMon ] || exit 0
|
||||
|
||||
start() {
|
||||
if [ -f /var/lock/subsys/columnstore ]; then
|
||||
if [ -f $lockdir/columnstore ]; then
|
||||
echo "MariaDB Columnstore Database Platform already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
($SUDO mkdir -p /var/lock/subsys && $SUDO chmod 777 /var/lock/subsys && $SUDO touch /var/lock/subsys/columnstore) >/dev/null 2>&1
|
||||
(mkdir -p $lockdir && touch $lockdir/columnstore) >/dev/null 2>&1
|
||||
|
||||
if [ -x $InstallDir/bin/columnstore.pre-start ]; then
|
||||
$InstallDir/bin/columnstore.pre-start
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore"
|
||||
$SUDO rm -f /var/lock/subsys/columnstore
|
||||
rm -f $lockdir/columnstore
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@ -94,30 +110,29 @@ start() {
|
||||
|
||||
CoreFileFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation CoreFileFlag`
|
||||
if [ $CoreFileFlag = "y" ]; then
|
||||
|
||||
#columnstore core files
|
||||
ulimit -c unlimited > /dev/null 2>&1
|
||||
$SUDO sysctl -q -w kernel.core_uses_pid=1 > /dev/null 2>&1
|
||||
$SUDO sysctl -q -w kernel.core_pattern=/var/log/mariadb/columnstore/corefiles/core.%e.%p > /dev/null 2>&1
|
||||
sysctl -q -w kernel.core_uses_pid=1 > /dev/null 2>&1
|
||||
sysctl -q -w kernel.core_pattern=/var/log/mariadb/columnstore/corefiles/core.%e.%p > /dev/null 2>&1
|
||||
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
echo "Starting MariaDB Columnstore Database Platform"
|
||||
$SUDO rm -f /tmp/StopColumnstore
|
||||
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
||||
rm -f ${tmpDir}/StopColumnstore
|
||||
exec $InstallDir/bin/run.sh -l ${tmpDir} $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
stop() {
|
||||
echo "Shutting down MariaDB Columnstore Database Platform"
|
||||
$SUDO touch /tmp/StopColumnstore
|
||||
$SUDO pkill ProcMon
|
||||
$SUDO pkill ProcMgr
|
||||
sleep 1
|
||||
touch ${tmpDir}/StopColumnstore
|
||||
pkill ProcMon
|
||||
pkill ProcMgr
|
||||
$InstallDir/bin/clearShm
|
||||
RETVAL=$?
|
||||
$SUDO rm -f /var/lock/subsys/columnstore
|
||||
$SUDO fuser -k 8604/tcp > /dev/null 2>&1
|
||||
rm -f $lockdir/columnstore
|
||||
fuser -k 8604/tcp > /dev/null 2>&1
|
||||
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
|
||||
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
|
||||
if [ -x $InstallDir/bin/columnstore.post-stop ]; then
|
||||
@ -132,7 +147,7 @@ restart() {
|
||||
status() {
|
||||
isrunning=0
|
||||
if [ $EUID -eq 0 ]; then
|
||||
if [ -f /var/lock/subsys/columnstore ]; then
|
||||
if [ -f $lockdir/columnstore ]; then
|
||||
isrunning=1
|
||||
fi
|
||||
else
|
||||
@ -160,7 +175,7 @@ restart)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/columnstore ] && restart || :
|
||||
[ -f $lockdir/columnstore ] && restart || :
|
||||
;;
|
||||
status)
|
||||
status
|
||||
|
@ -1,82 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
if [ $1 ] ; then
|
||||
MODULE=$1
|
||||
else
|
||||
MODULE="pm1"
|
||||
fi
|
||||
|
||||
if [ $2 ] ; then
|
||||
INSTALLDIR=$2
|
||||
else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
USER=`whoami 2>/dev/null`
|
||||
|
||||
if [ $USER = "root" ]; then
|
||||
SUDO=" "
|
||||
else
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
$SUDO rm -f /tmp/${MODULE}_configReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
echo "******************** Configuration/Status Report for ${MODULE} ********************"
|
||||
echo " "
|
||||
|
||||
systemctl=`which systemctl 2>/dev/null`
|
||||
if [ -n "$systemctl" ]; then
|
||||
echo "-- systemctl configuration --"
|
||||
echo " "
|
||||
echo "################# systemctl list-unit-files --type=service | grep columnstore #################"
|
||||
echo " "
|
||||
$SUDO systemctl list-unit-files --type=service | grep columnstore 2>/dev/null
|
||||
else
|
||||
chkconfig=`which chkconfig 2>/dev/null`
|
||||
if [ -n "$chkconfig" ]; then
|
||||
echo "-- chkconfig configuration --"
|
||||
echo " "
|
||||
echo "################# chkconfig --list | grep columnstore #################"
|
||||
echo " "
|
||||
$SUDO chkconfig --list | grep columnstore 2>/dev/null
|
||||
else
|
||||
updaterc=`which update-rc.d 2>/dev/null`
|
||||
if [ -n "$updaterc" ]; then
|
||||
echo "-- services configuration --"
|
||||
echo " "
|
||||
echo "################# service --status-all | grep columnstore #################"
|
||||
echo " "
|
||||
$SUDO service --status-all | grep columnstore 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "-- fstab Configuration --"
|
||||
echo " "
|
||||
echo "################# cat /etc/fstab #################"
|
||||
echo " "
|
||||
$SUDO cat /etc/fstab 2>/dev/null
|
||||
|
||||
echo " "
|
||||
echo "-- Server Processes --"
|
||||
echo " "
|
||||
echo "################# ps axu #################"
|
||||
echo " "
|
||||
$SUDO ps axu
|
||||
|
||||
echo " "
|
||||
echo "-- Server Processes with resource usage --"
|
||||
echo " "
|
||||
echo "################# top -b -n 1 #################"
|
||||
echo " "
|
||||
$SUDO top -b -n 1
|
||||
|
||||
} > /tmp/${MODULE}_configReport.txt
|
||||
|
||||
exit 0
|
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/disable-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/disable-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/disable-rep-status.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file:${tmpdir}/disable-rep-status.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -30,42 +30,44 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
>/tmp/disable-rep-status.log
|
||||
>${tmpdir}/disable-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
echo "Run stop slave command" >>${tmpdir}/disable-rep-status.log
|
||||
cat >${tmpdir}/idb_disable-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run reset slave command
|
||||
#
|
||||
echo "Run reset slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
echo "Run reset slave command" >>${tmpdir}/disable-rep-status.log
|
||||
cat >${tmpdir}/idb_disable-rep.sql <<EOD
|
||||
reset slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
cat ${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_disable-rep.sql >>${tmpdir}/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# generic InfiniDB Disable Replication script.
|
||||
#
|
||||
# Notes: This script gets run by ProcMon:
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/disable-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/disable-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
pwprompt=
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
prefix="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
>/tmp/disable-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run reset slave command
|
||||
#
|
||||
echo "Run start slave command" >>/tmp/disable-rep-status.log
|
||||
cat >/tmp/idb_disable-rep.sql <<EOD
|
||||
reset slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
|
||||
checkForError
|
||||
|
||||
#alls good, 'OK' for success
|
||||
echo "OK"
|
||||
exit 0
|
@ -1,178 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: infinidb 3704 2013-08-07 03:33:20Z bwilkinson $
|
||||
#
|
||||
# infinidb Starts Calpont InfiniDB database platform
|
||||
#
|
||||
#
|
||||
# chkconfig: 2345 99 99
|
||||
# description: Calpont InfiniDB is a database platform that utilizes Mysql
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: infinidb
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $all
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start/stop InfiniDB DW DBMS
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
if [ -f /etc/init.d/functions ]; then
|
||||
. /etc/init.d/functions
|
||||
fi
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/infinidb && . /etc/default/infinidb
|
||||
fi
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/Calpont
|
||||
fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
InstallDir=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $InstallDir != "/usr/local/Calpont" ]; then
|
||||
export PATH=$InstallDir/bin:$InstallDir/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$InstallDir/lib:$InstallDir/mysql/lib/mysql
|
||||
fi
|
||||
|
||||
#hadoop
|
||||
plugin=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig SystemConfig DataFilePlugin`
|
||||
if [ -n "$plugin" ]; then
|
||||
setenv=`$InstallDir/bin/getConfig SystemConfig DataFileEnvFile`
|
||||
. $InstallDir/bin/$setenv >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
test -f $InstallDir/post/functions && . $InstallDir/post/functions
|
||||
|
||||
mt=`module_type`
|
||||
mid=`module_id`
|
||||
|
||||
has_um=`$InstallDir/bin/getConfig SystemModuleConfig ModuleCount2`
|
||||
if [ "x$has_um" = x ]; then
|
||||
has_um=0
|
||||
fi
|
||||
|
||||
user=$USER
|
||||
if [ -z "$user" ]; then
|
||||
user=root
|
||||
fi
|
||||
|
||||
checkInstallSetup() {
|
||||
InitialInstallFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation InitialInstallFlag`
|
||||
if [ $InitialInstallFlag != "y" ]; then
|
||||
echo "Please run the postConfigure install script, check the Installation Guide"
|
||||
echo "for additional details"
|
||||
rm -f /var/lock/subsys/infinidb
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
[ -f $InstallDir/bin/ProcMon ] || exit 0
|
||||
|
||||
start() {
|
||||
if [ -f /var/lock/subsys/infinidb ]; then
|
||||
echo "InfiniDB Database Platform already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
(mkdir -p /var/lock/subsys && touch /var/lock/subsys/infinidb) >/dev/null 2>&1
|
||||
|
||||
if [ -x $InstallDir/bin/infinidb.pre-start ]; then
|
||||
$InstallDir/bin/infinidb.pre-start
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error running InfiniDB pre-start script, not starting InfiniDB"
|
||||
rm -f /var/lock/subsys/infinidb
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
checkInstallSetup
|
||||
|
||||
CoreFileFlag=`$InstallDir/bin/getConfig -c $InstallDir/etc/Columnstore.xml Installation CoreFileFlag`
|
||||
if [ $CoreFileFlag = "y" ]; then
|
||||
SUDO=
|
||||
if [ "$user" != "root" ]; then
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
#infinidb core files
|
||||
$SUDO ulimit -c unlimited > /dev/null 2>&1
|
||||
$SUDO sysctl -q -w kernel.core_uses_pid=1 > /dev/null 2>&1
|
||||
$SUDO sysctl -q -w kernel.core_pattern=/var/log/mariadb/columnstore/corefiles/core.%e.%p > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
echo "Starting InfiniDB Database Platform"
|
||||
rm -f /tmp/StopCalpont
|
||||
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
stop() {
|
||||
echo "Shutting down InfiniDB Database Platform"
|
||||
touch /tmp/StopCalpont
|
||||
pkill -9 ProcMon
|
||||
pkill -9 ProcMgr
|
||||
pkill -9 snmptrapd
|
||||
sleep 1
|
||||
$InstallDir/bin/clearShm
|
||||
RETVAL=$?
|
||||
rm -f /var/lock/subsys/infinidb
|
||||
fuser -k 8604/tcp > /dev/null 2>&1
|
||||
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
|
||||
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
|
||||
if [ -x $InstallDir/bin/infinidb.post-stop ]; then
|
||||
$InstallDir/bin/infinidb.post-stop
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
status() {
|
||||
isrunning=0
|
||||
if [ $EUID -eq 0 ]; then
|
||||
if [ -f /var/lock/subsys/infinidb ]; then
|
||||
isrunning=1
|
||||
fi
|
||||
else
|
||||
pgrep ProcMon >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
isrunning=1
|
||||
fi
|
||||
fi
|
||||
if [ $isrunning -ne 0 ]; then
|
||||
echo "InfiniDB is running"
|
||||
else
|
||||
echo "InfiniDB is not running"
|
||||
exit 3
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/infinidb ] && restart || :
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
@ -1,2 +0,0 @@
|
||||
/usr/local/Calpont/lib
|
||||
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copy this file to /etc/default and rename it to 'infinidb'.
|
||||
|
||||
# Change this line to your InfiniDB installation directory
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/Calpont
|
||||
|
||||
LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib/mysql
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
@ -1,16 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
description "Starts the InfiniDB Enterprise Process Monitor"
|
||||
|
||||
start on runlevel 2
|
||||
start on runlevel 3
|
||||
|
||||
stop on runlevel 0
|
||||
stop on runlevel 1
|
||||
stop on runlevel 4
|
||||
stop on runlevel 5
|
||||
stop on runlevel 6
|
||||
|
||||
respawn
|
||||
exec /usr/local/Calpont/bin/ProcMon
|
||||
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: install-infinidb.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
# install-infinidb.sh dummy EE version
|
||||
|
||||
echo " " 1>&2
|
||||
echo " This install-infinidb.sh script is only used to install the Community Edition." 1>&2
|
||||
echo " Please use the 'postConfigure' for installing the Enterprise Edition." 1>&2
|
||||
echo " Check the Calpont InfiniDB Installation Document for further details." 1>&2
|
||||
|
||||
exit 1
|
||||
|
@ -8,20 +8,20 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep "ERROR 1045" /tmp/mariadb-command-line.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR - PASSWORD: check log file: /tmp/mariadb-command-line.log"
|
||||
rm -f /tmp/error.check
|
||||
grep "ERROR 1045" ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR - PASSWORD: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 2
|
||||
fi
|
||||
|
||||
grep ERROR /tmp/mariadb-command-line.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/mariadb-command-line.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/mariadb-command-line.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/mariadb-command-line.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -37,27 +37,29 @@ for arg in "$@"; do
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
||||
port="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
|
||||
>/tmp/mariadb-command-line.log
|
||||
>${tmpdir}/mariadb-command-line.log
|
||||
|
||||
#
|
||||
# Run command
|
||||
#
|
||||
echo "Run command" >>/tmp/mariadb-command-line.log
|
||||
cat >/tmp/mariadb-command-line.sql <<EOD
|
||||
echo "Run command" >>${tmpdir}/mariadb-command-line.log
|
||||
cat >${tmpdir}/mariadb-command-line.sql <<EOD
|
||||
$command;
|
||||
EOD
|
||||
|
||||
cat /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log
|
||||
cat${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys < /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log 2>&1
|
||||
calpontsys < ${tmpdir}/mariadb-command-line.sql >> ${tmpdir}/mariadb-command-line.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/master-rep-status-$hostipaddr.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/master-rep-status-$hostipaddr.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/master-rep-status-$hostipaddr.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/master-rep-status-$hostipaddr.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -29,6 +29,8 @@ for arg in "$@"; do
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--hostIP='` -eq 9 ]; then
|
||||
hostipaddr="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
@ -37,69 +39,69 @@ test -f $installdir/post/functions && . $installdir/post/functions
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/master-rep-status-$hostipaddr.log
|
||||
>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
|
||||
#
|
||||
# Create Replication User
|
||||
#
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
CREATE USER IF NOT EXISTS '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Grant table access for created user
|
||||
#
|
||||
echo "Grant table access for $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Grant table access for $repUser for node $hostipaddr" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
use mysql
|
||||
grant all on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
grant REPLICATION SLAVE on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW MASTER STATUS
|
||||
#
|
||||
echo "Run SHOW MASTER STATUS to node log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Run SHOW MASTER STATUS to node log" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
echo "Run SHOW MASTER STATUS to master status log /tmp/show-master-status.log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
echo "Run SHOW MASTER STATUS to master status log ${tmpdir}/show-master-status.log" >>${tmpdir}/master-rep-status-$hostipaddr.log
|
||||
cat >${tmpdir}/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
||||
cat ${tmpdir}/idb_master-rep.sql >${tmpdir}/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
||||
calpontsys <${tmpdir}/idb_master-rep.sql >>${tmpdir}/show-master-status.log
|
||||
|
||||
|
||||
#alls good, 'OK' for success
|
||||
|
@ -1,112 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# generic InfiniDB Master Replication script.
|
||||
#
|
||||
# Notes: This script gets run by ProcMon during installs and upgrades:
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/master-rep-status-$hostipaddr.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/master-rep-status-$hostipaddr.log"
|
||||
rm -f /tmp/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
pwprompt=
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
prefix="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--hostIP='` -eq 9 ]; then
|
||||
hostipaddr="`echo $arg | awk -F= '{print $2}'`"
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
#
|
||||
# Create Replication User
|
||||
#
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
CREATE USER '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Grant table access for created user
|
||||
#
|
||||
echo "Grant table access for $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
use mysql
|
||||
grant all on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
grant REPLICATION SLAVE on *.* to '$repUser'@'$hostipaddr' identified by 'Calpont1';
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW MASTER STATUS
|
||||
#
|
||||
echo "Run SHOW MASTER STATUS to node log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
checkForError
|
||||
|
||||
echo "Run SHOW MASTER STATUS to master status log /tmp/show-master-status.log" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
SHOW MASTER STATUS
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
||||
|
||||
|
||||
#alls good, 'OK' for success
|
||||
echo "OK"
|
||||
exit 0
|
||||
|
||||
|
@ -15,6 +15,7 @@ rpmmode=install
|
||||
user=`whoami 2>/dev/null`
|
||||
quiet=0
|
||||
shiftcnt=0
|
||||
password=" "
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
|
||||
@ -40,6 +41,9 @@ for arg in "$@"; do
|
||||
elif [ $(expr -- "$arg" : '--module') -eq 8 ]; then
|
||||
module="$(echo $arg | awk -F= '{print $2}')"
|
||||
((shiftcnt++))
|
||||
elif [ $(expr -- "$arg" : '--password') -eq 10 ]; then
|
||||
password="$(echo $arg | awk -F= '{print $2}')"
|
||||
((shiftcnt++))
|
||||
fi
|
||||
done
|
||||
shift $shiftcnt
|
||||
@ -55,6 +59,9 @@ fi
|
||||
PMwithUM=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMwithUM`
|
||||
ServerTypeInstall=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
echo "Amazon setup on Module"
|
||||
@ -63,18 +70,15 @@ if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
if [ $module = "pm" ]; then
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab ; then
|
||||
echo "Setup fstab on Module"
|
||||
if [ $user = "root" ]; then
|
||||
SUDO=""
|
||||
if [ $user != "root" ]; then
|
||||
SUDO="sudo "
|
||||
fi
|
||||
touch /etc/fstab
|
||||
$SUDO chmod 666 /etc/fstab
|
||||
rm -f /etc/fstab.columnstoreSave
|
||||
cp /etc/fstab /etc/fstab.columnstoreSave
|
||||
cat $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab
|
||||
else
|
||||
sudo touch /etc/fstab
|
||||
sudo chmod 666 /etc/fstab
|
||||
sudo rm -f /etc/fstab.columnstoreSave
|
||||
sudo cp /etc/fstab /etc/fstab.columnstoreSave
|
||||
sudo cat $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -84,8 +88,8 @@ test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/po
|
||||
mid=`module_id`
|
||||
|
||||
#if um, cloud, separate system type, external um storage, then setup mount
|
||||
if [ $module = "um" ]; then
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
if [ $module = "um" ]; then
|
||||
systemtype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
||||
if [ $systemtype = "1" ]; then
|
||||
umstoragetype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMStorageType`
|
||||
@ -93,15 +97,18 @@ if [ $module = "um" ]; 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
|
||||
if [ $user = "root" ]; then
|
||||
mount $device $COLUMNSTORE_INSTALL_DIR/mysql/db -t ext2 -o noatime,nodiratime,noauto
|
||||
chown mysql:mysql -R $COLUMNSTORE_INSTALL_DIR/mysql > /dev/null 2>&1
|
||||
else
|
||||
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
|
||||
|
||||
#setup rc.local for amazon
|
||||
RCFILE=/etc/rc.d/rc.local
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
echo "uncomment runuser in rc.local, amazon AMI"
|
||||
sudo sed -i -e 's/#runuser/runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -134,85 +141,50 @@ MySQLRep=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLRep`
|
||||
if [ $MySQLRep = "y" ]; then
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||
echo "Run Upgrade on my.cnf on Module"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade > /tmp/mycnfUpgrade.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade > ${tmpDir}/mycnfUpgrade.log 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
||||
mysqlPort=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLPort`
|
||||
echo "Run Mysql Port update on my.cnf on Module"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > /tmp/mycnfUpgrade_port.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > ${tmpDir}/mycnfUpgrade_port.log 2>&1
|
||||
fi
|
||||
|
||||
# if um, run mysql install scripts
|
||||
if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $ServerTypeInstall = "2" ]; then
|
||||
|
||||
mysqlPassword=" "
|
||||
if [[ $password != " " ]]; then
|
||||
mysqlPassword="--password="$password
|
||||
fi
|
||||
|
||||
echo "Run post-mysqld-install"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysqld-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysqld-install.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysqld-install --installdir=$COLUMNSTORE_INSTALL_DIR $mysqlPassword --tmpdir=${tmpDir} > ${tmpDir}/post-mysqld-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: post-mysqld-install failed: check /tmp/post-mysqld-install.log"
|
||||
echo "ERROR: post-mysqld-install failed: check ${tmpDir}/post-mysqld-install.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Run post-mysql-install"
|
||||
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysql-install.log 2>&1
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR --tmpdir=${tmpDir} > ${tmpDir}/post-mysql-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: post-mysql-install failed: check /tmp/post-mysql-install.log"
|
||||
echo "ERROR: post-mysql-install failed: check ${tmpDir}/post-mysql-install.log"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh check > /tmp/syslogSetup-check.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
# try setup again
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh install > /tmp/syslogSetup-install.log 2>&1
|
||||
if [ $user == "root" ]; then
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh check > ${tmpDir}/syslogSetup-check.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: syslogSetup.sh check failed: check /tmp/syslogSetup-check.log"
|
||||
# try setup again
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/syslogSetup.sh install > ${tmpDir}/syslogSetup-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: syslogSetup.sh check failed: check ${tmpDir}/syslogSetup-check.log"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
#setup rc.local
|
||||
if [ -f /etc/rc.d ]; then
|
||||
RCFILE=/etc/rc.d/rc.local
|
||||
else
|
||||
RCFILE=/etc/rc.local
|
||||
fi
|
||||
touch $RCFILE
|
||||
|
||||
echo "add deadline to rc.local"
|
||||
if [ $module = "um" ]; then
|
||||
if [ $user = "root" ]; then
|
||||
echo "for scsi_dev in \`mount | awk '/mnt\\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
echo "done" >> $RCFILE
|
||||
else
|
||||
sudo echo "for scsi_dev in \`mount | awk '/mnt\\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
sudo echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
sudo echo "done" >> $RCFILE
|
||||
fi
|
||||
else
|
||||
if [ $user = "root" ]; then
|
||||
echo "for scsi_dev in \`mount | awk '/mnt\\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
echo "done" >> $RCFILE
|
||||
|
||||
echo "for scsi_dev in \`mount | awk '/columnstore\\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
echo "done" >> $RCFILE
|
||||
else
|
||||
sudo echo "for scsi_dev in \`mount | awk '/mnt\\/tmp/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
sudo echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
sudo echo "done" >> $RCFILE
|
||||
|
||||
sudo echo "for scsi_dev in \`mount | awk '/columnstore\\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'\`; do" >> $RCFILE
|
||||
sudo echo "echo deadline > /sys/block/$scsi_dev/queue/scheduler" >> $RCFILE
|
||||
sudo echo "done" >> $RCFILE
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
echo "uncomment runuser in rc.local"
|
||||
sudo sed -i -e 's/#sudo runuser/sudo runuser/g' $RCFILE >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
echo "!!!Module Installation Successfully Completed!!!"
|
||||
|
@ -8,10 +8,6 @@ prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
rpmmode=install
|
||||
user=`whoami 2>/dev/null`
|
||||
SUDO=" "
|
||||
if [ $user != "root" ]; then
|
||||
SUDO="sudo "
|
||||
fi
|
||||
|
||||
quiet=0
|
||||
|
||||
@ -22,9 +18,16 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
|
||||
rpmmode="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdirTmp="`echo $arg | awk -F= '{print $2}'`"
|
||||
if [ $installdirTmp == $installdir ] ; then
|
||||
user=root
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
else
|
||||
installdir=$installdirTmp
|
||||
prefix=`dirname $installdir`
|
||||
prefix=`dirname $prefix`
|
||||
fi
|
||||
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
|
||||
user="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--quiet'` -eq 7 ]; then
|
||||
@ -32,7 +35,9 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--plugin='` -eq 9 ]; then
|
||||
plugin="`echo $arg | awk -F= '{print $2}'`"
|
||||
else
|
||||
echo "post-install: ignoring unknown argument: $arg" 1>&2
|
||||
echo "post-install: invalid unknown argument: $arg" 1>&2
|
||||
echo "exiting..."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@ -70,6 +75,12 @@ fi
|
||||
|
||||
cd $installdir/lib || exit 1
|
||||
|
||||
touch /dev/shm/columnstore-test && rm /dev/shm/columnstore-test
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "User $user will need R/W access to /dev/shm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#remove libudfsdk.so.1.0.0 file, if it exist # mcol-875
|
||||
rm -f $installdir/lib/libudfsdk.so
|
||||
rm -f $installdir/lib/libudfsdk.so.1
|
||||
@ -93,53 +104,65 @@ if [ -f libstdc++.so.6.0.14 ]; then
|
||||
fi
|
||||
|
||||
# softlink for libperl.sp, used by cplogger
|
||||
$SUDO ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1
|
||||
|
||||
#setup profile files
|
||||
profileFileAlias=/etc/profile.d/columnstoreAlias.sh
|
||||
profileFileEnv=/etc/profile.d/columnstoreEnv.sh
|
||||
ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1
|
||||
|
||||
if [ $installdir != "/usr/local/mariadb/columnstore" ]; then
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstoreAlias
|
||||
fi
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
sudo rm -f $profileFileEnv
|
||||
sudo rm -f $profileFileAlias
|
||||
|
||||
sudo touch $profileFileEnv
|
||||
sudo chmod 666 $profileFileEnv
|
||||
egrep -qs 'MariaDB Columnstore Non-Root' ${profileFileEnv}
|
||||
rc1=$?
|
||||
if [ $rc1 -ne 0 ]; then
|
||||
sudo echo " " >> ${profileFileEnv}
|
||||
sudo echo "# MariaDB Columnstore Non-Root Environment Variables" >> ${profileFileEnv}
|
||||
sudo echo "export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR" >> ${profileFileEnv}
|
||||
sudo echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib" >> ${profileFileEnv}
|
||||
. ${profileFileEnv}
|
||||
if [ -f $prefix/.bash_profile ]; then
|
||||
profileFile=$prefix/.bash_profile
|
||||
elif [ -f $prefix/.profile ]; then
|
||||
profileFile=$prefix/.profile
|
||||
else
|
||||
profileFile=$prefix/.bashrc
|
||||
touch $prefix/.bashrc
|
||||
fi
|
||||
|
||||
sudo /bin/cp -f $installdir/bin/columnstoreAlias $profileFileAlias
|
||||
sudo chmod 666 $profileFileAlias
|
||||
if [ ! -f ${profileFile}_backup ]; then
|
||||
cp $profileFile ${profileFile}_backup
|
||||
fi
|
||||
|
||||
egrep -qs 'MariaDB Columnstore Non-Root Environment Variables' ${profileFile}
|
||||
rc1=$?
|
||||
if [ $rc1 -ne 0 ]; 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}
|
||||
fi
|
||||
|
||||
egrep -qs 'MariaDB Columnstore Non-Root Alias Variables' ${profileFile}
|
||||
rc1=$?
|
||||
if [ $rc1 -ne 0 ]; then
|
||||
echo " " >> ${profileFile}
|
||||
echo "# MariaDB Columnstore Non-Root Alias Variables" >> ${profileFile}
|
||||
cat $installdir/bin/columnstoreAlias >> ${profileFile}
|
||||
fi
|
||||
|
||||
#source the file
|
||||
. ${profileFile}
|
||||
else
|
||||
/bin/cp -f $installdir/bin/columnstoreAlias $profileFileAlias
|
||||
chmod 644 $profileFileAlias
|
||||
profileFile="/etc/profile.d/columnstoreAlias.sh"
|
||||
/bin/cp -f $installdir/bin/columnstoreAlias /etc/profile.d/columnstoreAlias.sh
|
||||
chmod 644 /etc/profile.d/columnstoreAlias.sh >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
cd /
|
||||
# set Profile File in config file
|
||||
$installdir/bin/setConfig -d Installation ProfileFile $profileFile
|
||||
|
||||
test -d /var/log/mariadb || $SUDO mkdir /var/log/mariadb >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore || $SUDO mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
|
||||
|
||||
if [ $user != "root" ]; then
|
||||
$SUDO chmod -R 777 /var/log/mariadb >/dev/null 2>&1
|
||||
$SUDO chown -R $user:$user /var/log/mariadb >/dev/null 2>&1
|
||||
# create directories
|
||||
if [ $user == "root" ]; then
|
||||
test -d /var/log/mariadb || mkdir /var/log/mariadb >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore || mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
test -h /var/log/mariadb/columnstore/data && rm -f /var/log/mariadb/columnstore/data
|
||||
chmod 755 /var/log/mariadb/columnstore/corefiles > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
test -h /var/log/mariadb/columnstore/data && rm -f /var/log/mariadb/columnstore/data
|
||||
# make sure trace dir is world-writable and sticky
|
||||
test -d $installdir/data || mkdir $installdir/data
|
||||
test -d $installdir/data1 || mkdir $installdir/data1
|
||||
@ -159,16 +182,30 @@ mkdir -p $installdir/data/bulk/rollback >/dev/null 2>&1
|
||||
mkdir -p $installdir/data/bulk/tmpjob >/dev/null 2>&1
|
||||
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
|
||||
#create columnstore temp file directory
|
||||
mkdir -p /tmp/columnstore_tmp_files >/dev/null 2>&1
|
||||
#get temp base directory
|
||||
tmpDir="/tmp"
|
||||
if [ $user != "root" ]; then
|
||||
tmpDir=$HOME"/.tmp"
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
else
|
||||
#get columnstore temp file directory name
|
||||
TempFileDir=`$installdir/bin/getConfig SystemConfig TempFileDir`
|
||||
tmpDir=${tmpDir}${TempFileDir}
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#setup core file directory and link
|
||||
mkdir /var/log/mariadb/columnstore/corefiles > /dev/null 2>&1
|
||||
chmod 777 /var/log/mariadb/columnstore/corefiles > /dev/null 2>&1
|
||||
#set base columnstore temp file directory
|
||||
$installdir/bin/setConfig -d SystemConfig SystemTempFileDir $tmpDir
|
||||
|
||||
#get place file buffer temporary files
|
||||
hdfsRdwrScratch=`$installdir/bin/getConfig SystemConfig hdfsRdwrScratch`
|
||||
hdfsDir=${tmpDir}${hdfsRdwrScratch}
|
||||
|
||||
#create place file buffer temporary files
|
||||
mkdir -p $hdfsDir >/dev/null 2>&1
|
||||
|
||||
#create mount directories
|
||||
mkdir /mnt/tmp > /dev/null 2>&1
|
||||
mkdir /var/log/mariadb/columnstore/data/archive > /dev/null 2>&1
|
||||
|
||||
# remove mysql archive log
|
||||
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
|
||||
@ -177,8 +214,6 @@ rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
|
||||
# delete Columnstore shared memory segments
|
||||
$installdir/bin/clearShm > /dev/null 2>&1
|
||||
|
||||
systemctl=`which systemctl 2>/dev/null`
|
||||
|
||||
#check and create rc.local file if missing
|
||||
if [ -f /etc/rc.d ]; then
|
||||
RCFILE=/etc/rc.d/rc.local
|
||||
@ -190,22 +225,16 @@ if [ $user = "root" ]; then
|
||||
touch $RCFILE
|
||||
chmod +x $RCFILE
|
||||
else
|
||||
$SUDO touch $RCFILE
|
||||
$SUDO chmod 777 $RCFILE
|
||||
$SUDO printf '%s\n' '#!/bin/bash' "#" | $SUDO tee -a $RCFILE > /dev/null 2>&1
|
||||
|
||||
if [ -n "$systemctl" ]; then
|
||||
$SUDO systemctl start rc-local >/dev/null 2>&1
|
||||
$SUDO systemctl enable rc-local >/dev/null 2>&1
|
||||
fi
|
||||
printf '%s\n' '#!/bin/bash' "#" | tee -a $RCFILE > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
#setup the columnstore service script
|
||||
rm -f /etc/init.d/columnstore >/dev/null 2>&1
|
||||
rm -f /etc/init.d/mysql-Columnstore >/dev/null 2>&1
|
||||
|
||||
if [ $user = "root" ]; then
|
||||
#setup the columnstore service script
|
||||
rm -f /etc/init.d/columnstore >/dev/null 2>&1
|
||||
rm -f /etc/init.d/mysql-Columnstore >/dev/null 2>&1
|
||||
rm -f /etc/default/columnstore
|
||||
|
||||
systemctl=`which systemctl 2>/dev/null`
|
||||
if [ -n "$systemctl" ]; then
|
||||
|
||||
chmod 644 $installdir/bin/columnstore.service
|
||||
@ -234,31 +263,49 @@ if [ $user = "root" ]; then
|
||||
fi
|
||||
|
||||
if [ $user = "root" ]; then
|
||||
$installdir/bin/syslogSetup.sh install > /tmp/syslog_install.log 2>&1
|
||||
rm -f /etc/default/columnstore
|
||||
else
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstore.def
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstoreLogRotate
|
||||
$installdir/bin/syslogSetup.sh install > $tmpDir/syslog_install.log 2>&1
|
||||
|
||||
$SUDO cp $installdir/bin/columnstore.def /etc/default/columnstore
|
||||
#check if MariaDB Columnstore system logging was setup
|
||||
cat $tmpDir/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
cat $tmpDir/syslog_install.log
|
||||
fi
|
||||
else
|
||||
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstoreLogRotate
|
||||
|
||||
sed -i -e s@prefix=/home/guest@prefix=$prefix@g $installdir/bin/*
|
||||
|
||||
$SUDO chmod 777 /tmp
|
||||
$installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
|
||||
$SUDO chown $user:$user $installdir/etc/Columnstore.xml
|
||||
$SUDO mkdir /var/lock/subsys > /dev/null 2>&1
|
||||
$SUDO chmod 777 /var/lock/subsys > /dev/null 2>&1
|
||||
$SUDO rm -f /var/lock/subsys/mysql-Columnstore
|
||||
$SUDO chmod 666 /etc/fstab
|
||||
chown $user:$user $installdir/etc/Columnstore.xml
|
||||
|
||||
cat <<EOD
|
||||
|
||||
NOTE: For non-root install, you will need to run the following commands as root user to
|
||||
setup the MariaDB ColumnStore System Logging
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/syslogSetup.sh --installdir=$installdir --user=$user install
|
||||
|
||||
|
||||
EOD
|
||||
fi
|
||||
|
||||
#check if MariaDB Columnstore system logging was setup
|
||||
cat /tmp/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
cat /tmp/syslog_install.log
|
||||
#determine lock file directory
|
||||
|
||||
# Lock directory for root user
|
||||
lockdir='/var/lock/subsys'
|
||||
if [ $user != "root" ];then
|
||||
# Lock directory for non-root user
|
||||
lockdir=$prefix/.lock
|
||||
fi
|
||||
|
||||
$installdir/bin/setConfig -d Installation LockFileDirectory $lockdir
|
||||
|
||||
mkdir $lockdir >/dev/null 2>&1
|
||||
|
||||
rm -f $lockdir/mysql-Columnstore
|
||||
rm -f $lockdir/columnstore
|
||||
|
||||
#backup copy of Alarm Config File
|
||||
/bin/cp -f $installdir/etc/AlarmConfig.xml $installdir/etc/AlarmConfig.xml.installSave > /dev/null 2>&1
|
||||
|
||||
@ -275,6 +322,7 @@ if [ $user = "root" ]; then
|
||||
else
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib $installdir/bin/cplogger -i 19 "***** MariaDB Columnstore Installed *****"
|
||||
fi
|
||||
|
||||
#setup hadoop
|
||||
hadoop=`which hadoop 2>/dev/null`
|
||||
if [ -z "$hadoop" ]; then
|
||||
@ -283,16 +331,22 @@ if [ -z "$hadoop" ]; then
|
||||
cat <<EOD
|
||||
The next steps are:
|
||||
|
||||
If installing on a pm1 node:
|
||||
If installing on a pm1 node using non-distributed install
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/postConfigure -i $installdir
|
||||
|
||||
If installing on a pm1 node using distributed install
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/postConfigure -i $installdir -d
|
||||
|
||||
If installing on a non-pm1 using the non-distributed option:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/columnstore start
|
||||
|
||||
EOD
|
||||
@ -300,10 +354,14 @@ EOD
|
||||
cat <<EOD
|
||||
The next step is:
|
||||
|
||||
If installing on a pm1 node:
|
||||
If installing on a pm1 node using non-distributed install
|
||||
|
||||
$installdir/bin/postConfigure
|
||||
|
||||
If installing on a pm1 node using distributed install
|
||||
|
||||
$installdir/bin/postConfigure -d
|
||||
|
||||
If installing on a non-pm1 using the non-distributed option:
|
||||
|
||||
$installdir/bin/columnstore start
|
||||
@ -317,7 +375,7 @@ else
|
||||
chmod 755 $installdir/bin/setenv-hdfs-20
|
||||
|
||||
. $installdir/bin/setenv-hdfs-20
|
||||
$installdir/bin/hdfsCheck $installdir/lib/hdfs-20.so > /tmp/hdfs-20-test.log 2>&1
|
||||
$installdir/bin/hdfsCheck $installdir/lib/hdfs-20.so > $tmpDir/hdfs-20-test.log 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
#Passed set in config file
|
||||
$installdir/bin/setConfig -d SystemConfig DataFilePlugin $installdir/lib/hdfs-20.so
|
||||
@ -331,29 +389,29 @@ If you are intending to install MariaDB Columnstore over Hadoop, the next steps
|
||||
|
||||
If installing on a pm1 node:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
. $installdir/bin/setenv-hdfs-20
|
||||
$installdir/bin/postConfigure -i $installdir
|
||||
|
||||
If installing on a non-pm1 using the non-distributed option:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/columnstore start
|
||||
|
||||
If you are intending to install MariaDB Columnstore without Hadoop, the next steps are:
|
||||
|
||||
If installing on a pm1 node:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/postConfigure -i $installdir
|
||||
|
||||
If installing on a non-pm1 using the non-distributed option:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/columnstore start
|
||||
|
||||
EOD
|
||||
@ -384,7 +442,7 @@ EOD
|
||||
fi
|
||||
else
|
||||
. $installdir/bin/setenv-hdfs-12
|
||||
$installdir/bin/hdfsCheck $installdir/lib/hdfs-12.so > /tmp/hdfs-12-test.log 2>&1
|
||||
$installdir/bin/hdfsCheck $installdir/lib/hdfs-12.so > $tmpDir/hdfs-12-test.log 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
#Passed set in config file
|
||||
$installdir/bin/setConfig -d SystemConfig DataFilePlugin $installdir/lib/hdfs-12.so
|
||||
@ -397,8 +455,8 @@ If you are intending to install MariaDB Columnstore over Hadoop, the next steps
|
||||
|
||||
If installing on a pm1 node:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib:$libpath
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
. $installdir/bin/setenv-hdfs-12
|
||||
$installdir/bin/postConfigure -i $installdir
|
||||
|
||||
@ -406,8 +464,8 @@ If you are intending to install MariaDB Columnstore without Hadoop, the next ste
|
||||
|
||||
If installing on a pm1 node:
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
. $installdir/bin/setenv-hdfs-12
|
||||
$installdir/bin/postConfigure -i $installdir
|
||||
|
||||
|
@ -7,16 +7,16 @@
|
||||
# check log for error
|
||||
checkForError() {
|
||||
# check for password error
|
||||
grep "ERROR 1045" /tmp/mysql_install.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
grep "ERROR 1045" ${tmpdir}/mysql_install.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "MySQL Password file missing or incorrect, check .my.cnf file"
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
$installdir/mysql/mysql-Columnstore stop
|
||||
sleep 2
|
||||
exit 2;
|
||||
fi
|
||||
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if engine columnstore exist
|
||||
@ -24,7 +24,7 @@ checkForError() {
|
||||
echo "checking for engine columnstore..."
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--user=root \
|
||||
--execute='show engines;' \
|
||||
calpontsys | grep -i columnstore
|
||||
|
||||
@ -44,8 +44,8 @@ checkForError() {
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
rpmmode=install
|
||||
password=
|
||||
pwprompt=
|
||||
tmpdir="/tmp"
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
|
||||
prefix="$(echo $arg | awk -F= '{print $2}')"
|
||||
@ -55,6 +55,8 @@ for arg in "$@"; do
|
||||
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
|
||||
installdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
prefix=$(dirname $installdir)
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
else
|
||||
echo "ignoring unknown argument: $arg" 1>&2
|
||||
fi
|
||||
@ -62,7 +64,7 @@ done
|
||||
|
||||
USER=`whoami 2>/dev/null`
|
||||
if [ $USER != "root" ]; then
|
||||
sudo ldconfig >/dev/null 2>&1
|
||||
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
|
||||
else
|
||||
@ -103,11 +105,11 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
|
||||
sleep 5
|
||||
|
||||
# Install various Calpont stuff...
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
|
||||
checkForError
|
||||
if [ $? -ne 0 ]; then
|
||||
# retry
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
|
||||
checkForError
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
||||
|
@ -8,6 +8,11 @@ prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
rpmmode=install
|
||||
user=mysql
|
||||
tmpdir="/tmp"
|
||||
|
||||
password=" "
|
||||
pwprompt=
|
||||
|
||||
if [ $EUID -ne 0 ]; then
|
||||
USER=`whoami 2>/dev/null`
|
||||
user=$USER
|
||||
@ -24,6 +29,10 @@ for arg in "$@"; do
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
|
||||
user="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
|
||||
password="$(echo $arg | awk -F= '{print $2}')"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
else
|
||||
echo "post-mysqld-install: ignoring unknown argument: $arg" 1>&2
|
||||
fi
|
||||
@ -68,6 +77,45 @@ 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
|
||||
|
||||
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 --defaults-file=$installdir/mysql/my.cnf > $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 --defaults-file=$installdir/mysql/my.cnf --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 --defaults-extra-file=$installdir/mysql/my.cnf --basedir=$installdir/mysql >/dev/null
|
||||
# Change permissions again to fix any new files.
|
||||
|
@ -2,16 +2,12 @@
|
||||
#
|
||||
# $Id: post-uninstall 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
# Post-uninstall steps for columnstore install
|
||||
# pre-uninstall steps for columnstore install
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
rpmmode=install
|
||||
user=`whoami 2>/dev/null`
|
||||
SUDO=" "
|
||||
if [ $user != "root" ]; then
|
||||
SUDO="sudo "
|
||||
fi
|
||||
|
||||
quiet=0
|
||||
|
||||
@ -24,12 +20,15 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
prefix=`dirname $prefix`
|
||||
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
|
||||
user="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--quiet'` -eq 7 ]; then
|
||||
quiet=1
|
||||
else
|
||||
echo "post-uninstall: ignoring unknown argument: $arg" 1>&2
|
||||
echo "pre-install: invalid unknown argument: $arg" 1>&2
|
||||
echo "exiting..."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@ -37,64 +36,61 @@ done
|
||||
$installdir/bin/columnstore stop > /dev/null 2>&1
|
||||
$installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
|
||||
|
||||
# uninstall OS scripts updated by postConfigure
|
||||
if test -f /etc/exports.columnstoreSave ; then
|
||||
$SUDO mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
|
||||
else
|
||||
$SUDO rm -f /etc/exports > /dev/null 2>&1
|
||||
if [ $user != "root" ]; then
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$installdir/lib:$installdir/mysql/lib
|
||||
fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
|
||||
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
|
||||
cloud=`$installdir/bin/getConfig Installation Cloud`
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
if test -f /etc/fstab ; then
|
||||
$SUDO sed -i '/Columnstore\/data/d' /etc/fstab > /dev/null 2>&1
|
||||
sed -i '/Columnstore\/data/d' /etc/fstab > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
#remove log file directories
|
||||
#rm -rf /var/log/mariadb/columnstore > /dev/null 2>&1
|
||||
#rm -f $installdir/mysql/db/*.err > /dev/null 2>&1
|
||||
$SUDO rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
|
||||
$SUDO rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
|
||||
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
|
||||
$SUDO rm -f /etc/default/columnstore
|
||||
#remove profile file
|
||||
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
|
||||
touch $prefix/.bashrc
|
||||
fi
|
||||
|
||||
# remove Mariab Columnstore Log Rotate File abd Transaction Log File
|
||||
$SUDO rm -f /etc/logrotate.d/columnstore > /dev/null 2>&1
|
||||
$SUDO rm -f /etc/cron.d/transactionLog > /dev/null 2>&1
|
||||
if [ -f ${profileFile}_backup ] ; then
|
||||
mv -f ${profileFile}_backup $profileFile
|
||||
fi
|
||||
else
|
||||
rm -f /etc/profile.d/columnstoreAlias.sh
|
||||
fi
|
||||
|
||||
#remove log file directories
|
||||
if [ $user == "root" ]; then
|
||||
rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
|
||||
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
|
||||
|
||||
# delete prat files
|
||||
$SUDO rm -f /etc/cron.d/ps > /dev/null 2>&1
|
||||
$SUDO rm -f /etc/pscollect > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/crond reload > /dev/null 2>&1
|
||||
$SUDO systemctl reload crond.service > /dev/null 2>&1
|
||||
|
||||
# delete tmp files
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
if [[ $tmpDir = *"tmp" ]]; then
|
||||
# delete tmp files
|
||||
rm -rf $tmpDir/*
|
||||
fi
|
||||
rm -f $installdir/local/*.columnstore
|
||||
rm -rf $installdir/local/etc/
|
||||
rm -rf /tmp/bucketreuse
|
||||
rm -f /tmp/columnstore.txt
|
||||
rm -f /tmp/dbbuilder.*
|
||||
rm -f /tmp/dbrmfiles
|
||||
$SUDO rm -f /var/lock/subsys/columnstore
|
||||
rm -f /tmp/pkgcheck
|
||||
rm -f /tmp/upgrade-status.log.*
|
||||
rm -f /tmp/mount.log
|
||||
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
rm -rf /tmp/columnstore_tmp_files
|
||||
rm -f $installdir/data/bulk/tmp/job/* >/dev/null 2>&1
|
||||
rm -f $installdir/local/moveDbrootTransactionLog
|
||||
|
||||
#delete any old setenv files under home directory
|
||||
if [ $user = "root" ]; then
|
||||
rm -f /root/setenv-hdfs*
|
||||
else
|
||||
rm -f /home/$user/setenv-hdfs*
|
||||
fi
|
||||
lockdir=`$installdir/bin/getConfig Installation LockFileDirectory`
|
||||
rm -f $lockdir/columnstore
|
||||
rm -f $lockdir/mysql-Columnstore
|
||||
|
||||
# delete core files
|
||||
#rm -f /var/log/mariadb/columnstore/corefiles/* > /dev/null 2>&1
|
||||
@ -103,8 +99,6 @@ fi
|
||||
if [ -x $installdir/bin/syslogSetup.sh ]; then
|
||||
if [ $user = "root" ]; then
|
||||
$installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
|
||||
else
|
||||
$SUDO $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -138,29 +132,33 @@ if [ $quiet != 1 ]; then
|
||||
#make copy of Columnstore.xml
|
||||
/bin/cp -f $installdir/etc/Columnstore.xml $installdir/etc/Columnstore.xml.rpmsave > /dev/null 2>&1
|
||||
/bin/cp -f $installdir/mysql/my.cnf $installdir/mysql/my.cnf.rpmsave > /dev/null 2>&1
|
||||
cp $installdir/bin/myCnf-include-args.text $installdir/bin/myCnf-include-args.text.rpmsave >& /dev/null
|
||||
rm -f $installdir/etc/AlarmConfig.xml.installSave
|
||||
fi
|
||||
|
||||
#umount file systems
|
||||
if [ $user = "root" ]; then
|
||||
rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
|
||||
else
|
||||
$SUDO rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
|
||||
fi
|
||||
#remove OAMdbrootCheck file
|
||||
rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
|
||||
|
||||
#remove library paths
|
||||
if [ $user = "root" ]; then
|
||||
rm -f /etc/ld.so.conf.d/columnstore.conf
|
||||
ldconfig
|
||||
else
|
||||
$SUDO rm -f /etc/defaults/columnstore
|
||||
fi
|
||||
rm -f /etc/default/columnstore
|
||||
|
||||
cat <<EOD
|
||||
|
||||
NOTE: For non-root install, you will need to run the following commands as root user to
|
||||
uninstall the MariaDB ColumnStore System Logging. This can be skipped if
|
||||
running this script as part of an upgrade
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
$installdir/bin/syslogSetup.sh --installdir=$installdir --user=$user uninstall
|
||||
|
||||
|
||||
EOD
|
||||
|
||||
#cleanup profile file
|
||||
if [ $user = "root" ]; then
|
||||
rm -f /etc/profile.d/columnstore*
|
||||
else
|
||||
$SUDO rm -f /etc/profile.d/columnstore*
|
||||
fi
|
||||
|
||||
#tell user to run post configure script
|
||||
|
@ -16,9 +16,9 @@ set PASSWORD [lindex $argv 1]
|
||||
set COMMAND [lindex $argv 2]
|
||||
set DEBUG [lindex $argv 3]
|
||||
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami >whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
|
||||
set UNM [lindex $argv 4]
|
||||
if { $UNM != "" && $UNM != "-" } {
|
||||
|
@ -7,9 +7,9 @@
|
||||
# Argument 2 - Remote Server root password
|
||||
# Argument 3 - Command
|
||||
set timeout 10
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami > whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
set SERVER [lindex $argv 0]
|
||||
set PASSWORD [lindex $argv 1]
|
||||
set FILE [lindex $argv 2]
|
||||
|
@ -7,9 +7,9 @@
|
||||
# Argument 2 - Remote Server root password
|
||||
# Argument 3 - Command
|
||||
set timeout 30
|
||||
exec whoami >/tmp/whoami.tmp
|
||||
set USERNAME [exec cat /tmp/whoami.tmp]
|
||||
exec rm -f /tmp/whoami.tmp
|
||||
exec whoami >whoami.tmp
|
||||
set USERNAME [exec cat whoami.tmp]
|
||||
exec rm -f whoami.tmp
|
||||
set SERVER [lindex $argv 0]
|
||||
set PASSWORD [lindex $argv 1]
|
||||
set FILE [lindex $argv 2]
|
||||
|
@ -3,13 +3,14 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
usage="usage: run.sh [-vh] [-s sleep] [-t tries] executable"
|
||||
usage="usage: run.sh [-vh] [-s sleep] [-t tries] [-l logDir] executable"
|
||||
|
||||
vflg=0
|
||||
sopt="5"
|
||||
topt="0"
|
||||
lopt="/tmp/columnstore_tmp_files"
|
||||
|
||||
while getopts "vs:t:h" flag; do
|
||||
while getopts "vs:t:l:h" flag; do
|
||||
case $flag in
|
||||
v) vflg=1
|
||||
;;
|
||||
@ -17,6 +18,8 @@ while getopts "vs:t:h" flag; do
|
||||
;;
|
||||
t) topt=$OPTARG
|
||||
;;
|
||||
l) lopt=$OPTARG
|
||||
;;
|
||||
h) echo $usage
|
||||
exit 0
|
||||
;;
|
||||
@ -26,9 +29,9 @@ while getopts "vs:t:h" flag; do
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
shift $((OPTIND-1))
|
||||
|
||||
exename="$1"
|
||||
exename="$@"
|
||||
|
||||
if [ -z "$exename" ]; then
|
||||
echo $usage 1>&2
|
||||
@ -47,7 +50,7 @@ fi
|
||||
|
||||
while [ $keep_going -ne 0 ]; do
|
||||
$exename $args
|
||||
if [ -e /tmp/StopColumnstore ]; then
|
||||
if [ -e ${lopt}/StopColumnstore ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ $topt -gt 0 -a $retries -ge $topt ]; then
|
||||
|
@ -8,13 +8,13 @@
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/slave-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/slave-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
grep ERROR ${tmpdir}/slave-rep-status.log > ${tmpdir}/error.check
|
||||
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: ${tmpdir}/slave-rep-status.log"
|
||||
rm -f ${tmpdir}/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
rm -f ${tmpdir}/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
@ -35,6 +35,8 @@ for arg in "$@"; do
|
||||
masterlogpos="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
||||
port="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ $(expr -- "$arg" : '--tmpdir=') -eq 9 ]; then
|
||||
tmpdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
fi
|
||||
done
|
||||
|
||||
@ -43,29 +45,29 @@ test -f $installdir/post/functions && . $installdir/post/functions
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/slave-rep-status.log
|
||||
>${tmpdir}/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run stop slave command" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run Change Master Command
|
||||
#
|
||||
echo "Run Change Master Command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run Change Master Command" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
CHANGE MASTER TO
|
||||
MASTER_HOST='$masteripaddr',
|
||||
MASTER_USER='$repUser',
|
||||
@ -76,43 +78,43 @@ CHANGE MASTER TO
|
||||
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run start slave command
|
||||
#
|
||||
echo "Run start slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run start slave command" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
start slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW SLAVE STATUS
|
||||
#
|
||||
echo "Run SHOW SLAVE STATUS to node log" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
echo "Run SHOW SLAVE STATUS to node log" >>${tmpdir}/slave-rep-status.log
|
||||
cat >${tmpdir}/idb_slave-rep.sql <<EOD
|
||||
SHOW SLAVE STATUS\G
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
cat ${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
calpontsys <${tmpdir}/idb_slave-rep.sql >>${tmpdir}/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -1,119 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# generic InfiniDB Slave Replication script.
|
||||
#
|
||||
# Notes: This script gets run by ProcMon during installs and upgrades:
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/slave-rep-status.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/slave-rep-status.log"
|
||||
rm -f /tmp/error.check
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
}
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
pwprompt=
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
prefix="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--masteripaddr='` -eq 15 ]; then
|
||||
masteripaddr="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--masterlogfile='` -eq 16 ]; then
|
||||
masterlogfile="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--masterlogpos='` -eq 15 ]; then
|
||||
masterlogpos="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
|
||||
port="`echo $arg | awk -F= '{print $2}'`"
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
repUser="idbrep"
|
||||
password="Calpont1"
|
||||
|
||||
>/tmp/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run stop slave command
|
||||
#
|
||||
echo "Run stop slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
stop slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run Change Master Command
|
||||
#
|
||||
echo "Run Change Master Command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
CHANGE MASTER TO
|
||||
MASTER_HOST='$masteripaddr',
|
||||
MASTER_USER='$repUser',
|
||||
MASTER_PASSWORD='$password',
|
||||
MASTER_PORT=$port,
|
||||
MASTER_LOG_FILE='$masterlogfile',
|
||||
MASTER_LOG_POS=$masterlogpos;
|
||||
MASTER_USE_GTID=$masterlogpos;
|
||||
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run start slave command
|
||||
#
|
||||
echo "Run start slave command" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
start slave;
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
#
|
||||
# Run SHOW SLAVE STATUS
|
||||
#
|
||||
echo "Run SHOW SLAVE STATUS to node log" >>/tmp/slave-rep-status.log
|
||||
cat >/tmp/idb_slave-rep.sql <<EOD
|
||||
SHOW SLAVE STATUS\G
|
||||
EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
checkForError
|
||||
|
||||
#alls good, 'OK' for success
|
||||
echo "OK"
|
||||
exit 0
|
@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
if [ $1 ] ; then
|
||||
MODULE=$1
|
||||
else
|
||||
MODULE="pm1"
|
||||
fi
|
||||
|
||||
if [ $2 ] ; then
|
||||
INSTALLDIR=$2
|
||||
else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
USER=`whoami 2>/dev/null`
|
||||
|
||||
if [ $USER = "root" ]; then
|
||||
SUDO=" "
|
||||
else
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
$SUDO rm -f /tmp/${MODULE}_softwareReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
echo "******************** Software Report for ${MODULE} ********************"
|
||||
echo " "
|
||||
|
||||
echo " "
|
||||
echo "-- Columnstore Package Details --"
|
||||
echo " "
|
||||
echo "################# mcsadmin getcolumnstoresoftwareinfo #################"
|
||||
echo " "
|
||||
$INSTALLDIR/bin/mcsadmin getsoftwareinfo
|
||||
|
||||
echo " "
|
||||
echo "-- Columnstore Storage Configuration --"
|
||||
echo " "
|
||||
echo "################# mcsadmin getStorageConfig #################"
|
||||
echo " "
|
||||
$INSTALLDIR/bin/mcsadmin getStorageConfig
|
||||
|
||||
} > /tmp/${MODULE}_softwareReport.txt
|
||||
|
||||
exit 0
|
@ -5,8 +5,27 @@
|
||||
# startupTests - perform sanity testing on system DB at system startup time
|
||||
# called by Process-Monitor
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
@ -14,7 +33,6 @@ if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions
|
||||
|
||||
for testScript in $COLUMNSTORE_INSTALL_DIR/post/*.sh; do
|
||||
|
@ -13,12 +13,9 @@ syslog_conf=nofile
|
||||
rsyslog7=0
|
||||
|
||||
user=`whoami 2>/dev/null`
|
||||
group=user
|
||||
|
||||
SUDO=" "
|
||||
if [ "$user" != "root" ]; then
|
||||
SUDO="sudo "
|
||||
fi
|
||||
groupname=adm
|
||||
username=syslog
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
@ -27,6 +24,10 @@ for arg in "$@"; do
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
|
||||
user="`echo $arg | awk -F= '{print $2}'`"
|
||||
groupname=$user
|
||||
username=$user
|
||||
elif [ `expr -- "$arg" : '--..*'` -ge 3 ]; then
|
||||
echo "ignoring unknown argument: $arg" 1>&2
|
||||
elif [ `expr -- "$arg" : '--'` -eq 2 ]; then
|
||||
@ -46,6 +47,9 @@ fi
|
||||
columnstoreSyslogFile=$installdir/bin/columnstoreSyslog
|
||||
columnstoreSyslogFile7=$installdir/bin/columnstoreSyslog7
|
||||
|
||||
#get temp directory
|
||||
tmpDir=`$installdir/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
checkSyslog() {
|
||||
#check which syslog daemon is being used
|
||||
#first check which is running
|
||||
@ -70,13 +74,13 @@ if [ "$daemon" = "nodaemon" ]; then
|
||||
|
||||
if [ -f /etc/syslog.conf ]; then
|
||||
daemon="syslog"
|
||||
$SUDO /etc/init.d/syslog start > /dev/null 2>&1
|
||||
/etc/init.d/syslog start > /dev/null 2>&1
|
||||
elif [ -f /etc/rsyslog.conf ]; then
|
||||
daemon="rsyslog"
|
||||
$SUDO /etc/init.d/rsyslog start > /dev/null 2>&1
|
||||
/etc/init.d/rsyslog start > /dev/null 2>&1
|
||||
elif [ -f /etc/init.d/syslog-ng ]; then
|
||||
daemon="syslog-ng"
|
||||
$SUDO /etc/init.d/syslog-ng start > /dev/null 2>&1
|
||||
/etc/init.d/syslog-ng start > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -100,16 +104,16 @@ if [ "$daemon" = "syslog-ng" ]; then
|
||||
fi
|
||||
elif [ "$daemon" = "rsyslog" ]; then
|
||||
#check if rsyslog version 7 or greater
|
||||
$SUDO rsyslogd -v > /tmp/rsyslog.ver
|
||||
cnt=`grep "rsyslogd 7" /tmp/rsyslog.ver | wc -l`
|
||||
rsyslogd -v > ${tmpDir}/rsyslog.ver
|
||||
cnt=`grep "rsyslogd 7" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
cnt=`grep "rsyslogd 8" /tmp/rsyslog.ver | wc -l`
|
||||
cnt=`grep "rsyslogd 8" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
cnt=`grep "rsyslogd 9" /tmp/rsyslog.ver | wc -l`
|
||||
cnt=`grep "rsyslogd 9" ${tmpDir}/rsyslog.ver | wc -l`
|
||||
if [ $cnt -gt 0 ]; then
|
||||
rsyslog7=1
|
||||
fi
|
||||
@ -152,23 +156,40 @@ fi
|
||||
|
||||
}
|
||||
|
||||
makeDir() {
|
||||
test -d /var/log/mariadb/columnstore || mkdir -p /var/log/mariadb/columnstore >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
|
||||
test -d /var/log/mariadb/columnstore/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||
chmod 777 -R /var/log/mariadb/columnstore
|
||||
chown $user:$user -R /var/log/mariadb
|
||||
}
|
||||
|
||||
install() {
|
||||
makeDir
|
||||
checkSyslog
|
||||
if [ ! -z "$syslog_conf" ] ; then
|
||||
$installdir/bin/setConfig -d Installation SystemLogConfigFile ${syslog_conf} >/dev/null 2>&1
|
||||
if [ "$syslog_conf" != /etc/rsyslog.d/columnstore.conf ]; then
|
||||
$SUDO rm -f ${syslog_conf}.columnstoreSave
|
||||
$SUDO cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
|
||||
$SUDO sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1
|
||||
if [ $user != "root" ]; then
|
||||
chown $user:$user /home/$user/mariadb/columnstore/etc/*
|
||||
fi
|
||||
|
||||
if [ "$syslog_conf" == /etc/rsyslog.d/columnstore.conf ] ||
|
||||
[ "$syslog_conf" == /etc/rsyslog.d/49-columnstore.conf ]; then
|
||||
i=1
|
||||
else
|
||||
rm -f ${syslog_conf}.columnstoreSave
|
||||
cp ${syslog_conf} ${syslog_conf}.columnstoreSave >/dev/null 2>&1
|
||||
sed -i '/# MariaDB/,$d' ${syslog_conf}.columnstoreSave > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
egrep -qs 'MariaDB Columnstore Database Platform Logging' ${syslog_conf}
|
||||
if [ $? -ne 0 ]; then
|
||||
#set the syslog for ColumnStore logging
|
||||
# remove older version incase it was installed by previous build
|
||||
$SUDO rm -rf /etc/rsyslog.d/columnstore.conf
|
||||
rm -rf /etc/rsyslog.d/columnstore.conf
|
||||
|
||||
// determine username/groupname
|
||||
# determine username/groupname
|
||||
|
||||
if [ -f /var/log/messages ]; then
|
||||
user=`stat -c "%U %G" /var/log/messages | awk '{print $1}'`
|
||||
@ -180,23 +201,23 @@ if [ ! -z "$syslog_conf" ] ; then
|
||||
group=`stat -c "%U %G" /var/log/syslog | awk '{print $2}'`
|
||||
fi
|
||||
|
||||
//set permissions
|
||||
$SUDO chown $user:$group -R /var/log/mariadb > /dev/null 2>&1
|
||||
# set permissions
|
||||
chown $user:$group -R /var/log/mariadb > /dev/null 2>&1
|
||||
|
||||
if [ $rsyslog7 == 1 ]; then
|
||||
sed -i -e s/groupname/$group/g ${columnstoreSyslogFile7}
|
||||
sed -i -e s/username/$user/g ${columnstoreSyslogFile7}
|
||||
rm -f /etc/rsyslog.d/49-columnstore.conf
|
||||
cp ${columnstoreSyslogFile7} ${syslog_conf}
|
||||
|
||||
$SUDO rm -f /etc/rsyslog.d/49-columnstore.conf
|
||||
$SUDO cp ${columnstoreSyslogFile7} ${syslog_conf}
|
||||
sed -i -e s/groupname/$groupname/g ${syslog_conf}
|
||||
sed -i -e s/username/$username/g ${syslog_conf}
|
||||
else
|
||||
$SUDO cp ${columnstoreSyslogFile} ${syslog_conf}
|
||||
cp ${columnstoreSyslogFile} ${syslog_conf}
|
||||
fi
|
||||
fi
|
||||
|
||||
# install Columnstore Log Rotate File
|
||||
$SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
|
||||
$SUDO chmod 644 /etc/logrotate.d/columnstore
|
||||
cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
|
||||
chmod 644 /etc/logrotate.d/columnstore
|
||||
|
||||
restartSyslog
|
||||
fi
|
||||
@ -212,21 +233,24 @@ if [ ! -z "$syslog_conf" ] ; then
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ -f ${syslog_conf}.columnstoreSave ] ; then
|
||||
#uninstall the syslog for ColumnStore logging
|
||||
$SUDO v -f ${syslog_conf} ${syslog_conf}.ColumnStoreBackup
|
||||
$SUDO mv -f ${syslog_conf}.columnstoreSave ${syslog_conf} >/dev/null 2>&1
|
||||
v -f ${syslog_conf} ${syslog_conf}.ColumnStoreBackup
|
||||
mv -f ${syslog_conf}.columnstoreSave ${syslog_conf} >/dev/null 2>&1
|
||||
if [ ! -f ${syslog_conf} ] ; then
|
||||
$SUDO cp ${syslog_conf}.ColumnStoreBackup ${syslog_conf}
|
||||
cp ${syslog_conf}.ColumnStoreBackup ${syslog_conf}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
$SUDO sed -i '/# MariaDB/,$d' ${syslog_conf} > /dev/null 2>&1
|
||||
sed -i '/# MariaDB/,$d' ${syslog_conf} > /dev/null 2>&1
|
||||
else
|
||||
$SUDO rm -f "$syslog_conf"
|
||||
rm -f "$syslog_conf"
|
||||
fi
|
||||
else
|
||||
$SUDO rm -f "$syslog_conf"
|
||||
rm -f "$syslog_conf"
|
||||
fi
|
||||
|
||||
# uninstall Columnstore Log Rotate File
|
||||
rm -f /etc/logrotate.d/columnstore
|
||||
|
||||
restartSyslog
|
||||
|
||||
fi
|
||||
@ -264,21 +288,21 @@ restartSyslog() {
|
||||
|
||||
if [ "$daemon" = "syslog-ng" ]; then
|
||||
if [ -f /etc/init.d/syslog-ng ]; then
|
||||
$SUDO /etc/init.d/syslog-ng restart > /dev/null 2>&1
|
||||
/etc/init.d/syslog-ng restart > /dev/null 2>&1
|
||||
else
|
||||
$SUDO systemctl restart syslog-ng.service > /dev/null 2>&1
|
||||
systemctl restart syslog-ng.service > /dev/null 2>&1
|
||||
fi
|
||||
elif [ "$daemon" = "rsyslog" ]; then
|
||||
if [ -f /etc/init.d/rsyslog ]; then
|
||||
$SUDO /etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
/etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
else
|
||||
$SUDO systemctl restart rsyslog.service > /dev/null 2>&1
|
||||
systemctl restart rsyslog.service > /dev/null 2>&1
|
||||
fi
|
||||
elif [ "$daemon" = "syslog" ]; then
|
||||
if [ -f /etc/init.d/syslog ]; then
|
||||
$SUDO /etc/init.d/syslog restart > /dev/null 2>&1
|
||||
/etc/init.d/syslog restart > /dev/null 2>&1
|
||||
else
|
||||
$SUDO systemctl restart syslog.service > /dev/null 2>&1
|
||||
systemctl restart syslog.service > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -1,444 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# generic InfiniDB upgrade script.
|
||||
#
|
||||
# Notes: This script gets run every time InfiniDB starts up so it needs to be:
|
||||
# 1) able to only do stuff once if needed and nothing if not needed
|
||||
# 2) reasonably fast when there's nothing to do
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/upgrade-status.log.$$ > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/upgrade-status.log.$$"
|
||||
rm -f /tmp/error.check
|
||||
exit 1;
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
}
|
||||
|
||||
if [ "x$1" != xdoupgrade ]; then
|
||||
echo "Don't run this script by hand! You probably want to use install-infinidb.sh." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
pwprompt=
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
prefix="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
mt=`module_type`
|
||||
mid=`module_id`
|
||||
|
||||
# for CE version
|
||||
if [ -z "$mt" ]; then
|
||||
mt=pm
|
||||
fi
|
||||
if [ -z "$mid" ]; then
|
||||
mid=1
|
||||
fi
|
||||
|
||||
has_um=`$installdir/bin/getConfig SystemModuleConfig ModuleCount2`
|
||||
if [ -z "$has_um" ]; then
|
||||
has_um=0
|
||||
fi
|
||||
|
||||
>/tmp/upgrade-status.log.$$
|
||||
echo "mt = $mt" >>/tmp/upgrade-status.log.$$
|
||||
echo "mid = $mid" >>/tmp/upgrade-status.log.$$
|
||||
echo "has_um = $has_um" >>/tmp/upgrade-status.log.$$
|
||||
|
||||
#This upgrade only for UM or PM with no UM
|
||||
if [ $has_um -eq 0 -o "x$mt" = xum ]; then
|
||||
#---------------------------------------------------------------------------
|
||||
# See if compressiontype column is in SYSCOLUMN
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for compressiontype..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep compressiontype >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add compressiontype column to SYSCOLUMN if applicable
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for compressiontype" >>/tmp/upgrade-status.log.$$
|
||||
echo "added compressiontype column" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table syscolumn add compressiontype int comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update compressiontype to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table syscolumn add (compressiontype int)') as xxx;
|
||||
update syscolumn set compressiontype=0 where compressiontype is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that compressiontype was successfully added to SYSCOLUMN
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep compressiontype >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding compressiontype to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding compressiontype to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that compressiontype (OID 1041) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1041 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding compressiontype to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding compressiontype to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if autoincrement column is in SYSTABLE
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for autoincrement..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | grep autoincrement >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add autoincrement column to SYSTABLE if applicable
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for autoincrement" >>/tmp/upgrade-status.log.$$
|
||||
echo "add autoincrement columns" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table systable add autoincrement int comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update autoincrement to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table systable add (autoincrement int)') as xxx;
|
||||
update systable set autoincrement=0 where autoincrement is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
#Verify that autoincrement was successfully added to SYSTABLE
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | grep autoincrement >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding autoincrement to SYSTABLE!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding autoincrement to SYSTABLE!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that autoincrement (OID 1011) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1011 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding autoincrement to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ "x$cnt" = x ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding autoincrement to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if nextvalue column is in SYSCOLUMN
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for nextvalue..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep nextvalue >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add nextvalue column to SYSCOLUMN if applicable.
|
||||
# Also set old autoincrement column in SYSCOLUMN to 'n'.
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for nextvalue" >>/tmp/upgrade-status.log.$$
|
||||
echo "add nextvalue columns" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table syscolumn add nextvalue bigint comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update nextvalue to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table syscolumn add (nextvalue bigint)') as xxx;
|
||||
update syscolumn set nextvalue=1 where nextvalue is null;
|
||||
update syscolumn set autoincrement='n' where autoincrement is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that nextvalue was successfully added to SYSCOLUMN
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep nextvalue >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding nextvalue to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding nextvalue to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that nextvalue (OID 1042) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1042 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding nextvalue to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ "x$cnt" = x ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding nextvalue to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if systable schema and tablename columns are varchar(128).
|
||||
#---------------------------------------------------------------------------
|
||||
recreate=0
|
||||
echo "checking calpontsys.systable schema and tablename for varchar(128)..." >>/tmp/upgrade-status.log.$$
|
||||
colCount=` \
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | egrep "schema|tablename" | grep "varchar(128)" | wc -l`
|
||||
if [ $colCount -ne 2 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to expand systable schema and tablename" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if syscolumn schema, tablename, and columname columns are varchar(128).
|
||||
#---------------------------------------------------------------------------
|
||||
if [ $recreate -eq 0 ]; then
|
||||
echo "checking calpontsys.syscolumn schema, tablename, columnname for varchar(128)..." >>/tmp/upgrade-status.log.$$
|
||||
colCount=` \
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | egrep "schema|tablename|columnname" | grep "varchar(128)" | wc -l`
|
||||
if [ $colCount -ne 3 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to expand syscolumn schema, tablename, and columnname" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if defaultvalue column in SYSCOLUMN is varchar(64)
|
||||
#---------------------------------------------------------------------------
|
||||
if [ $recreate -eq 0 ]; then
|
||||
echo "checking calpontsys for defaultvalue varchar(64)..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep defaultvalue | grep 'varchar(64)' >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to change defaultvalue" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Change defaultvalue column to varchar(64) if applicable
|
||||
#
|
||||
if [ $recreate -ne 0 ]; then
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
drop table if exists systable restrict;
|
||||
drop table if exists syscolumn restrict;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
echo "create systable and syscolumn with schema sync only" >>/tmp/upgrade-status.log.$$
|
||||
cat $installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys <$installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Verify column widths:
|
||||
# varchar(64) for syscolumn.defaultvalue
|
||||
# varchar(128) for systable (schema, tablename) and syscolumn (schema, tablename, and columnname).
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
echo "verify column widths" >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep defaultvalue | grep 'varchar(64)' >/tmp/upgrade-status-1.log 2>&1
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable; describe syscolumn;' \
|
||||
calpontsys | egrep "schema|tablename|columnname" | grep 'varchar(128)' >>/tmp/upgrade-status-1.log 2>&1
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 6 ]; then
|
||||
echo "FAILED width of schema, tablename, columnname, defaultvalue verification!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "OK"
|
@ -1,444 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# generic InfiniDB upgrade script.
|
||||
#
|
||||
# Notes: This script gets run every time InfiniDB starts up so it needs to be:
|
||||
# 1) able to only do stuff once if needed and nothing if not needed
|
||||
# 2) reasonably fast when there's nothing to do
|
||||
|
||||
# check log for error
|
||||
checkForError() {
|
||||
grep ERROR /tmp/upgrade-status.log.$$ > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
echo "ERROR: check log file: /tmp/upgrade-status.log.$$"
|
||||
rm -f /tmp/error.check
|
||||
exit 1;
|
||||
fi
|
||||
rm -f /tmp/error.check
|
||||
}
|
||||
|
||||
if [ "x$1" != xdoupgrade ]; then
|
||||
echo "Don't run this script by hand! You probably want to use install-infinidb.sh." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prefix=/usr/local
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
pwprompt=
|
||||
for arg in "$@"; do
|
||||
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
||||
prefix="`echo $arg | awk -F= '{print $2}'`"
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
fi
|
||||
done
|
||||
|
||||
test -f $installdir/post/functions && . $installdir/post/functions
|
||||
|
||||
mt=`module_type`
|
||||
mid=`module_id`
|
||||
|
||||
# for CE version
|
||||
if [ -z "$mt" ]; then
|
||||
mt=pm
|
||||
fi
|
||||
if [ -z "$mid" ]; then
|
||||
mid=1
|
||||
fi
|
||||
|
||||
has_um=`$installdir/bin/getConfig SystemModuleConfig ModuleCount2`
|
||||
if [ -z "$has_um" ]; then
|
||||
has_um=0
|
||||
fi
|
||||
|
||||
>/tmp/upgrade-status.log.$$
|
||||
echo "mt = $mt" >>/tmp/upgrade-status.log.$$
|
||||
echo "mid = $mid" >>/tmp/upgrade-status.log.$$
|
||||
echo "has_um = $has_um" >>/tmp/upgrade-status.log.$$
|
||||
|
||||
#This upgrade only for UM or PM with no UM
|
||||
if [ $has_um -eq 0 -o "x$mt" = xum ]; then
|
||||
#---------------------------------------------------------------------------
|
||||
# See if compressiontype column is in SYSCOLUMN
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for compressiontype..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep compressiontype >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add compressiontype column to SYSCOLUMN if applicable
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for compressiontype" >>/tmp/upgrade-status.log.$$
|
||||
echo "added compressiontype column" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table syscolumn add compressiontype int comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update compressiontype to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table syscolumn add (compressiontype int)') as xxx;
|
||||
update syscolumn set compressiontype=0 where compressiontype is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that compressiontype was successfully added to SYSCOLUMN
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep compressiontype >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding compressiontype to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding compressiontype to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that compressiontype (OID 1041) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1041 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding compressiontype to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding compressiontype to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if autoincrement column is in SYSTABLE
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for autoincrement..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | grep autoincrement >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add autoincrement column to SYSTABLE if applicable
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for autoincrement" >>/tmp/upgrade-status.log.$$
|
||||
echo "add autoincrement columns" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table systable add autoincrement int comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update autoincrement to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table systable add (autoincrement int)') as xxx;
|
||||
update systable set autoincrement=0 where autoincrement is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
#Verify that autoincrement was successfully added to SYSTABLE
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | grep autoincrement >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding autoincrement to SYSTABLE!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding autoincrement to SYSTABLE!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that autoincrement (OID 1011) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1011 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding autoincrement to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ "x$cnt" = x ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding autoincrement to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if nextvalue column is in SYSCOLUMN
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking calpontsys for nextvalue..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep nextvalue >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
#
|
||||
# Add nextvalue column to SYSCOLUMN if applicable.
|
||||
# Also set old autoincrement column in SYSCOLUMN to 'n'.
|
||||
#
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "calpontsys needs upgrade for nextvalue" >>/tmp/upgrade-status.log.$$
|
||||
echo "add nextvalue columns" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
alter table syscolumn add nextvalue bigint comment 'schema sync only';
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
if [ $mid -eq 1 ]; then
|
||||
echo "update nextvalue to backend" >>/tmp/upgrade-status.log.$$
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
select calonlinealter('alter table syscolumn add (nextvalue bigint)') as xxx;
|
||||
update syscolumn set nextvalue=1 where nextvalue is null;
|
||||
update syscolumn set autoincrement='n' where autoincrement is null;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that nextvalue was successfully added to SYSCOLUMN
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep nextvalue >/tmp/upgrade-status-1.log 2>&1
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding nextvalue to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 1 ]; then
|
||||
echo "FAILED adding nextvalue to SYSCOLUMN!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Verify that nextvalue (OID 1042) was successfully added to BRM
|
||||
#
|
||||
if [ $has_um -eq 0 ]; then
|
||||
$installdir/bin/editem -o1042 1>/tmp/upgrade-status-1.log 2>/dev/null
|
||||
rc=$?
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "FAILED adding nextvalue to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ "x$cnt" = x ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -lt 2 ]; then
|
||||
echo "FAILED adding nextvalue to BRM!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if systable schema and tablename columns are varchar(128).
|
||||
#---------------------------------------------------------------------------
|
||||
recreate=0
|
||||
echo "checking calpontsys.systable schema and tablename for varchar(128)..." >>/tmp/upgrade-status.log.$$
|
||||
colCount=` \
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable;' \
|
||||
calpontsys | egrep "schema|tablename" | grep "varchar(128)" | wc -l`
|
||||
if [ $colCount -ne 2 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to expand systable schema and tablename" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if syscolumn schema, tablename, and columname columns are varchar(128).
|
||||
#---------------------------------------------------------------------------
|
||||
if [ $recreate -eq 0 ]; then
|
||||
echo "checking calpontsys.syscolumn schema, tablename, columnname for varchar(128)..." >>/tmp/upgrade-status.log.$$
|
||||
colCount=` \
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | egrep "schema|tablename|columnname" | grep "varchar(128)" | wc -l`
|
||||
if [ $colCount -ne 3 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to expand syscolumn schema, tablename, and columnname" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# See if defaultvalue column in SYSCOLUMN is varchar(64)
|
||||
#---------------------------------------------------------------------------
|
||||
if [ $recreate -eq 0 ]; then
|
||||
echo "checking calpontsys for defaultvalue varchar(64)..." >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep defaultvalue | grep 'varchar(64)' >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
recreate=1
|
||||
echo "calpontsys needs upgrade to change defaultvalue" >>/tmp/upgrade-status.log.$$
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Change defaultvalue column to varchar(64) if applicable
|
||||
#
|
||||
if [ $recreate -ne 0 ]; then
|
||||
cat >/tmp/idb_upgrade.sql <<EOD
|
||||
drop table if exists systable restrict;
|
||||
drop table if exists syscolumn restrict;
|
||||
EOD
|
||||
cat /tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_upgrade.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
echo "create systable and syscolumn with schema sync only" >>/tmp/upgrade-status.log.$$
|
||||
cat $installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys <$installdir/mysql/syscatalog_mysql.sql >>/tmp/upgrade-status.log.$$ 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Verify column widths:
|
||||
# varchar(64) for syscolumn.defaultvalue
|
||||
# varchar(128) for systable (schema, tablename) and syscolumn (schema, tablename, and columnname).
|
||||
#
|
||||
rm -f /tmp/idb_upgrade.sql
|
||||
echo "verify column widths" >>/tmp/upgrade-status.log.$$
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe syscolumn;' \
|
||||
calpontsys | grep defaultvalue | grep 'varchar(64)' >/tmp/upgrade-status-1.log 2>&1
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='describe systable; describe syscolumn;' \
|
||||
calpontsys | egrep "schema|tablename|columnname" | grep 'varchar(128)' >>/tmp/upgrade-status-1.log 2>&1
|
||||
cat /tmp/upgrade-status-1.log >>/tmp/upgrade-status.log.$$
|
||||
cnt=`wc -l /tmp/upgrade-status-1.log | awk '{print $1}'`
|
||||
rm -f /tmp/upgrade-status-1.log
|
||||
if [ -z "$cnt" ]; then
|
||||
cnt=0
|
||||
fi
|
||||
if [ $cnt -ne 6 ]; then
|
||||
echo "FAILED width of schema, tablename, columnname, defaultvalue verification!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "OK"
|
@ -1,173 +0,0 @@
|
||||
#!/usr/bin/expect
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Install custom OS files on External Module
|
||||
# Argument 1 - Remote Module Name
|
||||
# Argument 2 - Remote Server Host Name or IP address
|
||||
# Argument 3 - OAM Parent Host Name
|
||||
# Argument 4 - Root Password of remote server
|
||||
# Argument 5 - Debug flag 1 for on, 0 for off
|
||||
set timeout 10
|
||||
set USERNAME root
|
||||
set MODULE [lindex $argv 0]
|
||||
set SERVER [lindex $argv 1]
|
||||
set OAMHOSTNAME [lindex $argv 2]
|
||||
set PASSWORD [lindex $argv 3]
|
||||
set DEBUG [lindex $argv 4]
|
||||
log_user $DEBUG
|
||||
spawn -noecho /bin/bash
|
||||
#
|
||||
# Validate Calpont RPM is installed
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Check Calpont RPM installed "
|
||||
expect -re "# "
|
||||
send "ssh $USERNAME@$SERVER 'rpm -iq calpont'\n"
|
||||
expect {
|
||||
-re "Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit }
|
||||
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit }
|
||||
-re "authenticity" { send "yes\n"
|
||||
expect {
|
||||
-re "word: " { send "$PASSWORD\n" }
|
||||
}
|
||||
}
|
||||
-re "word: " { send "$PASSWORD\n" }
|
||||
}
|
||||
expect {
|
||||
-re "tools " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "package calpont" { send_user "ERROR: Calpont RPM not installed on External Module\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
# Create mount directories
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Create etc mount directory "
|
||||
expect -re "# "
|
||||
send "ssh $USERNAME@$SERVER 'mkdir /mnt/$OAMHOSTNAME\_etc'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "mkdir: cannot" { send_user "DONE: already installed\n"
|
||||
send_user "\nInstallation Successfully Completed on '$MODULE'\n"; exit 0 }
|
||||
}
|
||||
send_user "\n"
|
||||
send_user "Create OAM mount directory "
|
||||
send "ssh $USERNAME@$SERVER 'mkdir /mnt/$OAMHOSTNAME\_OAM'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "mkdir: cannot" { send_user "DONE: already installed\n"
|
||||
send_user "\nInstallation Successfully Completed on '$MODULE'\n"; exit 0 }
|
||||
}
|
||||
#
|
||||
# copy over calpont OS files
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Copy Mount File to Module "
|
||||
send "scp /tmp/etc/$MODULE/*mount $USERNAME@$SERVER:/mnt/.\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "100%" { send_user "DONE" }
|
||||
-re "scp" { send_user "ERROR\n" ;
|
||||
send_user "\n*** Installation ERROR\n" ;
|
||||
exit -1 }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "No such file or directory" { send_user "ERROR: Invalid file\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Copy Custom inittab to Module "
|
||||
send "scp /tmp/etc/$MODULE/inittab.calpont $USERNAME@$SERVER:/tmp/.\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "100%" { send_user "DONE" }
|
||||
-re "scp" { send_user "ERROR\n" ;
|
||||
send_user "\n*** Installation ERROR\n" ;
|
||||
exit -1 }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "No such file or directory" { send_user "ERROR: Invalid file\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Copy syslogd.conf to Module "
|
||||
send "scp /etc/syslog.conf $USERNAME@$SERVER:/etc/.\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "100%" { send_user "DONE" }
|
||||
-re "scp" { send_user "ERROR\n" ;
|
||||
send_user "\n*** Installation ERROR\n" ;
|
||||
exit -1 }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
-re "No such file or directory" { send_user "ERROR: Invalid file\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
# chmod of mount file
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Run chmod on Mount File "
|
||||
send "ssh $USERNAME@$SERVER 'chmod 755 /mnt/$OAMHOSTNAME\_*mount'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
# Update External Module inittab
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Update inittab "
|
||||
send "ssh $USERNAME@$SERVER 'cat /tmp/inittab.calpont >> /etc/inittab'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
# Restart External Module syslogd
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Restart syslogd "
|
||||
send "ssh $USERNAME@$SERVER 'service syslog restart'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
}
|
||||
#
|
||||
# startup ProcMon
|
||||
#
|
||||
send_user "\n"
|
||||
send_user "Startup ProcMon "
|
||||
send "ssh $USERNAME@$SERVER 'kill -HUP 1'\n"
|
||||
expect -re "word: "
|
||||
# send the password
|
||||
send "$PASSWORD\n"
|
||||
expect {
|
||||
-re "# " { send_user "DONE" }
|
||||
-re "Permission denied" { send_user "ERROR: Invalid password\n" ; exit -1 }
|
||||
}
|
||||
send_user "\n"
|
||||
#
|
||||
send_user "\nInstallation Successfully Completed on '$MODULE'\n"
|
||||
exit 0
|
||||
|
@ -148,6 +148,21 @@ Oam::Oam()
|
||||
}
|
||||
catch (...) {} // defaulted to false
|
||||
}
|
||||
|
||||
//get user
|
||||
string USER = "root";
|
||||
char* p = getenv("USER");
|
||||
|
||||
if (p && *p)
|
||||
USER = p;
|
||||
|
||||
userDir = USER;
|
||||
|
||||
if ( USER != "root")
|
||||
userDir = "home/" + USER;
|
||||
|
||||
tmpdir = startup::StartUp::tmpDir();
|
||||
|
||||
}
|
||||
|
||||
Oam::~Oam()
|
||||
@ -3558,19 +3573,19 @@ void Oam::getLogFile(const std::string moduleName, const std::string loglevel, c
|
||||
|
||||
logFile = path + logFile;
|
||||
|
||||
string tempLogFile = "/tmp/logs";
|
||||
string tempLogFile = tmpdir +"/logs";
|
||||
|
||||
//make 1 log file made up of archive and current *.log
|
||||
(void)system("touch /tmp/logs");
|
||||
(void)system(tempLogFile.c_str());
|
||||
|
||||
string logdir("/var/log/mariadb/columnstore");
|
||||
|
||||
if (access(logdir.c_str(), W_OK) != 0) logdir = "/tmp";
|
||||
if (access(logdir.c_str(), W_OK) != 0) logdir = tmpdir;
|
||||
|
||||
string cmd = "ls " + path + logdir + "/archive | grep '" + logFileName + "' > /tmp/logfiles";
|
||||
string cmd = "ls " + path + logdir + "/archive | grep '" + logFileName + "' > " + tmpdir + "/logfiles";
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
string fileName = "/tmp/logfiles";
|
||||
string fileName = tmpdir + "/logfiles";
|
||||
|
||||
ifstream oldFile (fileName.c_str());
|
||||
|
||||
@ -3582,7 +3597,7 @@ void Oam::getLogFile(const std::string moduleName, const std::string loglevel, c
|
||||
while (oldFile.getline(line, 400))
|
||||
{
|
||||
buf = line;
|
||||
cmd = "cat " + path + logdir + "/archive/" + buf + " >> /tmp/logs";
|
||||
cmd = "cat " + path + logdir + "/archive/" + buf + " >> " + tempLogFile;
|
||||
(void)system(cmd.c_str());
|
||||
}
|
||||
|
||||
@ -3590,7 +3605,7 @@ void Oam::getLogFile(const std::string moduleName, const std::string loglevel, c
|
||||
unlink (fileName.c_str());
|
||||
}
|
||||
|
||||
cmd = "cat " + logFile + " >> /tmp/logs";
|
||||
cmd = "cat " + logFile + " >> " + tempLogFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
//validate and get mm / dd from incoming date
|
||||
@ -3708,7 +3723,7 @@ void Oam::getLogFile(const std::string moduleName, const std::string loglevel, c
|
||||
unlink (tempLogFile.c_str());
|
||||
}
|
||||
|
||||
fileName = "/tmp/logsByDate";
|
||||
fileName = tmpdir + "/logsByDate";
|
||||
ofstream newFile (fileName.c_str());
|
||||
|
||||
//create new file
|
||||
@ -5641,7 +5656,6 @@ void Oam::manualMovePmDbroot(std::string residePM, std::string dbrootIDs, std::s
|
||||
cout << endl << "ERROR: umountDBRoot api failure" << endl;
|
||||
exceptionControl("manualMovePmDbroot", API_FAILURE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//check for amazon moving required
|
||||
@ -6488,10 +6502,10 @@ void Oam::addUMdisk(const int moduleID, std::string& volumeName, std::string& de
|
||||
int user;
|
||||
user = getuid();
|
||||
|
||||
if (user == 0)
|
||||
cmd = "mkfs.ext2 -F " + device + " > /dev/null 2>&1";
|
||||
if ( user == 0 )
|
||||
cmd = "mkfs.ext2 -F " + device + " > " + tmpdir + "/format.log 2>&1";
|
||||
else
|
||||
cmd = "sudo mkfs.ext2 -F " + device + " > /dev/null 2>&1";
|
||||
cmd = "sudo mkfs.ext2 -F " + device + " > " + tmpdir + "/format.log 2>&1";
|
||||
|
||||
system(cmd.c_str());
|
||||
|
||||
@ -6738,10 +6752,10 @@ void Oam::addDbroot(const int dbrootNumber, DBRootConfigList& dbrootlist, string
|
||||
int user;
|
||||
user = getuid();
|
||||
|
||||
if (user == 0)
|
||||
cmd = "mkfs.ext2 -F " + amazonDeviceName + " > /tmp/format.log 2>&1";
|
||||
if (user == 0 )
|
||||
cmd = "mkfs.ext2 -F " + amazonDeviceName + " > " + tmpdir + "/format.log 2>&1";
|
||||
else
|
||||
cmd = "sudo mkfs.ext2 -F " + amazonDeviceName + " > /tmp/format.log 2>&1";
|
||||
cmd = "sudo mkfs.ext2 -F " + amazonDeviceName + " > " + tmpdir + "/format.log 2>&1";
|
||||
|
||||
writeLog("addDbroot format cmd: " + cmd, LOG_TYPE_DEBUG );
|
||||
|
||||
@ -7795,17 +7809,19 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
|
||||
string command;
|
||||
|
||||
string pidtmp = tmpdir + "/mysql.pid";
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case MYSQL_START:
|
||||
{
|
||||
command = "start > /tmp/actionMysqlCalpont.log 2>&1";
|
||||
command = "start > " + tmpdir + "/actionMysqlCalpont.log 2>&1";
|
||||
break;
|
||||
}
|
||||
|
||||
case MYSQL_STOP:
|
||||
{
|
||||
command = "stop > /tmp/actionMysqlCalpont.log 2>&1";
|
||||
command = "stop > " + tmpdir + "/actionMysqlCalpont.log 2>&1";
|
||||
|
||||
//set process status
|
||||
try
|
||||
@ -7820,25 +7836,25 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
|
||||
case MYSQL_RESTART:
|
||||
{
|
||||
command = "restart > /tmp/actionMysqlCalpont.log 2>&1";
|
||||
command = "restart > " + tmpdir + "/actionMysqlCalpont.log 2>&1";
|
||||
break;
|
||||
}
|
||||
|
||||
case MYSQL_RELOAD:
|
||||
{
|
||||
command = "reload > /tmp/actionMysqlCalpont.log 2>&1";
|
||||
command = "reload > " + tmpdir + "/actionMysqlCalpont.log 2>&1";
|
||||
break;
|
||||
}
|
||||
|
||||
case MYSQL_FORCE_RELOAD:
|
||||
{
|
||||
command = "force-reload > /tmp/actionMysqlCalpont.log 2>&1";
|
||||
command = "force-reload > " + tmpdir + "/actionMysqlCalpont.log 2>&1";
|
||||
break;
|
||||
}
|
||||
|
||||
case MYSQL_STATUS:
|
||||
{
|
||||
command = "status > /tmp/mysql.status";
|
||||
command = "status > " + tmpdir + "/mysql.status";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -7856,9 +7872,9 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
if (action == MYSQL_START || action == MYSQL_RESTART)
|
||||
{
|
||||
//get pid
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > /tmp/mysql.pid";
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile ("/tmp/mysql.pid");
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
|
||||
//fail if file size 0
|
||||
oldFile.seekg(0, std::ios::end);
|
||||
@ -7909,14 +7925,15 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
int state = procstat.ProcessOpState;
|
||||
pid_t pidStatus = procstat.ProcessID;
|
||||
|
||||
if (checkLogStatus("/tmp/mysql.status", "MySQL running"))
|
||||
string mysqlStatus = tmpdir + "/mysql.status";
|
||||
if (checkLogStatus(mysqlStatus, "MySQL running"))
|
||||
{
|
||||
if ( state != ACTIVE )
|
||||
{
|
||||
//get pid
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > /tmp/mysql.pid";
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile ("/tmp/mysql.pid");
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
char line[400];
|
||||
string pid;
|
||||
|
||||
@ -7941,9 +7958,9 @@ void Oam::actionMysqlCalpont(MYSQLCALPONT_ACTION action)
|
||||
else
|
||||
{
|
||||
//check if pid has changed
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > /tmp/mysql.pid";
|
||||
cmd = "cat " + InstallDir + "/mysql/db/*.pid > " + pidtmp;
|
||||
system(cmd.c_str());
|
||||
ifstream oldFile ("/tmp/mysql.pid");
|
||||
ifstream oldFile(pidtmp.c_str());
|
||||
char line[400];
|
||||
string pid;
|
||||
|
||||
@ -8218,19 +8235,19 @@ int Oam::validateModule(const std::string name)
|
||||
std::string Oam::getEC2InstanceIpAddress(std::string instanceName)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getPrivateIP " + instanceName + " > /tmp/getCloudIP_" + instanceName;
|
||||
string tmplog = tmpdir + "/getCloudIP_" + instanceName;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getPrivateIP " + instanceName + " > " + tmplog;
|
||||
system(cmd.c_str());
|
||||
|
||||
if (checkLogStatus("/tmp/getCloudIP_" + instanceName, "stopped") )
|
||||
if (checkLogStatus(tmplog, "stopped") )
|
||||
return "stopped";
|
||||
|
||||
if (checkLogStatus("/tmp/getCloudIP_" + instanceName, "terminated") )
|
||||
if (checkLogStatus(tmplog, "terminated") )
|
||||
return "terminated";
|
||||
|
||||
// get IP Address
|
||||
string IPAddr;
|
||||
string file = "/tmp/getCloudIP_" + instanceName;
|
||||
ifstream oldFile (file.c_str());
|
||||
ifstream oldFile (tmplog.c_str());
|
||||
char line[400];
|
||||
|
||||
while (oldFile.getline(line, 400))
|
||||
@ -8257,14 +8274,14 @@ std::string Oam::getEC2InstanceIpAddress(std::string instanceName)
|
||||
std::string Oam::getEC2LocalInstance(std::string name)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getInstance > /tmp/getInstanceInfo_" + name;
|
||||
string file = tmpdir + "/getInstanceInfo_" + name;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getInstance > " + file;
|
||||
int status = system(cmd.c_str());
|
||||
if (WEXITSTATUS(status) == 1 )
|
||||
return "failed";
|
||||
|
||||
// get Instance Name
|
||||
string instanceName;
|
||||
string file = "/tmp/getInstanceInfo_" + name;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8290,14 +8307,14 @@ std::string Oam::getEC2LocalInstance(std::string name)
|
||||
std::string Oam::getEC2LocalInstanceType(std::string name)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getType > /tmp/getInstanceType_" + name;
|
||||
string file = tmpdir + "/getInstanceType_" + name;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getType > " + file;
|
||||
int status = system(cmd.c_str());
|
||||
if (WEXITSTATUS(status) == 1 )
|
||||
return "failed";
|
||||
|
||||
// get Instance Name
|
||||
string instanceType;
|
||||
string file = "/tmp/getInstanceType_" + name;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8323,14 +8340,14 @@ std::string Oam::getEC2LocalInstanceType(std::string name)
|
||||
std::string Oam::getEC2LocalInstanceSubnet(std::string name)
|
||||
{
|
||||
// run script to get Instance Subnet
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getSubnet > /tmp/getInstanceSubnet_" + name;
|
||||
string file = tmpdir + "/getInstanceSubnet_" + name;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getSubnet > " + file;
|
||||
int status = system(cmd.c_str());
|
||||
if (WEXITSTATUS(status) == 1 )
|
||||
return "failed";
|
||||
|
||||
// get Instance Name
|
||||
string instanceSubnet;
|
||||
string file = "/tmp/getInstanceSubnet_" + name;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8357,17 +8374,17 @@ std::string Oam::getEC2LocalInstanceSubnet(std::string name)
|
||||
std::string Oam::launchEC2Instance( const std::string name, const std::string IPAddress, const std::string type, const std::string group)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh launchInstance " + IPAddress + " " + type + " " + group + " > /tmp/getInstance_" + name;
|
||||
string file = tmpdir + "/getInstance_" + name;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh launchInstance " + IPAddress + " " + type + " " + group + " > " + file;
|
||||
int status = system(cmd.c_str());
|
||||
if (WEXITSTATUS(status) == 1 )
|
||||
return "failed";
|
||||
|
||||
if (checkLogStatus("/tmp/getInstance", "Required") )
|
||||
if (checkLogStatus(file, "Required") )
|
||||
return "failed";
|
||||
|
||||
// get Instance ID
|
||||
string instance;
|
||||
string file = "/tmp/getInstance_" + name;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8401,7 +8418,7 @@ std::string Oam::launchEC2Instance( const std::string name, const std::string IP
|
||||
void Oam::terminateEC2Instance(std::string instanceName)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh terminateInstance " + instanceName + " > /tmp/terminateEC2Instance_" + instanceName;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh terminateInstance " + instanceName + " > " + tmpdir + "/terminateEC2Instance_" + instanceName;
|
||||
system(cmd.c_str());
|
||||
|
||||
return;
|
||||
@ -8418,7 +8435,7 @@ void Oam::terminateEC2Instance(std::string instanceName)
|
||||
void Oam::stopEC2Instance(std::string instanceName)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh stopInstance " + instanceName + " > /tmp/stopEC2Instance_" + instanceName;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh stopInstance " + instanceName + " > " + tmpdir + "/stopEC2Instance_" + instanceName;
|
||||
system(cmd.c_str());
|
||||
|
||||
return;
|
||||
@ -8435,7 +8452,7 @@ void Oam::stopEC2Instance(std::string instanceName)
|
||||
bool Oam::startEC2Instance(std::string instanceName)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh startInstance " + instanceName + " > /tmp/startEC2Instance_" + instanceName;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh startInstance " + instanceName + " > " + tmpdir + "/startEC2Instance_" + instanceName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
return false;
|
||||
@ -8454,7 +8471,7 @@ bool Oam::startEC2Instance(std::string instanceName)
|
||||
bool Oam::assignElasticIP(std::string instanceName, std::string IpAddress)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh assignElasticIP " + instanceName + " " + IpAddress + " > /tmp/assignElasticIP_" + instanceName;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh assignElasticIP " + instanceName + " " + IpAddress + " > " + tmpdir + "/assignElasticIP_" + instanceName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
exceptionControl("assignElasticIP", oam::API_FAILURE);
|
||||
@ -8473,7 +8490,7 @@ bool Oam::assignElasticIP(std::string instanceName, std::string IpAddress)
|
||||
bool Oam::deassignElasticIP(std::string IpAddress)
|
||||
{
|
||||
// run script to get Instance status and IP Address
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh deassignElasticIP " + IpAddress + " > /tmp/deassignElasticIP_" + IpAddress;
|
||||
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh deassignElasticIP " + IpAddress + " > " + tmpdir + "/deassignElasticIP_" + IpAddress;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
exceptionControl("deassignElasticIP", oam::API_FAILURE);
|
||||
@ -8492,7 +8509,7 @@ bool Oam::deassignElasticIP(std::string IpAddress)
|
||||
std::string Oam::getEC2VolumeStatus(std::string volumeName)
|
||||
{
|
||||
// run script to get Volume Status
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh describe " + volumeName + " > /tmp/getVolumeStatus_" + volumeName;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh describe " + volumeName + " > " + tmpdir + "/getVolumeStatus_" + volumeName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 ){
|
||||
return "failed";
|
||||
@ -8500,7 +8517,7 @@ std::string Oam::getEC2VolumeStatus(std::string volumeName)
|
||||
|
||||
// get status
|
||||
string status;
|
||||
string file = "/tmp/getVolumeStatus_" + volumeName;
|
||||
string file = tmpdir + "/getVolumeStatus_" + volumeName;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8526,14 +8543,14 @@ std::string Oam::getEC2VolumeStatus(std::string volumeName)
|
||||
std::string Oam::createEC2Volume(std::string size, std::string name)
|
||||
{
|
||||
// run script to get Volume Status
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh create " + size + " " + name + " > /tmp/createVolumeStatus_" + name;
|
||||
string file = tmpdir + "/createVolumeStatus_" + name;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh create " + size + " " + name + " > " + file;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
return "failed";
|
||||
|
||||
// get status
|
||||
string volumeName;
|
||||
string file = "/tmp/createVolumeStatus_" + name;
|
||||
ifstream oldFile (file.c_str());
|
||||
char line[400];
|
||||
|
||||
@ -8573,7 +8590,7 @@ bool Oam::attachEC2Volume(std::string volumeName, std::string deviceName, std::s
|
||||
for ( int retry = 0 ; retry < 2 ; retry++ )
|
||||
{
|
||||
// run script to attach Volume
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh attach " + volumeName + " " + instanceName + " " + deviceName + " > /tmp/attachVolumeStatus_" + volumeName;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh attach " + volumeName + " " + instanceName + " " + deviceName + " > " + tmpdir + "/attachVolumeStatus_" + volumeName;
|
||||
ret = system(cmd.c_str());
|
||||
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
@ -8604,7 +8621,7 @@ bool Oam::attachEC2Volume(std::string volumeName, std::string deviceName, std::s
|
||||
bool Oam::detachEC2Volume(std::string volumeName)
|
||||
{
|
||||
// run script to attach Volume
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh detach " + volumeName + " > /tmp/detachVolumeStatus_" + volumeName;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh detach " + volumeName + " > " + tmpdir + "/detachVolumeStatus_" + volumeName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
return false;
|
||||
@ -8623,7 +8640,7 @@ bool Oam::detachEC2Volume(std::string volumeName)
|
||||
bool Oam::deleteEC2Volume(std::string volumeName)
|
||||
{
|
||||
// run script to delete Volume
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh delete " + volumeName + " > /tmp/deleteVolumeStatus_" + volumeName;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh delete " + volumeName + " > " + tmpdir + "/deleteVolumeStatus_" + volumeName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
return false;
|
||||
@ -8642,7 +8659,7 @@ bool Oam::deleteEC2Volume(std::string volumeName)
|
||||
bool Oam::createEC2tag(std::string resourceName, std::string tagName, std::string tagValue)
|
||||
{
|
||||
// run script to create a tag
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh createTag " + resourceName + " " + tagName + " " + tagValue + " > /tmp/createTagStatus_" + resourceName;
|
||||
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh createTag " + resourceName + " " + tagName + " " + tagValue + " > " + tmpdir + "createTagStatus_" + resourceName;
|
||||
int ret = system(cmd.c_str());
|
||||
if (WEXITSTATUS(ret) == 1 )
|
||||
return false;
|
||||
@ -8694,20 +8711,10 @@ void Oam::syslogAction( std::string action)
|
||||
}
|
||||
else
|
||||
{
|
||||
int user;
|
||||
user = getuid();
|
||||
|
||||
if (user == 0)
|
||||
cmd = "systemctl " + action + " " + systemlog + ".service > /dev/null 2>&1";
|
||||
else
|
||||
cmd = "sudo systemctl " + action + " " + systemlog + ".service > /dev/null 2>&1";
|
||||
|
||||
system(cmd.c_str());
|
||||
|
||||
if (user == 0)
|
||||
cmd = "/service " + systemlog + " " + action + " > /dev/null 2>&1";
|
||||
else
|
||||
cmd = "sudo service" + systemlog + " " + action + " > /dev/null 2>&1";
|
||||
cmd = "service " + systemlog + " " + action + " > /dev/null 2>&1";
|
||||
}
|
||||
|
||||
// take action on syslog service
|
||||
@ -9311,7 +9318,7 @@ int Oam::checkGlusterLog(std::string logFile, std::string& msg)
|
||||
{
|
||||
if (checkLogStatus(logFile, "OK"))
|
||||
{
|
||||
if ( logFile == "/tmp/gluster_howhas.log" )
|
||||
if ( logFile == tmpdir + "/gluster_howhas.log" )
|
||||
{
|
||||
ifstream File(logFile.c_str());
|
||||
|
||||
@ -9366,7 +9373,7 @@ int Oam::checkGlusterLog(std::string logFile, std::string& msg)
|
||||
|
||||
writeLog("checkGlusterLog: FAILURE", LOG_TYPE_ERROR);
|
||||
|
||||
if ( logFile == "/tmp/gluster_howhas.log" )
|
||||
if ( logFile == tmpdir + "/gluster_howhas.log" )
|
||||
return 2;
|
||||
else
|
||||
exceptionControl("glusterctl", API_FAILURE);
|
||||
@ -9387,9 +9394,6 @@ int Oam::checkGlusterLog(std::string logFile, std::string& msg)
|
||||
******************************************************************************************/
|
||||
std::string Oam::getMySQLPassword()
|
||||
{
|
||||
|
||||
return oam::UnassignedName;
|
||||
|
||||
string mysqlUser = "root";
|
||||
|
||||
string USER = "root";
|
||||
@ -9413,7 +9417,7 @@ std::string Oam::getMySQLPassword()
|
||||
if (!file)
|
||||
{
|
||||
writeLog("getMySQLPassword: doesn't exist: " + fileName, LOG_TYPE_DEBUG);
|
||||
exceptionControl("getMySQLPassword", API_FILE_OPEN_ERROR);
|
||||
return oam::UnassignedName;
|
||||
}
|
||||
|
||||
char line[400];
|
||||
@ -9463,7 +9467,7 @@ std::string Oam::getMySQLPassword()
|
||||
/******************************************************************************************
|
||||
* @brief updateFstab
|
||||
*
|
||||
* purpose: check and get mysql user password
|
||||
* purpose: Update Fstabs for Amazon EBS setup
|
||||
*
|
||||
******************************************************************************************/
|
||||
std::string Oam::updateFstab(std::string device, std::string dbrootID)
|
||||
@ -9483,30 +9487,22 @@ std::string Oam::updateFstab(std::string device, std::string dbrootID)
|
||||
|
||||
string cmd;
|
||||
|
||||
if (user == 0)
|
||||
cmd = "grep /data" + dbrootID + " /etc/fstab > /dev/null 2>&1";
|
||||
else
|
||||
cmd = "sudo grep /data" + dbrootID + " /etc/fstab > /dev/null 2>&1";
|
||||
|
||||
int status = system(cmd.c_str());
|
||||
|
||||
if (WEXITSTATUS(status) != 0 )
|
||||
{
|
||||
//update /etc/fstab with mount
|
||||
//chmod before update, used on amazon ami EBS. not other systems
|
||||
system("sudo chmod 666 /etc/fstab");
|
||||
|
||||
//update local fstab
|
||||
if (user == 0)
|
||||
cmd = "echo " + entry + " >> /etc/fstab";
|
||||
else
|
||||
cmd = "sudo echo " + entry + " >> /etc/fstab";
|
||||
|
||||
system(cmd.c_str());
|
||||
}
|
||||
|
||||
if (user == 0)
|
||||
cmd = "grep /data" + dbrootID + " " + InstallDir + "/local/etc/pm1/fstab > /dev/null 2>&1";
|
||||
else
|
||||
cmd = "sudo grep /data" + dbrootID + " " + InstallDir + "/local/etc/pm1/fstab > /dev/null 2>&1";
|
||||
|
||||
status = system(cmd.c_str());
|
||||
|
||||
@ -10886,11 +10882,21 @@ int Oam::readHdfsActiveAlarms(AlarmList& alarmList)
|
||||
|
||||
bool Oam::checkSystemRunning()
|
||||
{
|
||||
// string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||
// system(cmd.c_str());
|
||||
struct stat st;
|
||||
|
||||
if (stat("/var/lock/subsys/columnstore", &st) == 0)
|
||||
string lockFileDir = "/var/subsys/lock";
|
||||
|
||||
try
|
||||
{
|
||||
Config* sysConfig = Config::makeConfig(CalpontConfigFile.c_str());
|
||||
lockFileDir = sysConfig->getConfig("Installation", "LockFileDirectory");
|
||||
}
|
||||
catch (...)
|
||||
{} // defaulted to false
|
||||
|
||||
string lockFile = lockFileDir + "/columnstore";
|
||||
|
||||
if (stat(lockFile.c_str(), &st) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2521,11 +2521,13 @@ private:
|
||||
*/
|
||||
void sendStatusUpdate(messageqcpp::ByteStream obs, messageqcpp::ByteStream::byte returnRequestType);
|
||||
|
||||
std::string tmpdir;
|
||||
std::string CalpontConfigFile;
|
||||
std::string AlarmConfigFile;
|
||||
std::string ProcessConfigFile;
|
||||
std::string InstallDir;
|
||||
static int UseHdfs;
|
||||
std::string userDir;
|
||||
|
||||
}; // end of class
|
||||
|
||||
|
@ -2,8 +2,29 @@
|
||||
# $Id: functions 2937 2012-05-30 18:17:09Z rdempsey $
|
||||
#
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
|
@ -2,8 +2,29 @@
|
||||
#
|
||||
# $Id: test-001.sh 3704 2013-08-07 03:33:20Z bwilkinson $
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
|
@ -2,8 +2,29 @@
|
||||
#
|
||||
# $Id: test-002.sh 2937 2012-05-30 18:17:09Z rdempsey $
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
|
@ -2,8 +2,29 @@
|
||||
#
|
||||
# $Id: test-003.sh 2937 2012-05-30 18:17:09Z rdempsey $
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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
|
||||
|
@ -6,14 +6,36 @@
|
||||
# Validates that FilesPerColumnPartition setting is not set lower than existing extents.
|
||||
#
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
test -f /etc/default/columnstore && . /etc/default/columnstore
|
||||
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_DI
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions
|
||||
|
@ -505,39 +505,8 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
|
||||
// shutdown connection
|
||||
procmgr.shutdown();
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
{
|
||||
LoggingID lid(11);
|
||||
MessageLog ml(lid);
|
||||
Message msg;
|
||||
Message::Args args;
|
||||
args.add("sendAlarmReport error:");
|
||||
args.add(e.what());
|
||||
msg.format(args);
|
||||
ml.logDebugMessage(msg);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LoggingID lid(11);
|
||||
MessageLog ml(lid);
|
||||
Message msg;
|
||||
Message::Args args;
|
||||
args.add("sendAlarmReport error:");
|
||||
args.add(e.what());
|
||||
msg.format(args);
|
||||
ml.logDebugMessage(msg);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LoggingID lid(11);
|
||||
MessageLog ml(lid);
|
||||
Message msg;
|
||||
Message::Args args;
|
||||
args.add("sendAlarmReport error:");
|
||||
args.add("general failure");
|
||||
msg.format(args);
|
||||
ml.logDebugMessage(msg);
|
||||
}
|
||||
{}
|
||||
|
||||
return;
|
||||
#endif //SKIP_ALARM
|
||||
@ -652,15 +621,17 @@ void ALARMManager::getActiveAlarm(AlarmList& alarmList) const
|
||||
*****************************************************************************************/
|
||||
void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
{
|
||||
string alarmFile = "/tmp/alarms";
|
||||
|
||||
string alarmFile = startup::StartUp::tmpDir() + "/alarms";
|
||||
|
||||
//make 1 alarm log file made up of archive and current alarm.log
|
||||
(void)system("touch /tmp/alarms");
|
||||
|
||||
string cmd = ("ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > /tmp/alarmlogfiles");
|
||||
string cmd = "touch " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
string fileName = "/tmp/alarmlogfiles";
|
||||
cmd = "ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
string fileName = startup::StartUp::tmpDir() + "/alarmlogfiles";
|
||||
|
||||
ifstream oldFile (fileName.c_str());
|
||||
|
||||
@ -672,7 +643,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
while (oldFile.getline(line, 200))
|
||||
{
|
||||
buf = line;
|
||||
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> /tmp/alarms";
|
||||
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
}
|
||||
|
||||
@ -680,7 +651,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
unlink (fileName.c_str());
|
||||
}
|
||||
|
||||
cmd = "cat " + ALARM_FILE + " >> /tmp/alarms";
|
||||
cmd = "cat " + ALARM_FILE + " >> " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
int fd = open(alarmFile.c_str(), O_RDONLY);
|
||||
|
@ -1,228 +0,0 @@
|
||||
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
|
||||
<Project
|
||||
Version="10.0"
|
||||
VendorName="SlickEdit"
|
||||
TemplateName="GNU C/C++"
|
||||
WorkingDir=".">
|
||||
<Config
|
||||
Name="Debug"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpont-console"
|
||||
CompilerConfigName="Latest Version"
|
||||
ObjectDir="/home/dhall/genii/oamapps/calpont-console/">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
RunInXterm="1"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw"
|
||||
ClearProcessBuffer="1"
|
||||
RunInXterm="1">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Config
|
||||
Name="Release"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpont-console"
|
||||
CompilerConfigName="Latest Version">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
RunInXterm="1"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw"
|
||||
ClearProcessBuffer="1"
|
||||
RunInXterm="1">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Files>
|
||||
<Folder
|
||||
Name="Source Files"
|
||||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
|
||||
<F N="calpontConsole.cpp"/>
|
||||
<F N="tdriver.cpp"/>
|
||||
</Folder>
|
||||
<Folder
|
||||
Name="Header Files"
|
||||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
|
||||
<F N="calpontConsole.h"/>
|
||||
</Folder>
|
||||
<Folder
|
||||
Name="Resource Files"
|
||||
Filters="*.ico;*.cur;*.dlg"/>
|
||||
<Folder
|
||||
Name="Bitmaps"
|
||||
Filters="*.bmp"/>
|
||||
<Folder
|
||||
Name="Other Files"
|
||||
Filters="">
|
||||
<F
|
||||
N="Makefile"
|
||||
Type="Makefile"/>
|
||||
</Folder>
|
||||
</Files>
|
||||
</Project>
|
@ -1,224 +0,0 @@
|
||||
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
|
||||
<Project
|
||||
Version="10.0"
|
||||
VendorName="SlickEdit"
|
||||
TemplateName="GNU C/C++"
|
||||
WorkingDir=".">
|
||||
<Config
|
||||
Name="Debug"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpontConsole"
|
||||
CompilerConfigName="Latest Version"
|
||||
ObjectDir="/home/dhall/genii/oamapps/calpont-console/">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make install"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Config
|
||||
Name="Release"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpontConsole"
|
||||
CompilerConfigName="Latest Version">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make install"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine="make -fMakefile clean; make -fMakefile"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="/home/dhall/genii/oamapps/calpont-console/"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw"
|
||||
ClearProcessBuffer="1">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Files>
|
||||
<Folder
|
||||
Name="Source Files"
|
||||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
|
||||
<F N="../calpontConsole/calpontConsole.cpp"/>
|
||||
<F N="tdriver.cpp"/>
|
||||
</Folder>
|
||||
<Folder
|
||||
Name="Header Files"
|
||||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
|
||||
<F N="calpontConsole.h"/>
|
||||
</Folder>
|
||||
<Folder
|
||||
Name="Resource Files"
|
||||
Filters="*.ico;*.cur;*.dlg"/>
|
||||
<Folder
|
||||
Name="Bitmaps"
|
||||
Filters="*.bmp"/>
|
||||
<Folder
|
||||
Name="Other Files"
|
||||
Filters="">
|
||||
<F
|
||||
N="../calpontConsole/Makefile"
|
||||
Type="Makefile"/>
|
||||
</Folder>
|
||||
</Files>
|
||||
</Project>
|
@ -1,48 +0,0 @@
|
||||
|
||||
#
|
||||
# Not used
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
## Copyright (C) 2014 InfiniDB, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU General Public License
|
||||
## as published by the Free Software Foundation; version 2 of
|
||||
## the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
## MA 02110-1301, USA.
|
||||
#
|
||||
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
|
||||
### Process this file with automake to produce Makefile.in
|
||||
#
|
||||
#AM_CPPFLAGS = $(idb_cppflags)
|
||||
#AM_CFLAGS = $(idb_cflags)
|
||||
#AM_CXXFLAGS = $(idb_cxxflags)
|
||||
#AM_LDFLAGS = $(idb_ldflags)
|
||||
#bin_PROGRAMS = calpontConsole
|
||||
#calpontConsole_SOURCES = calpontConsole.cpp
|
||||
#calpontConsole_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
|
||||
#calpontConsole_LDFLAGS = $(idb_common_ldflags) $(idb_common_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
|
||||
#
|
||||
#test:
|
||||
#
|
||||
#coverage:
|
||||
#
|
||||
#leakcheck:
|
||||
#
|
||||
#docs:
|
||||
#
|
||||
#bootstrap: install-data-am
|
||||
#
|
File diff suppressed because it is too large
Load Diff
@ -1,135 +0,0 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/******************************************************************************************
|
||||
* $Id: calpontConsole.h 3071 2013-04-04 18:45:53Z rdempsey $
|
||||
*
|
||||
******************************************************************************************/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
#ifndef CALPONTCONSOLE_H
|
||||
#define CALPONTCONSOLE_H
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <limits.h>
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "liboamcpp.h"
|
||||
#include "configcpp.h"
|
||||
#include "alarmmanager.h"
|
||||
#include "alarmglobal.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "brmtypes.h"
|
||||
|
||||
|
||||
const int CmdSize = 80;
|
||||
const int ArgNum = 10;
|
||||
const int DescNumMax = 10;
|
||||
const int cmdNum = 68;
|
||||
|
||||
const std::string DEFAULT_LOG_FILE = "/var/log/mariadb/columnstore/uiCommands.log";
|
||||
std::ofstream logFile;
|
||||
|
||||
/**
|
||||
* write the command to the log file
|
||||
*/
|
||||
void writeLog(std::string command);
|
||||
|
||||
/** @brief location of the Process Configuration file
|
||||
*/
|
||||
const std::string ConsoleCmdsFile = "ConsoleCmds.xml";
|
||||
|
||||
void getFlags(const std::string* arguments, oam::GRACEFUL_FLAG& gracefulTemp, oam::ACK_FLAG& ackTemp, oam::CC_SUSPEND_ANSWER& suspendAnswer, bool& bNeedsConfirm, std::string* password = NULL);
|
||||
int confirmPrompt(std::string warningCommand);
|
||||
std::string dataPrompt(std::string promptCommand);
|
||||
int processCommand(std::string*);
|
||||
int ProcessSupportCommand(int CommandID, std::string arguments[]);
|
||||
void printAlarmSummary();
|
||||
void printCriticalAlarms();
|
||||
void checkRepeat(std::string*, int);
|
||||
void printSystemStatus();
|
||||
void printProcessStatus(std::string port = "ProcStatusControl");
|
||||
void printModuleCpuUsers(oam::TopProcessCpuUsers topprocesscpuusers);
|
||||
void printModuleCpu(oam::ModuleCpu modulecpu);
|
||||
void printModuleMemoryUsers(oam::TopProcessMemoryUsers topprocessmemoryusers);
|
||||
void printModuleMemory(oam::ModuleMemory modulememory);
|
||||
void printModuleDisk(oam::ModuleDisk moduledisk);
|
||||
void printModuleResources(oam::TopProcessCpuUsers topprocesscpuusers, oam::ModuleCpu modulecpu, oam::TopProcessMemoryUsers topprocessmemoryusers, oam::ModuleMemory modulememory, oam::ModuleDisk moduledisk);
|
||||
void printState(int state, std::string addInfo);
|
||||
std::string getParentOAMModule();
|
||||
bool checkForDisabledModules();
|
||||
oam::CC_SUSPEND_ANSWER AskSuspendQuestion(int CmdID);
|
||||
|
||||
|
||||
|
||||
class to_lower
|
||||
{
|
||||
public:
|
||||
char operator() (char c) const // notice the return type
|
||||
{
|
||||
return tolower(c);
|
||||
}
|
||||
};
|
||||
|
||||
/** @brief Hidden Support commands in lower-case
|
||||
*/
|
||||
const std::string supportCmds[] = { "helpsupport",
|
||||
"stopprocess",
|
||||
"startprocess",
|
||||
"restartprocess",
|
||||
"killpid",
|
||||
"rebootsystem",
|
||||
"rebootnode",
|
||||
"stopdbrmprocess",
|
||||
"startdbrmprocess",
|
||||
"restartdbrmprocess",
|
||||
"setsystemstartupstate",
|
||||
"stopprimprocs",
|
||||
"startprimprocs",
|
||||
"restartprimprocs",
|
||||
"stopexemgrs",
|
||||
"startexemgrs",
|
||||
"restartexemgrs",
|
||||
"getprocessstatusstandby",
|
||||
"distributeconfigfile",
|
||||
"getpmdbrootconfig",
|
||||
"getdbrootpmconfig",
|
||||
"getsystemdbrootconfig",
|
||||
"checkdbfunctional",
|
||||
"getsystemreadflags",
|
||||
"setsystemqueryready",
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,380 +0,0 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/***************************************************************************
|
||||
* $Id: tdriver.cpp 3072 2013-04-04 19:04:45Z rdempsey $
|
||||
*
|
||||
* dhill@srvengcm1.calpont.com
|
||||
*
|
||||
* Purpose: Calpont Console tester
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
using namespace boost;
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
class GeneralCmdsTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( GeneralCmdsTest );
|
||||
|
||||
CPPUNIT_TEST( test1 );
|
||||
CPPUNIT_TEST( test2 );
|
||||
CPPUNIT_TEST( test3 );
|
||||
CPPUNIT_TEST( test4 );
|
||||
CPPUNIT_TEST( test5 );
|
||||
CPPUNIT_TEST( test6 );
|
||||
CPPUNIT_TEST( test7 );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole help > tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole ? >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole help verbose >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole help getAlarmConfig >> tdriver.output");
|
||||
}
|
||||
|
||||
void test5()
|
||||
{
|
||||
system("./calpontConsole exit >> tdriver.output");
|
||||
}
|
||||
|
||||
void test6()
|
||||
{
|
||||
system("./calpontConsole quit >> tdriver.output");
|
||||
}
|
||||
|
||||
void test7()
|
||||
{
|
||||
system("./calpontConsole system ls -ltr >> tdriver.output");
|
||||
}
|
||||
};
|
||||
|
||||
class AlarmConfigTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( AlarmConfigTest );
|
||||
|
||||
CPPUNIT_TEST( test1 );
|
||||
CPPUNIT_TEST( test2 );
|
||||
CPPUNIT_TEST( test3 );
|
||||
CPPUNIT_TEST( test4 );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole getAlarmConfig >> tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole getAlarmConfig 1 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole setAlarmConfig 1 Threshold 50 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole getAlarmConfig 1 >> tdriver.output");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class ProcessConfigTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( ProcessConfigTest );
|
||||
|
||||
CPPUNIT_TEST( test1 );
|
||||
CPPUNIT_TEST( test2 );
|
||||
CPPUNIT_TEST( test3 );
|
||||
CPPUNIT_TEST( test4 );
|
||||
CPPUNIT_TEST( test5 );
|
||||
CPPUNIT_TEST( test6 );
|
||||
CPPUNIT_TEST( test7 );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole getProcessConfig >> tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole getProcessConfig ProcessManager dm1 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole setProcessConfig ProcessManager dm1 LaunchID 1 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test5()
|
||||
{
|
||||
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
|
||||
}
|
||||
|
||||
void test6()
|
||||
{
|
||||
system("./calpontConsole setProcessConfig ProcessManager dm1 LaunchID 3 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test7()
|
||||
{
|
||||
system("./calpontConsole getProcessConfig ProcessManager dm1 LaunchID >> tdriver.output");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class ServerConfigTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( ServerConfigTest );
|
||||
|
||||
CPPUNIT_TEST( test1 );
|
||||
CPPUNIT_TEST( test2 );
|
||||
CPPUNIT_TEST( test3 );
|
||||
CPPUNIT_TEST( test4 );
|
||||
CPPUNIT_TEST( test5 );
|
||||
CPPUNIT_TEST( test6 );
|
||||
CPPUNIT_TEST( test7 );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole getModuleConfig >> tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole getModuleConfig dm1 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole setModuleConfig dm1 ServerCPUCriticalThreshold 9999 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test5()
|
||||
{
|
||||
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
|
||||
}
|
||||
|
||||
void test6()
|
||||
{
|
||||
system("./calpontConsole setModuleConfig dm1 ServerCPUCriticalThreshold 9000 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test7()
|
||||
{
|
||||
system("./calpontConsole getModuleConfig dm1 ServerCPUCriticalThreshold >> tdriver.output");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class SystemConfigTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( SystemConfigTest );
|
||||
|
||||
CPPUNIT_TEST( test1 );
|
||||
CPPUNIT_TEST( test2 );
|
||||
CPPUNIT_TEST( test3 );
|
||||
CPPUNIT_TEST( test4 );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole getSystemConfig >> tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole getSystemConfig SystemVersion >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole setSystemConfig SystemVersion 2.0.0.0 >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole getSystemConfig SystemVersion >> tdriver.output");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class SystemActionTest : public CppUnit::TestFixture
|
||||
{
|
||||
|
||||
CPPUNIT_TEST_SUITE( SystemActionTest );
|
||||
|
||||
CPPUNIT_TEST( test1 ); // valid, but will fail command
|
||||
CPPUNIT_TEST( test2 ); // valid, but will fail command
|
||||
CPPUNIT_TEST( test3 ); // valid, but will fail command
|
||||
CPPUNIT_TEST( test4 ); // valid, but will fail command
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
void test1()
|
||||
{
|
||||
system("./calpontConsole stopSystem >> tdriver.output");
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
system("./calpontConsole shutdownSystem >> tdriver.output");
|
||||
}
|
||||
|
||||
void test3()
|
||||
{
|
||||
system("./calpontConsole startSystem >> tdriver.output");
|
||||
}
|
||||
|
||||
void test4()
|
||||
{
|
||||
system("./calpontConsole restartSystem >> tdriver.output");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//CPPUNIT_TEST_SUITE_REGISTRATION( SystemActionTest );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( SystemConfigTest );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( ServerConfigTest );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( ProcessConfigTest );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( AlarmConfigTest );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( GeneralCmdsTest );
|
||||
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
|
||||
int main( int argc, char** argv)
|
||||
{
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
|
||||
runner.addTest( registry.makeTest() );
|
||||
bool wasSuccessful = runner.run( "", false );
|
||||
return (wasSuccessful ? 0 : 1);
|
||||
}
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
|
||||
#
|
||||
# Not used
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
## Copyright (C) 2014 InfiniDB, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU General Public License
|
||||
## as published by the Free Software Foundation; version 2 of
|
||||
## the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
## MA 02110-1301, USA.
|
||||
#
|
||||
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
|
||||
### Process this file with automake to produce Makefile.in
|
||||
#
|
||||
#AM_CPPFLAGS = $(idb_cppflags)
|
||||
#AM_CFLAGS = $(idb_cflags)
|
||||
#AM_CXXFLAGS = $(idb_cxxflags)
|
||||
#AM_LDFLAGS = $(idb_ldflags)
|
||||
#bin_PROGRAMS = calpontDBWrite
|
||||
#calpontDBWrite_SOURCES = calpontDB.cpp
|
||||
#calpontDBWrite_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
|
||||
#calpontDBWrite_LDFLAGS = $(idb_common_ldflags) $(idb_common_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
|
||||
#
|
||||
#test:
|
||||
#
|
||||
#coverage:
|
||||
#
|
||||
#leakcheck:
|
||||
#
|
||||
#docs:
|
||||
#
|
||||
#bootstrap: install-data-am
|
||||
#
|
@ -1,162 +0,0 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/******************************************************************************************
|
||||
* $Id: calpontDB.cpp 419 2007-07-22 17:18:00Z dhill $
|
||||
*
|
||||
******************************************************************************************/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <limits.h>
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "liboamcpp.h"
|
||||
#include "configcpp.h"
|
||||
#include "installdir.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace oam;
|
||||
using namespace config;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
void usage(char* prog)
|
||||
{
|
||||
|
||||
cout << endl;
|
||||
cout << "Usage: " << prog << " [options]" << endl;
|
||||
|
||||
cout << endl;
|
||||
cout << "This utility is used to suspend and resume Calpont Database Writes." << endl;
|
||||
cout << "Normally this would be done while performing Database Backups and" << endl;
|
||||
cout << "Restores " << endl;
|
||||
cout << endl;
|
||||
|
||||
cout << "Options:" << endl;
|
||||
cout << "-c <command> Command: suspend or resume" << endl << endl;
|
||||
cout << "-h Display this help." << endl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
string command;
|
||||
Oam oam;
|
||||
BRM::DBRM dbrm;
|
||||
|
||||
char c;
|
||||
|
||||
// Invokes member function `int operator ()(void);'
|
||||
while ((c = getopt(argc, argv, "c:h")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'c':
|
||||
command = optarg;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
usage(argv[0]);
|
||||
exit(-1);
|
||||
break;
|
||||
|
||||
default:
|
||||
usage(argv[0]);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( command == "suspend" )
|
||||
{
|
||||
try
|
||||
{
|
||||
std::vector<BRM::TableLockInfo> tableLocks = dbrm.getAllTableLocks();
|
||||
|
||||
if (!tableLocks.empty())
|
||||
{
|
||||
oam.DisplayLockedTables(tableLocks, &dbrm);
|
||||
}
|
||||
else
|
||||
{
|
||||
dbrm.setSystemSuspended(true);
|
||||
sleep(5);
|
||||
string cmd = startup::StartUp::installDir() + "/bin/save_brm > /var/log/mariadb/columnstore/save_brm.log1 2>&1";
|
||||
int rtnCode = system(cmd.c_str());
|
||||
|
||||
if (rtnCode == 0)
|
||||
{
|
||||
cout << endl << "Suspend Calpont Database Writes Request successfully completed" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << endl << "Suspend Calpont Database Writes Failed: save_brm Failed" << endl;
|
||||
dbrm.setSystemSuspended(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << endl << "**** Suspend Calpont Database Writes Failed: " << e.what() << endl;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << endl << "**** Suspend Calpont Database Writes Failed" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( command == "resume" )
|
||||
{
|
||||
try
|
||||
{
|
||||
dbrm.setSystemSuspended(false);
|
||||
cout << endl << "Resume Calpont Database Writes Request successfully completed" << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << endl << "**** Resume Calpont Database Writes Failed: " << e.what() << endl;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << endl << "**** Resume Calpont Database Writes Failed" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Invalid Command Entered, please try again" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
@ -1,216 +0,0 @@
|
||||
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
|
||||
<Project
|
||||
Version="10.0"
|
||||
VendorName="SlickEdit"
|
||||
TemplateName="GNU C/C++"
|
||||
WorkingDir=".">
|
||||
<Config
|
||||
Name="Debug"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpontDBWrite"
|
||||
CompilerConfigName="Latest Version">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine="make"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine=""/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
BuildFirst="1"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
BuildFirst="1"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Config
|
||||
Name="Release"
|
||||
Type="gnuc"
|
||||
DebugCallbackName="gdb"
|
||||
Version="1"
|
||||
OutputFile="%bdcalpontDBWrite"
|
||||
CompilerConfigName="Latest Version">
|
||||
<Menu>
|
||||
<Target
|
||||
Name="Compile"
|
||||
MenuCaption="&Compile"
|
||||
Dialog="_gnuc_options_form Compile"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
OutputExts="*.o"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Link"
|
||||
MenuCaption="&Link"
|
||||
ShowOnMenu="Never"
|
||||
Dialog="_gnuc_options_form Link"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveCurrent"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Build"
|
||||
MenuCaption="&Build"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine="make"/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Rebuild"
|
||||
MenuCaption="&Rebuild"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine=""/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Debug"
|
||||
MenuCaption="&Debug"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
BuildFirst="1"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='vsdebugio -prog "%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="Execute"
|
||||
MenuCaption="E&xecute"
|
||||
Dialog="_gnuc_options_form Run/Debug"
|
||||
BuildFirst="1"
|
||||
CaptureOutputWith="ProcessBuffer"
|
||||
Deletable="0"
|
||||
SaveOption="SaveWorkspaceFiles"
|
||||
RunFromDir="%rw">
|
||||
<Exec CmdLine='"%o"'/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="dash"
|
||||
MenuCaption="-"
|
||||
Deletable="0">
|
||||
<Exec/>
|
||||
</Target>
|
||||
<Target
|
||||
Name="GNU C Options"
|
||||
MenuCaption="GNU C &Options..."
|
||||
ShowOnMenu="HideIfNoCmdLine"
|
||||
Deletable="0"
|
||||
SaveOption="SaveNone">
|
||||
<Exec
|
||||
CmdLine="gnucoptions"
|
||||
Type="Slick-C"/>
|
||||
</Target>
|
||||
</Menu>
|
||||
<List Name="GNUC Options">
|
||||
<Item
|
||||
Name="LinkerOutputType"
|
||||
Value="Executable"/>
|
||||
</List>
|
||||
</Config>
|
||||
<Files>
|
||||
<Folder
|
||||
Name="Source Files"
|
||||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
|
||||
<F N="calpontDB.cpp"/>
|
||||
</Folder>
|
||||
<Folder
|
||||
Name="Header Files"
|
||||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if"/>
|
||||
<Folder
|
||||
Name="Resource Files"
|
||||
Filters="*.ico;*.cur;*.dlg"/>
|
||||
<Folder
|
||||
Name="Bitmaps"
|
||||
Filters="*.bmp"/>
|
||||
<Folder
|
||||
Name="Other Files"
|
||||
Filters="">
|
||||
<F
|
||||
N="Makefile"
|
||||
Type="Makefile"/>
|
||||
</Folder>
|
||||
</Files>
|
||||
</Project>
|
@ -1,57 +0,0 @@
|
||||
|
||||
#
|
||||
# Not used
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
## Copyright (C) 2014 InfiniDB, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU General Public License
|
||||
## as published by the Free Software Foundation; version 2 of
|
||||
## the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
## MA 02110-1301, USA.
|
||||
#
|
||||
## $Id: Makefile.am 333 2009-04-03 20:35:04Z rdempsey $
|
||||
### Process this file with automake to produce Makefile.in
|
||||
#
|
||||
#AM_CPPFLAGS = $(idb_cppflags)
|
||||
#AM_CFLAGS = $(idb_cflags)
|
||||
#AM_CXXFLAGS = $(idb_cxxflags)
|
||||
#AM_LDFLAGS = $(idb_ldflags)
|
||||
#bin_PROGRAMS = calpontSupport
|
||||
#calpontSupport_SOURCES = calpontSupport.cpp
|
||||
#calpontSupport_CPPFLAGS = $(idb_common_includes) $(AM_CPPFLAGS)
|
||||
#calpontSupport_LDFLAGS = $(idb_common_ldflags) $(idb_brm_libs) $(idb_oam_libs) $(idb_exec_libs) -lreadline -lncurses $(AM_LDFLAGS)
|
||||
#dist_bin_SCRIPTS=\
|
||||
# alarmReport.sh \
|
||||
# bulklogReport.sh \
|
||||
# configReport.sh \
|
||||
# hadoopReport.sh \
|
||||
# hardwareReport.sh \
|
||||
# logReport.sh \
|
||||
# resourceReport.sh \
|
||||
# softwareReport.sh
|
||||
#
|
||||
#test:
|
||||
#
|
||||
#coverage:
|
||||
#
|
||||
#leakcheck:
|
||||
#
|
||||
#docs:
|
||||
#
|
||||
#bootstrap: install-data-am
|
||||
#
|
@ -1,36 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# $Id: logReport.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
if [ $1 ] ; then
|
||||
SERVER=$1
|
||||
else
|
||||
SERVER="localhost"
|
||||
fi
|
||||
|
||||
if [ $2 ] ; then
|
||||
DATE=$2
|
||||
else
|
||||
DATE=" "
|
||||
fi
|
||||
|
||||
rm -f /tmp/logReport.log
|
||||
|
||||
{
|
||||
echo " "
|
||||
echo "******************** Alarm Report for $SERVER ********************"
|
||||
echo " "
|
||||
|
||||
echo "-- Today's Alarms --"
|
||||
echo " "
|
||||
cat /var/log/mariadb/columnstore/alarm.log 2>/dev/null
|
||||
|
||||
if test -f /var/log/mariadb/columnstore/archive/alarm.log-$DATE ; then
|
||||
echo "-- Archived Alarms --"
|
||||
echo " "
|
||||
cat /var/log/mariadb/columnstore/archive/alarm.log-$DATE 2>/dev/null
|
||||
fi
|
||||
|
||||
} > /tmp/logReport.log
|
||||
|
||||
exit 0
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
Table for output from track.sh.
|
||||
|
||||
Contains a row per process / snapshot.
|
||||
|
||||
*/
|
||||
|
||||
drop table if exists processLog;
|
||||
|
||||
create table processLog (
|
||||
snapshotid int,
|
||||
dtm datetime, /* repeated for a snapshot */
|
||||
processPid int,
|
||||
processUserName varchar(7),
|
||||
processPriority int,
|
||||
processNice int,
|
||||
moduleSwapUsedK int,
|
||||
moduleCachedUsedK int,
|
||||
processVirt int,
|
||||
processRes int,
|
||||
processShr int,
|
||||
processS char(8),
|
||||
processCPUPct decimal(4,1),
|
||||
processMemPct decimal(4,1),
|
||||
processTime varchar(20),
|
||||
processCommand varchar(20))engine=infinidb;
|
@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Usage:
|
||||
# track.sh
|
||||
|
||||
# top output
|
||||
#top - 12:45:49 up 21:58, 2 users, load average: 0.04, 0.10, 0.08
|
||||
#Tasks: 164 total, 1 running, 163 sleeping, 0 stopped, 0 zombie
|
||||
#Cpu(s): 2.9%us, 2.4%sy, 10.3%ni, 76.2%id, 8.0%wa, 0.0%hi, 0.2%si, 0.0%st
|
||||
#Mem: 16440336k total, 6129588k used, 10310748k free, 74336k buffers
|
||||
#Swap: 2031608k total, 14848k used, 2016760k free, 511012k cached
|
||||
#
|
||||
# PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
|
||||
# track.sh output
|
||||
# SEQ DATE PID USER PR NI SWAP CACHE VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
# SWAP and CACHE are systemwise swap space: Swap: ... used ... cached
|
||||
|
||||
i=0
|
||||
while [ true ]
|
||||
do
|
||||
let i++
|
||||
dt=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
top -b -n 1 |
|
||||
egrep "Swap:|PrimProc|ExeMgr|DMLProc|DDLProc|cpimport|WriteEngineServ|controllernode|workernode|mysqld|DecomSvr" |
|
||||
awk '{if(NR==1){s=$4; c=$8; next}}; {print s" "c" "$0}' |
|
||||
awk -v i=$i -v dt="$dt" '{
|
||||
sub(/k/,"",$1); sub(/k/,"",$2); sub(/m/,"000",$7); sub(/m/,"000",$8); sub(/m/,"000",$9);
|
||||
sub(/\.([0-9]+)g/, "&00000",$7); sub(/^[0-9]+g/, "&000000",$7); gsub(/[.|g]/, "",$7);
|
||||
sub(/\.([0-9]+)g/, "&00000",$8); sub(/^[0-9]+g/, "&000000",$8); gsub(/[.|g]/, "",$8)}
|
||||
{print i"|"dt"|"$3"|"$4"|"$5"|"$6"|"$1"|"$2"|"$7"|"$8"|"$9"|"$10"|"$11"|"$12"|"$13"|"$14"|"}'
|
||||
if [ -f stop.txt ]; then
|
||||
rm -f stop.txt
|
||||
exit
|
||||
fi
|
||||
sleep 1
|
||||
done
|
@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Estimates the row count for a given table. Uses number of extents * 8M for the estimate.
|
||||
#
|
||||
|
||||
#
|
||||
# Initialize variables.
|
||||
#
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
# Validate that there are two parameters - schema and table.
|
||||
#
|
||||
if [ $# -ne 2 ]; then
|
||||
echo ""
|
||||
echo "Reports the approximate row count for the given table."
|
||||
echo ""
|
||||
echo "Parameters:"
|
||||
echo " Schema"
|
||||
echo " Table"
|
||||
fi
|
||||
db=$1
|
||||
table=$2
|
||||
|
||||
#
|
||||
# Validate that the table exists.
|
||||
#
|
||||
sql="select count(*) from systable where \`schema\`='$db' and tablename='$table';"
|
||||
count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"`
|
||||
if [ $count -le 0 ]; then
|
||||
echo ""
|
||||
echo "$db.$table does not exist in InfiniDB."
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Grab the objectid and column width for a column in the table.
|
||||
#
|
||||
sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' limit 1;"
|
||||
objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
|
||||
sql="select columnlength from syscolumn where objectid=$objectid;"
|
||||
colWidth=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
|
||||
|
||||
#
|
||||
# Use editem to count the extents.
|
||||
#
|
||||
extentCount=`/usr/local/mariadb/columnstore/bin/editem -o $objectid | wc -l`
|
||||
let extentCount-=2 # Take out the 2 extra rows for header and blank line at end.
|
||||
let approximateRowCount=$extentCount*8192*1024;
|
||||
|
||||
echo ""
|
||||
echo "Approximate row count for $db.$table is $approximateRowCount."
|
||||
echo ""
|
||||
|
||||
exit 0
|
@ -1,38 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# $Id: logReport.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
if [ $1 ] ; then
|
||||
MODULE=$1
|
||||
else
|
||||
MODULE="pm1"
|
||||
fi
|
||||
|
||||
if [ $2 ] ; then
|
||||
INSTALLDIR=$2
|
||||
else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
if [ $USER = "root" ]; then
|
||||
SUDO=" "
|
||||
else
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
$SUDO rm -f /tmp/${MODULE}_bulklogReport.txt
|
||||
|
||||
{
|
||||
|
||||
if test -d $INSTALLDIR/data/bulk ; then
|
||||
echo " "
|
||||
echo "-- Check for Errors in Bulk Logs --"
|
||||
echo " "
|
||||
echo "################# egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err #################"
|
||||
echo " "
|
||||
egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err 2>/dev/null
|
||||
fi
|
||||
|
||||
} > /tmp/${MODULE}_bulklogReport.txt
|
||||
|
||||
exit 0
|
@ -1,227 +0,0 @@
|
||||
@echo off
|
||||
pushd .
|
||||
set help=
|
||||
if "%1" == "-h" (set help=true)
|
||||
if "%1" == "/h" (set help=true)
|
||||
if "%1" == "--help" (set help=true)
|
||||
if "%help%"=="true" (
|
||||
echo The InfiniDB Support Report creates a report that can be sent to InfiniDB
|
||||
echo for help with field support. There are no options to this command.
|
||||
set help=
|
||||
exit /B 0
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Running the InfiniDB Support Report, outputting to InfiniDBSupportReport.txt
|
||||
|
||||
call :func > InfiniDBSupportReport.txt 2>&1
|
||||
|
||||
echo.
|
||||
echo Report finished
|
||||
|
||||
popd
|
||||
exit /B 0
|
||||
|
||||
:ErrorExit
|
||||
|
||||
echo.
|
||||
echo Error - Failed to find InfiniDB Install Directory in Windows Registry, Exiting
|
||||
popd
|
||||
exit /B 1
|
||||
|
||||
:func
|
||||
|
||||
setlocal
|
||||
set key="HKLM\SOFTWARE\Calpont\InfiniDB"
|
||||
set homeValue=InfiniDBHome
|
||||
set configValue=ConfigFile
|
||||
|
||||
for /f "tokens=3,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
|
||||
set InfiniDBInstall=%%b
|
||||
)
|
||||
|
||||
if "%InfiniDBInstall%" == "" (
|
||||
for /f "tokens=2,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
|
||||
set InfiniDBInstall=%%b
|
||||
)
|
||||
)
|
||||
|
||||
::error out if can't locate Install Directory
|
||||
if "%InfiniDBInstall%" == "" GOTO ErrorExit
|
||||
|
||||
echo #######################################################################
|
||||
echo # #
|
||||
echo # InfiniDB Support Report - %date% %time%
|
||||
echo # #
|
||||
echo #######################################################################
|
||||
echo.
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = Software/Version Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB Software Version --
|
||||
type %InfiniDBInstall%\etc\CalpontVersion.txt
|
||||
echo.
|
||||
echo -- mysql Software Version --
|
||||
mysql --user=root -e status
|
||||
echo.
|
||||
echo -- Windows Version --
|
||||
ver
|
||||
echo.
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = Status Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB Process Status --
|
||||
echo.
|
||||
|
||||
tasklist /FI "Imagename eq mysqld.exe"
|
||||
tasklist /FI "Imagename eq controllernode.exe"
|
||||
tasklist /FI "Imagename eq workernode.exe"
|
||||
tasklist /FI "Imagename eq PrimProc.exe"
|
||||
tasklist /FI "Imagename eq ExeMgr.exe"
|
||||
tasklist /FI "Imagename eq DDLProc.exe"
|
||||
tasklist /FI "Imagename eq DMLProc.exe"
|
||||
tasklist /FI "Imagename eq WriteEngineServer.exe"
|
||||
|
||||
echo.
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = Configuration Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo -- Windows InfiniDB Registry Values --
|
||||
echo.
|
||||
|
||||
echo InfiniDBInstall = %InfiniDBInstall%
|
||||
|
||||
for /f "tokens=2,*" %%a in ('reg query %key% /v %homeValue% 2^>NUL ^| findstr %homeValue%') do (
|
||||
set InfiniDBHome=%%b
|
||||
)
|
||||
echo InfiniDBHome = %InfiniDBHome%
|
||||
|
||||
for /f "tokens=2,*" %%a in ('reg query %key% /v %configValue% 2^>NUL ^| findstr %configValue%') do (
|
||||
set ConfigFile=%%b
|
||||
)
|
||||
echo ConfigFile = %ConfigFile%
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB System Configuration Information --
|
||||
echo.
|
||||
cd %InfiniDBInstall%\bin
|
||||
for /f "delims=" %%a in ('getConfig.exe DBBC NumBlocksPct') do @echo NumBlocksPct = %%a
|
||||
for /f "delims=" %%a in ('getConfig.exe HashJoin TotalUmMemory') do @echo TotalUmMemory = %%a
|
||||
for /f "delims=" %%a in ('getConfig.exe VersionBuffer VersionBufferFileSize') do @echo VersionBufferFileSize = %%a
|
||||
for /f "delims=" %%a in ('getConfig.exe ExtentMap FilesPerColumnPartition') do @echo FilesPerColumnPartition = %%a
|
||||
for /f "delims=" %%a in ('getConfig.exe ExtentMap ExtentsPerSegmentFile') do @echo ExtentsPerSegmentFile = %%a
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB System Configuration File --
|
||||
echo.
|
||||
type "%ConfigFile%"
|
||||
echo.
|
||||
echo.
|
||||
echo -- System Process Status --
|
||||
echo.
|
||||
tasklist /v
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = Resource Usage Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo -- System Information--
|
||||
echo.
|
||||
systeminfo
|
||||
echo.
|
||||
echo -- IP Configuration Information --
|
||||
echo.
|
||||
ipconfig
|
||||
echo.
|
||||
echo -- Disk BRM Data files --
|
||||
echo.
|
||||
dir "%InfiniDBInstall%\dbrm\"
|
||||
echo.
|
||||
echo -- View Table Locks --
|
||||
echo.
|
||||
cd %InfiniDBInstall%\bin\
|
||||
viewtablelock.exe
|
||||
echo.
|
||||
echo.
|
||||
echo -- BRM Extent Map --
|
||||
echo.
|
||||
cd %InfiniDBInstall%\bin\
|
||||
editem.exe -i
|
||||
echo.
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = Log Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo -- InfiniDB Platform Logs --
|
||||
echo.
|
||||
type "%InfiniDBInstall%\log\InfiniDBLog.txt"
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB MySQl log --
|
||||
echo.
|
||||
type "%InfiniDBInstall%\mysqldb\*.err"
|
||||
echo.
|
||||
echo.
|
||||
echo -- InfiniDB Bulk Load Logs --
|
||||
echo.
|
||||
dir "%InfiniDBInstall%\bulk\data"
|
||||
echo.
|
||||
dir "%InfiniDBInstall%\bulk\log"
|
||||
echo.
|
||||
dir "%InfiniDBInstall%\bulk\job"
|
||||
echo.
|
||||
echo -- Check for Errors in Bulk Logs --
|
||||
echo.
|
||||
cd "%InfiniDBInstall%\bulk\log"
|
||||
findstr /spin /c:"error" *
|
||||
findstr /spin /c:"failed" *
|
||||
cd "%InfiniDBInstall%\bulk\job"
|
||||
findstr /spin /c:"error" *
|
||||
findstr /spin /c:"failed" *
|
||||
echo.
|
||||
echo =======================================================================
|
||||
echo = DBMS Report =
|
||||
echo =======================================================================
|
||||
echo.
|
||||
echo -- DBMS InfiniDB Mysql Version --
|
||||
echo.
|
||||
mysql --user=root -e status
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB System Column --
|
||||
echo.
|
||||
mysql --user=root -e "desc calpontsys.syscolumn"
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB System Table --
|
||||
echo.
|
||||
mysql --user=root -e "desc calpontsys.systable"
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB System Table Data --
|
||||
echo.
|
||||
mysql --user=root -e "select * from calpontsys.systable"
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB Databases --
|
||||
echo.
|
||||
mysql --user=root -e "show databases"
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB variables --
|
||||
echo.
|
||||
mysql --user=root -e "show variables"
|
||||
echo.
|
||||
echo -- DBMS Mysql InfiniDB config file --
|
||||
echo.
|
||||
type "%InfiniDBInstall%\my.ini"
|
||||
echo.
|
||||
echo -- Active Queries --
|
||||
|
||||
::cd \InfiniDB\genii\oamapps\calpontSupport
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,64 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
|
||||
#
|
||||
if [ $1 ] ; then
|
||||
MODULE=$1
|
||||
else
|
||||
MODULE="pm1"
|
||||
fi
|
||||
|
||||
if [ $2 ] ; then
|
||||
INSTALLDIR=$2
|
||||
else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
if [ $USER = "root" ]; then
|
||||
SUDO=" "
|
||||
else
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
$SUDO rm -f /tmp/${MODULE}_configReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
echo "******************** Configuration/Status Report for ${MODULE} ********************"
|
||||
echo " "
|
||||
|
||||
if test -f /sbin/chkconfig ; then
|
||||
echo "-- chkconfig configuration --"
|
||||
echo " "
|
||||
echo "################# /sbin/chkconfig --list | grep infinidb #################"
|
||||
echo " "
|
||||
$SUDO /sbin/chkconfig --list | grep infinidb 2>/dev/null
|
||||
echo "################# /sbin/chkconfig --list | grep mysql-Columnstore #################"
|
||||
echo " "
|
||||
$SUDO /sbin/chkconfig --list | grep mysql-Columnstore 2>/dev/null
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "-- fstab Configuration --"
|
||||
echo " "
|
||||
echo "################# cat /etc/fstab #################"
|
||||
echo " "
|
||||
$SUDO cat /etc/fstab 2>/dev/null
|
||||
|
||||
echo " "
|
||||
echo "-- Server Processes --"
|
||||
echo " "
|
||||
echo "################# ps axu #################"
|
||||
echo " "
|
||||
$SUDO ps axu
|
||||
|
||||
echo " "
|
||||
echo "-- Server Processes with resource usage --"
|
||||
echo " "
|
||||
echo "################# top -b -n 1 #################"
|
||||
echo " "
|
||||
$SUDO top -b -n 1
|
||||
|
||||
} > /tmp/${MODULE}_configReport.txt
|
||||
|
||||
exit 0
|
@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# This script lists InfiniDBlpont data files that do not have associated extent map entries.
|
||||
#
|
||||
# NOTES:
|
||||
# 1) Only looks in $COLUMNSTORE_INSTALL_DIR/data* for the data files.
|
||||
# 2) Only checks for an existing extent with a matching OID, doesn't validate that there is an
|
||||
# existing extent for the exact segment.
|
||||
#
|
||||
# Close enough for hand grenades.
|
||||
|
||||
if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
|
||||
COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
|
||||
fi
|
||||
|
||||
export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
if [ $COLUMNSTORE_INSTALL_DIR != "/usr/local/mariadb/columnstore" ]; then
|
||||
export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/bin:/usr/bin
|
||||
export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib
|
||||
fi
|
||||
|
||||
cd $COLUMNSTORE_INSTALL_DIR
|
||||
|
||||
last=-1
|
||||
existsInExtentMap=0
|
||||
count=0
|
||||
|
||||
for i in $COLUMNSTORE_INSTALL_DIR/data*/*/*/*/*/*/FILE*cdf; do
|
||||
let count++
|
||||
oid=`$COLUMNSTORE_INSTALL_DIR/bin/file2oid.pl $i`
|
||||
if [ $last -ne $oid ]; then
|
||||
last=$oid
|
||||
existsInExtentMap=`$COLUMNSTORE_INSTALL_DIR/bin/editem -o $oid | wc -l`
|
||||
fi
|
||||
if [ $existsInExtentMap -le 0 ]; then
|
||||
echo "Missing oid $oid path $i"
|
||||
fi
|
||||
done
|
@ -1,132 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Reports the max value from the extent map for the given column.
|
||||
#
|
||||
|
||||
#
|
||||
# Initialize variables.
|
||||
#
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
# Validate that there are three parameters - schema and table and columnname.
|
||||
#
|
||||
if [ $# -ne 3 ]; then
|
||||
echo ""
|
||||
echo "Reports the max value for the given column."
|
||||
echo ""
|
||||
echo "Parameters:"
|
||||
echo " Schema"
|
||||
echo " Table"
|
||||
echo " Column"
|
||||
exit 1
|
||||
fi
|
||||
db=$1
|
||||
table=$2
|
||||
column=$3
|
||||
|
||||
#
|
||||
# Validate that the column exists.
|
||||
#
|
||||
sql="select count(*) from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
|
||||
count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"`
|
||||
if [ $count -le 0 ]; then
|
||||
echo ""
|
||||
echo "$db.$table.$column does not exist in InfiniDB."
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Validate that the column type is one that this script supports.
|
||||
# Supported Types:
|
||||
# 6 int
|
||||
# 8 date
|
||||
# 9 bigint
|
||||
# 11 datetime
|
||||
sql="select datatype from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
|
||||
dataType=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
|
||||
if [ $dataType -ne 6 ] && [ $dataType -ne 8 ] && [ $dataType -ne 9 ] && [ $dataType -ne 11 ]; then
|
||||
echo ""
|
||||
echo "The column data type must be an int, bigint, date, or datetime."
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Grab the objectid for the column.
|
||||
#
|
||||
sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';"
|
||||
objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"`
|
||||
|
||||
#
|
||||
# Set the editem specific parameter if the column is a date or datetime.
|
||||
#
|
||||
if [ $dataType -eq 8 ]; then
|
||||
parm="-t"
|
||||
elif [ $dataType -eq 11 ]; then
|
||||
parm="-s"
|
||||
fi
|
||||
|
||||
#
|
||||
# Use the editem utility to get the min and max value.
|
||||
#
|
||||
/usr/local/mariadb/columnstore/bin/editem -o $objectid $parm | grep max | awk -v dataType=$dataType '
|
||||
BEGIN {
|
||||
allValid=1;
|
||||
foundValidExtent=0;
|
||||
}
|
||||
{
|
||||
if(dataType == 11) {
|
||||
state=substr($14, 1, length($14)-1); # Datetime has date and time as two fields.
|
||||
thisMin=$6 " " substr($7, 1, length($7)-1);
|
||||
thisMax=$9 " " substr($10, 1, length($10)-1);
|
||||
}
|
||||
else {
|
||||
state=substr($12, 1, length($12)-1);
|
||||
thisMin=substr($6, 1, length($6)-1);
|
||||
thisMax=substr($8, 1, length($8)-1);
|
||||
}
|
||||
if(state == "valid") {
|
||||
if(!foundValidExtent) {
|
||||
min=thisMin;
|
||||
max=thisMax;
|
||||
foundValidExtent=1;
|
||||
}
|
||||
else {
|
||||
if(thisMin < min) {
|
||||
min=thisMin;
|
||||
}
|
||||
if(thisMax > max) {
|
||||
max=thisMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
allValid=0;
|
||||
}
|
||||
}
|
||||
END {
|
||||
if(foundValidExtent == 1) {
|
||||
print "";
|
||||
print "Min=" min;
|
||||
print "Max=" max;
|
||||
print "";
|
||||
if(allValid == 0) {
|
||||
print "Not all extents had min and max values set. Answer is incomplete."
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "";
|
||||
print "There were not any extents with valid min/max values. Unable to provide answer.";
|
||||
print "";
|
||||
}
|
||||
}'
|
||||
|
||||
exit 0
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user