diff --git a/README b/README index 8da8e257d..541e8872f 100644 --- a/README +++ b/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. diff --git a/VERSION b/VERSION index 28f7506a7..dee66414e 100644 --- a/VERSION +++ b/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 diff --git a/build/nightly-mini-tester.sh b/build/nightly-mini-tester.sh index a9ae28d29..3eae93c6f 100755 --- a/build/nightly-mini-tester.sh +++ b/build/nightly-mini-tester.sh @@ -1,7 +1,5 @@ #!/bin/bash -NO_NONROOT_SUDO=yes -export NO_NONROOT_SUDO prefix=/usr/local builddir= for arg in "$@"; do diff --git a/cpackEngineDEB.cmake b/cpackEngineDEB.cmake index 5f8a83c42..549e0d53a 100644 --- a/cpackEngineDEB.cmake +++ b/cpackEngineDEB.cmake @@ -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") diff --git a/cpackEngineRPM.cmake b/cpackEngineRPM.cmake index 1a3527086..c4fc765cc 100644 --- a/cpackEngineRPM.cmake +++ b/cpackEngineRPM.cmake @@ -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" diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index 15ccd73aa..7b75c15a9 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -66,6 +66,8 @@ using namespace logging; #include "rowgroup.h" using namespace rowgroup; +#include "installdir.h" + #include #include #include @@ -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 diff --git a/dbcon/execplan/sessionmanager.h b/dbcon/execplan/sessionmanager.h index 97f0aa01b..f1f9ad71e 100644 --- a/dbcon/execplan/sessionmanager.h +++ b/dbcon/execplan/sessionmanager.h @@ -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 */ diff --git a/dbcon/execplan/sessionmonitor.cpp b/dbcon/execplan/sessionmonitor.cpp index c3a89c4ce..0a27b5925 100644 --- a/dbcon/execplan/sessionmonitor.cpp +++ b/dbcon/execplan/sessionmonitor.cpp @@ -54,6 +54,9 @@ using namespace messageqcpp; using namespace BRM; +#include "installdir.h" + + namespace execplan { @@ -102,8 +105,12 @@ SessionMonitor::SessionMonitor() if (stmp != "") fSegmentFilename = strdup(stmp.c_str()); else - fSegmentFilename = strdup("/tmp/CalpontSessionMonitorShm"); - + { + string tmpdir = startup::StartUp::installDir() + "CalpontSessionMonitorShm"; + + fSegmentFilename = strdup(tmpdir); + } + try { madeSems = getSems(); diff --git a/dbcon/execplan/sessionmonitor.h b/dbcon/execplan/sessionmonitor.h index af7a9fb07..cf31b63b3 100644 --- a/dbcon/execplan/sessionmonitor.h +++ b/dbcon/execplan/sessionmonitor.h @@ -32,10 +32,6 @@ #include #include -#include -#include -#include - #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. */ /* diff --git a/dbcon/joblist/expressionstep.cpp b/dbcon/joblist/expressionstep.cpp index 4a8a14ff3..a2efad74a 100644 --- a/dbcon/joblist/expressionstep.cpp +++ b/dbcon/joblist/expressionstep.cpp @@ -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)); } diff --git a/dbcon/joblist/largedatalist.h b/dbcon/joblist/largedatalist.h index 924b0b200..7aedead4b 100644 --- a/dbcon/joblist/largedatalist.h +++ b/dbcon/joblist/largedatalist.h @@ -204,7 +204,6 @@ template LargeDataList::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::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 diff --git a/dbcon/joblist/resourcemanager.h b/dbcon/joblist/resourcemanager.h index 5d7a7e873..4a92a35b2 100644 --- a/dbcon/joblist/resourcemanager.h +++ b/dbcon/joblist/resourcemanager.h @@ -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 diff --git a/dbcon/mysql/ha_calpont.cpp b/dbcon/mysql/ha_calpont.cpp index 51ede22d5..03289ba60 100644 --- a/dbcon/mysql/ha_calpont.cpp +++ b/dbcon/mysql/ha_calpont.cpp @@ -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(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(ifp->arguments()[0]); + Item_field* right= static_cast(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 + /*@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,21 +1221,52 @@ 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 ) ) { - handler = new ha_calpont_group_by_handler(thd, query); + 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; + } - // Notify the server, that CS handles GROUP BY, ORDER BY and HAVING clauses. - query->group_by = NULL; - query->order_by = NULL; - query->having = NULL; + // Unsupported JOIN conditions check. + if ( !unsupported_feature ) + { + JOIN *join = select_lex->join; + Item_cond *icp = 0; + + if (join != 0) + icp = reinterpret_cast(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); + + // Notify the server, that CS handles GROUP BY, ORDER BY and HAVING clauses. + query->group_by = NULL; + query->order_by = NULL; + query->having = NULL; + } } + std::cerr << "create_calpont_group_by_handler handler " << handler << std::endl; + return handler; } diff --git a/dbcon/mysql/ha_calpont_ddl.cpp b/dbcon/mysql/ha_calpont_ddl.cpp index 0aebfaaee..487e0d4f8 100644 --- a/dbcon/mysql/ha_calpont_ddl.cpp +++ b/dbcon/mysql/ha_calpont_ddl.cpp @@ -1887,6 +1887,7 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl return rc; } +// Fails with `/` sign in table name pair 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(pathCopy)); + + pathLen = strlen(to); + decode_table_name(pathCopy, to, pathLen); + toPair = parseTableName(const_cast(pathCopy)); if (fromPair.first != toPair.first) { diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index b98653af7..a872ace4f 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -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 } diff --git a/dbcon/mysql/ha_calpont_impl.cpp b/dbcon/mysql/ha_calpont_impl.cpp index ad83f48db..3be44d2b8 100644 --- a/dbcon/mysql/ha_calpont_impl.cpp +++ b/dbcon/mysql/ha_calpont_impl.cpp @@ -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 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; @@ -5115,7 +5173,7 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE ci->warningMsg = msg; } - // If the previous query has error and + // If the previous query has error and // this is not a subquery run by the server(MCOL-1601) // re-establish the connection if (ci->queryState != 0) @@ -5215,7 +5273,7 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE return 0; string query; - // Set the query text only once if the server executes + // Set the query text only once if the server executes // subqueries separately. if(ci->queryState) query.assign(""); @@ -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(); diff --git a/dbcon/mysql/install_calpont_mysql.sh b/dbcon/mysql/install_calpont_mysql.sh index 589894c01..2a7c79883 100755 --- a/dbcon/mysql/install_calpont_mysql.sh +++ b/dbcon/mysql/install_calpont_mysql.sh @@ -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 < ${tmpdir}/mysql_install.log < -# - 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 diff --git a/dbcon/mysql/mysql-Columnstore b/dbcon/mysql/mysql-Columnstore index 02a0de162..370b277d0 100755 --- a/dbcon/mysql/mysql-Columnstore +++ b/dbcon/mysql/mysql-Columnstore @@ -43,12 +43,33 @@ # 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 - COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore + COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore fi export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR @@ -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 diff --git a/dbcon/mysql/sm.cpp b/dbcon/mysql/sm.cpp index 9cbfc73e6..5df01dda6 100644 --- a/dbcon/mysql/sm.cpp +++ b/dbcon/mysql/sm.cpp @@ -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); diff --git a/ddlproc/ddlproc.cpp b/ddlproc/ddlproc.cpp index bc70b01d5..6f827f8fd 100644 --- a/ddlproc/ddlproc.cpp +++ b/ddlproc/ddlproc.cpp @@ -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) diff --git a/dmlproc/dmlproc.cpp b/dmlproc/dmlproc.cpp index 8369a2003..deb936422 100644 --- a/dmlproc/dmlproc.cpp +++ b/dmlproc/dmlproc.cpp @@ -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,26 +606,11 @@ 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"; + string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1"; (void)::system(cmd.c_str()); } diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 528990ec8..a403360ac 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -105,6 +105,9 @@ using namespace querytele; #include "dbrm.h" #endif + +#include "installdir.h" + namespace { diff --git a/oam/cloud/IDBCloudGetIP.sh b/oam/cloud/IDBCloudGetIP.sh deleted file mode 100644 index bca6d41f0..000000000 --- a/oam/cloud/IDBCloudGetIP.sh +++ /dev/null @@ -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 diff --git a/oam/cloud/IDBInstanceCmds.sh b/oam/cloud/IDBInstanceCmds.sh deleted file mode 100644 index 1d7351594..000000000 --- a/oam/cloud/IDBInstanceCmds.sh +++ /dev/null @@ -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 $? diff --git a/oam/cloud/IDBVolumeCmds.sh b/oam/cloud/IDBVolumeCmds.sh deleted file mode 100644 index 3d64007b1..000000000 --- a/oam/cloud/IDBVolumeCmds.sh +++ /dev/null @@ -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 $? diff --git a/oam/cloud/MCSInstanceCmds.sh b/oam/cloud/MCSInstanceCmds.sh index 32e674f90..a720537e7 100755 --- a/oam/cloud/MCSInstanceCmds.sh +++ b/oam/cloud/MCSInstanceCmds.sh @@ -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 diff --git a/oam/cloud/MCSVolumeCmds.sh b/oam/cloud/MCSVolumeCmds.sh index c7a231261..9311000c1 100755 --- a/oam/cloud/MCSVolumeCmds.sh +++ b/oam/cloud/MCSVolumeCmds.sh @@ -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 } diff --git a/oam/etc/CMakeLists.txt b/oam/etc/CMakeLists.txt index 6e334e7b6..0470ac0ae 100644 --- a/oam/etc/CMakeLists.txt +++ b/oam/etc/CMakeLists.txt @@ -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) diff --git a/oam/etc/Calpont.xml b/oam/etc/Calpont.xml deleted file mode 100755 index a63fe8127..000000000 --- a/oam/etc/Calpont.xml +++ /dev/null @@ -1,544 +0,0 @@ - - - - - - 0.0.0.0 - 8601 - unassigned - - - 0.0.0.0 - 8602 - - - 0.0.0.0 - 8603 - - - 0.0.0.0 - 8604 - - - 0.0.0.0 - 8605 - - - - - 127.0.0.1 - 8800 - - - 0.0.0.0 - 8800 - - - 0.0.0.0 - 8800 - - - 0.0.0.0 - 8800 - - - 0.0.0.0 - 8622 - - - 0.0.0.0 - 8622 - - - 0.0.0.0 - 8622 - - - 0.0.0.0 - 8630 - - - 0.0.0.0 - 8612 - - - 0.0.0.0 - 8614 - - - 10000 - - - 1 - 8 - 128 - 10K - 0 - 13 - 512 - 512 - - 1 - 0 - y - - - - y - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - 0.0.0.0 - 8620 - - - C - columnstore-1 - pm1 - unassigned - unassigned - 1 - 3 - 6 // 2.5 minutes - - - 1 - $INSTALLDIR/data1 - $INSTALLDIR/data1/systemFiles/dbrm/BRM_saves - $INSTALLDIR/data1/systemFiles/dbrm/tablelocks - 20 - 100000 - 90 - 80 - 70 - /tmp - /tmp - 10 - 0.0.0.0 - 128M - 10 - /tmp/columnstore_tmp_files - $INSTALLDIR - 10 - 120 - restartSystem - n - 95 - OFF - - /tmp/rdwrscratch - - - dm - Director Module - SIMPLEX - 0 - 0.0.0.0 - unassigned - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - unassigned - unassigned - um - User Module - SIMPLEX - 1 - 0.0.0.0 - unassigned - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - unassigned - unassigned - pm - Performance Module - SIMPLEX - 1 - 0.0.0.0 - unassigned - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - 1 - 1 - - - 0 - unassigned - 0.0.0.0 - ENABLED - - - 1000 - $INSTALLDIR/data1/systemFiles/dbrm/SMTxnID - - - - 1GB - - - - $INSTALLDIR/data1/systemFiles/dbrm/oidbitmap - - 3000 - - - $INSTALLDIR/data/bulk - $INSTALLDIR/data1/systemFiles/bulkRollback - 98 - 1 - - - 1 - 0.0.0.0 - 8616 - - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - - - - 1 - 0 - 0 - 65536 - 2K - 200 - 0 - - - n - n - n - 2 - n - n - internal - internal - rpm - unassigned - mariadb1 - unassigned - unassigned - unassigned - us-east-1 - unassigned - unassigned - autoassign - unassigned - unassigned - unassigned - standard - unassigned - unassigned - unassigned - standard - unassigned - y - y - 0 - unassigned - unassigned - n - 0 - unassigned - n - unassigned - unassigned - 3306 - unassigned - /dev/xvd - - - - 4 - 2 - 0x0 - - - 128 - 128K - 128 - 64M - 50% - 10% - 100 - N - - $INSTALLDIR/tmp - Y - - - 16K - 32 - 1 - - - 20 - - - 1M - 1M - 512 - - - - - - - - unassigned - 3306 - unassigned - - - - N - - - N - - - Y - - - 127.0.0.1 - 0 - - - diff --git a/oam/etc/Calpont.xml.singleserver b/oam/etc/Calpont.xml.singleserver deleted file mode 100644 index eaed66037..000000000 --- a/oam/etc/Calpont.xml.singleserver +++ /dev/null @@ -1,530 +0,0 @@ - - - - - 127.0.0.1 - 8601 - pm1 - - - 0.0.0.0 - 8602 - - - 127.0.0.1 - 8603 - - - 127.0.0.1 - 8604 - - - 0.0.0.0 - 8605 - - - 127.0.0.1 - 8800 - - - 0.0.0.0 - 8800 - - - 0.0.0.0 - 8800 - - - 127.0.0.1 - 8800 - - - 0.0.0.0 - 8622 - - - 0.0.0.0 - 8622 - - - 127.0.0.1 - 8622 - - - 127.0.0.1 - 8630 - - - 127.0.0.1 - 8612 - - - 127.0.0.1 - 8614 - - - 10000 - - - 1 - 8 - 128 - - 10K - 0 - 13 - 512 - 512 - - 1 - 0 - n - - - - 95 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - 127.0.0.1 - 8620 - - - C - columnstore-1 - pm1 - unassigned - - - 1 - $INSTALLDIR/data1 - $INSTALLDIR/data1/systemFiles/dbrm/BRM_saves - $INSTALLDIR/data1/systemFiles/dbrm/tablelocks - 20 - 100000 - 90 - 80 - 70 - /tmp - /tmp - 10 - 0.0.0.0 - 128M - 10 - /tmp/columnstore_tmp_files - $INSTALLDIR - 10 - 3 - 10 - 120 - restartSystem - n - 95 - OFF - - /tmp/rdwrscratch - - - dm - Director Module - SIMPLEX - 0 - 0.0.0.0 - unassigned - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - unassigned - unassigned - um - User Module - SIMPLEX - 0 - 0.0.0.0 - unassigned - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - unassigned - unassigned - pm - Performance Module - SIMPLEX - 1 - 127.0.0.1 - localhost - ENABLED - 0 - 0 - 0 - 0 - 90 - 80 - 70 - 90 - 0 - 0 - 90 - 80 - 70 - / - 1 - 1 - - - 0 - unassigned - 0.0.0.0 - ENABLED - - - 1000 - $INSTALLDIR/data1/systemFiles/dbrm/CalpontShm - $INSTALLDIR/data1/systemFiles/dbrm/SMTxnID - - - $INSTALLDIR/data1/systemFiles/dbrm/CalpontSessionMonitorShm - 10 - - - - 1GB - - - - - $INSTALLDIR/data1/systemFiles/dbrm/oidbitmap - - 3000 - - - $INSTALLDIR/data/bulk - $INSTALLDIR/data/bulk/rollback - 98 - 1 - - - 1 - 127.0.0.1 - 8616 - - - - 127.0.0.1 - 8700 - pm1 - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - 0.0.0.0 - 8700 - unassigned - - - - 50 - - 1 - 0 - 0 - 65536 - 2K - 200 - 0 - - - n - y - y - 2 - n - n - internal - internal - unassigned - unassigned - unassigned - rpm - unassigned - unassigned - us-east-1 - unassigned - unassigned - unassigned - unassigned - unassigned - unassigned - unassigned - unassigned - n - n - 0 - unassigned - unassigned - n - unassigned - unassigned - 3306 - unassigned - - - - 4 - 2 - 0x0 - - - 128 - 128K - 128 - 64M - 25% - 10% - 100 - N - - $INSTALLDIR/tmp - Y - - - 16K - 32 - 1 - - - 20 - - - 1M - 1M - 512 - - - - - - - - unassigned - 3306 - unassigned - - - - N - - - N - - - Y - - - 127.0.0.1 - 0 - - diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index 5bafb9f96..b5610bf11 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -249,13 +249,14 @@ 90 80 70 - /tmp + 10 0.0.0.0 128M 10 - /tmp/columnstore_tmp_files $INSTALLDIR 10 120 @@ -266,7 +267,9 @@ - /tmp/rdwrscratch + /rdwrscratch + /columnstore_tmp_files + /tmp/columnstore_tmp_files dm @@ -424,6 +427,8 @@ + 1 @@ -445,7 +450,6 @@ internal rpm unassigned - mariadb1 unassigned autoassign unassigned @@ -469,6 +473,8 @@ 3306 /dev/xvd n + /var/lock/subsys + unassigned - $INSTALLDIR/tmp + files are left behind. + /tmp --> Y diff --git a/oam/etc/Columnstore.xml.singleserver b/oam/etc/Columnstore.xml.singleserver index 8768eb6ce..0c291579a 100644 --- a/oam/etc/Columnstore.xml.singleserver +++ b/oam/etc/Columnstore.xml.singleserver @@ -418,7 +418,9 @@ unassigned - + + 50 1 @@ -463,6 +465,7 @@ unassigned 3306 y + /var/lock/subsys