diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index e1445deb2..256cf60b8 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -7,16 +7,16 @@ --> - 0.0.0.0 + 127.0.0.1 8601 - unassigned + pm1 0.0.0.0 8602 - 0.0.0.0 + 127.0.0.1 8603 @@ -24,7 +24,7 @@ 8606 - 0.0.0.0 + 127.0.0.1 8604 @@ -51,7 +51,7 @@ 8800 - 0.0.0.0 + 127.0.0.1 8800 @@ -63,19 +63,19 @@ 8622 - 0.0.0.0 + 127.0.0.1 8622 - 0.0.0.0 + 127.0.0.1 8630 - 0.0.0.0 + 127.0.0.1 8612 - 0.0.0.0 + 127.0.0.1 8614 @@ -93,138 +93,138 @@ 1 0 - y + n y - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 - 0.0.0.0 + 127.0.0.1 8620 @@ -232,7 +232,7 @@ columnstore-1 pm1 unassigned - unassigned + pm1 1 3 12 // 2.5 minutes @@ -269,6 +269,7 @@ /rdwrscratch /columnstore_tmp_files /tmp/columnstore_tmp_files + dm @@ -297,7 +298,7 @@ um User Module SIMPLEX - 1 + 0 0.0.0.0 unassigned ENABLED @@ -321,8 +322,8 @@ Performance Module SIMPLEX 1 - 0.0.0.0 - unassigned + 127.0.0.1 + localhost ENABLED 0 0 @@ -370,14 +371,14 @@ 1 - 0.0.0.0 + 127.0.0.1 8616 - 0.0.0.0 + 127.0.0.1 8700 - unassigned + pm1 0.0.0.0 @@ -437,18 +438,19 @@ 2K 200 0 + 50 n - n - n - 1 + y + y + 2 n n internal internal - rpm - unassigned + binary + /etc/rsyslog.d/49-columnstore.conf unassigned autoassign unassigned @@ -472,7 +474,7 @@ 3306 /dev/xvd /var/lock/subsys - unassigned + /etc/profile.d/columnstoreAlias.sh 64 1G - 50% + 25% 10% 100 N @@ -530,10 +532,10 @@ 127.0.0.1 3306 root - - - - + + + + N @@ -553,4 +555,3 @@ N - diff --git a/oam/install_scripts/columnstore.service.in b/oam/install_scripts/columnstore.service.in index b25819b71..ec4cbfba2 100644 --- a/oam/install_scripts/columnstore.service.in +++ b/oam/install_scripts/columnstore.service.in @@ -9,8 +9,6 @@ ExecStart=/bin/true # This service shall be considered active after start RemainAfterExit=yes -Restart=on-abort -RestartSec=5s [Install] WantedBy=multi-user.target diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 39f0cfbff..d9c286837 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -319,39 +319,6 @@ int main(int argc, char* argv[]) string postConfigureLog = "/var/log/columnstore-postconfigure-" + currentDate; - if (oam.checkSystemRunning()) - { - cout << "MariaDB ColumnStore is running, can't run postConfigure while MariaDB ColumnStore is running. Exiting.." << endl; - exit (1); - } - - char buf[512]; - *(int64_t*)buf = 0; - FILE* cmd_pipe = popen("pidof -s mysqld", "r"); - if (cmd_pipe) - { - fgets(buf, 512, cmd_pipe); - pid_t pid = strtoul(buf, NULL, 10); - pclose(cmd_pipe); - if (pid) - { - cout << "MariaDB Server is currently running on PID " << pid << ". Cannot run postConfigure whilst this is running. Exiting.." << endl; - exit (1); - } - } - else - { - cout << "The utility 'pidof' is not installed. Can't check for MariaDB server already running Exiting..." << endl; - exit (1); - } - - //check Config saved files - if ( !checkSaveConfigFile()) - { - cout << "ERROR: Configuration File not setup" << endl; - exit(1); - } - //determine package type string EEPackageType; @@ -390,74 +357,11 @@ int main(int argc, char* argv[]) exit(1); } - //check mysql port changes - string MySQLPort; - - try - { - MySQLPort = sysConfig->getConfig(InstallSection, "MySQLPort"); - } - catch (...) - {} - - if ( mysqlPort == oam::UnassignedName ) - { - if ( MySQLPort.empty() || MySQLPort == "" ) - { - mysqlPort = "3306"; - - try - { - sysConfig->setConfig(InstallSection, "MySQLPort", "3306"); - } - catch (...) - {} - } - else - mysqlPort = MySQLPort; - } - else - { - // mysql port was providing on command line - try - { - sysConfig->setConfig(InstallSection, "MySQLPort", mysqlPort); - } - catch (...) - {} - } - // perform single server install cout << endl << "Performing the Single Server Install." << endl << endl; //setup to Columnstore.xml file for single server - singleServerConfigSetup(sysConfig); - - //module ProcessConfig.xml to setup all apps on the pm - if ( !updateProcessConfig() ) - cout << "Update ProcessConfig.xml error" << endl; - - try - { - sysConfig->setConfig(InstallSection, "SingleServerInstall", "y"); - sysConfig->setConfig(InstallSection, "ServerTypeInstall", "2"); - } - catch (...) - { - cout << "ERROR: Problem setting SingleServerInstall from the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - if ( !writeConfig(sysConfig) ) - { - cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - setSystemName(); - cout << endl; - - system(cmd.c_str()); + //singleServerConfigSetup(sysConfig); // setup storage if (!storageSetup(false)) @@ -470,24 +374,6 @@ int main(int argc, char* argv[]) if ( !updateBash() ) cout << "updateBash error" << endl; - // setup storage - if (!singleServerDBrootSetup()) - { - cout << "ERROR: Problem setting up DBRoot IDs" << endl; - exit(1); - } - - //set system DBRoot count and check 'files per parition' with number of dbroots - try - { - sysConfig->setConfig(SystemSection, "DBRootCount", oam.itoa(DBRootCount)); - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot Count in the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - //check if dbrm data resides in older directory path and inform user if it does dbrmDirCheck(); @@ -513,165 +399,6 @@ int main(int argc, char* argv[]) exit(0); } -/* - * Check for reuse of RPM saved Columnstore.xml - */ -bool checkSaveConfigFile() -{ - string rpmFileName = std::string(MCSSYSCONFDIR) + "/columnstore/Columnstore.xml"; - string newFileName = std::string(MCSSYSCONFDIR) + "/columnstore/Columnstore.xml.new"; - - string extentMapCheckOnly = " "; - - //check if Columnstore.xml.rpmsave exist - ifstream File (oldFileName.c_str()); - - if (!File) { - if (single_server_quick_install || multi_server_quick_install || amazon_quick_install) - { - return true; - } - if ( noPrompting ) { - cout << endl << "Old Config File not found '" + oldFileName + "', exiting" << endl; - exit(1); - } - return true; - } - else - { - if (single_server_quick_install || multi_server_quick_install || amazon_quick_install) - { - cout << endl << "Quick Install is for fresh installs only, '" + oldFileName + "' exist, exiting" << endl; - exit(1); - } - } - - File.close(); - - // If 'oldFileName' isn't configured, exit - Config* oldSysConfig = Config::makeConfig(oldFileName); - - string oldpm1 = oldSysConfig->getConfig("SystemModuleConfig", "ModuleIPAddr1-1-3"); - - if ( oldpm1 == "0.0.0.0") - { - if ( noPrompting ) - { - cout << endl << "Old Config File not Configured, PM1 IP Address entry is '0.0.0.0', '" + oldFileName + "', exiting" << endl; - exit(1); - } - else - return true; - } - - // get single-server system install type - string temp; - - try - { - temp = oldSysConfig->getConfig(InstallSection, "SingleServerInstall"); - } - catch (...) - {} - - if ( !temp.empty() ) - singleServerInstall = temp; - - if ( singleServerInstall == "y" ) - singleServerInstall = "1"; - else - singleServerInstall = "2"; - - // clear this entry out to validate updates being made - Config* sysConfig = Config::makeConfig(); - sysConfig->setConfig("ExeMgr1", "IPAddr", "0.0.0.0"); - - for ( int retry = 0 ; retry < 5 ; retry++ ) - { - string cmd = "mv -f " + rpmFileName + " " + newFileName; - int rtnCode = system(cmd.c_str()); - - if (WEXITSTATUS(rtnCode) != 0) - { - cout << "Error moving installed version of Columnstore.xml" << endl; - return false; - } - - cmd = "cp " + oldFileName + " " + rpmFileName; - rtnCode = system(cmd.c_str()); - - if (WEXITSTATUS(rtnCode) != 0) - { - cout << "Error moving pkgsave file" << endl; - return false; - } - - cmd = "cd " + std::string(MCSSYSCONFDIR) + "/columnstore;autoConfigure " + extentMapCheckOnly; - rtnCode = system(cmd.c_str()); - - if (WEXITSTATUS(rtnCode) != 0) - { - cout << "Error running autoConfigure" << endl; - return false; - } - - cmd = "mv -f " + newFileName + " " + rpmFileName; - rtnCode = system(cmd.c_str()); - - if (WEXITSTATUS(rtnCode) != 0) - { - cout << "Error moving pkgsave file" << endl; - return false; - } - - //check to see if updates were made - if ( sysConfig->getConfig("ExeMgr1", "IPAddr") != "0.0.0.0") - { - //Columnstore.xml is ready to go, get feature options - - if ( MySQLRep == "n" ) - { - try - { - MySQLRep = sysConfig->getConfig(InstallSection, "MySQLRep"); - } - catch (...) - {} - - if ( MySQLRep == "y" ) - mysqlRep = true; - } - - if ( PMwithUM == "n" ) - { - //get local query / PMwithUM feature flag - try - { - PMwithUM = sysConfig->getConfig(InstallSection, "PMwithUM"); - } - catch (...) - {} - - if ( PMwithUM == "y" ) - { - pmwithum = true; - } - } - - return true; - } - - sleep(1); - } - - if ( reuseConfig == "n" ) - return true; - - cout << "ERROR: Failed to copy data to Columnstore.xml" << endl; - return false; - -} - /* * Setup OS Files by appending the Calpont versions */ @@ -730,84 +457,6 @@ bool setOSFiles(string parentOAMModuleName, int serverTypeInstall) return allfound; } - -/* - * Update ProcessConfig.xml file for a single server configuration - * Change the 'um' to 'pm' - */ -bool updateProcessConfig() -{ - vector oldModule; - string newModule = ">pm"; - oldModule.push_back(">um"); - - string fileName = std::string(MCSSYSCONFDIR) + "/columnstore/ProcessConfig.xml"; - - //Save a copy of the original version - string cmd = "/bin/cp -f " + fileName + " " + fileName + ".columnstoreSave > /dev/null 2>&1"; - system(cmd.c_str()); - - ifstream oldFile (fileName.c_str()); - - if (!oldFile) return true; - - vector lines; - char line[200]; - string buf; - string newLine; - string newLine1; - - while (oldFile.getline(line, 200)) - { - buf = line; - newLine = line; - - std::vector::iterator pt1 = oldModule.begin(); - - for ( ; pt1 != oldModule.end() ; pt1++) - { - int start = 0; - - while (true) - { - string::size_type pos = buf.find(*pt1, start); - - if (pos != string::npos) - { - newLine = buf.substr(0, pos); - newLine.append(newModule); - - newLine1 = buf.substr(pos + 3, 200); - newLine.append(newLine1); - start = pos + 3; - } - else - { - buf = newLine; - start = 0; - break; - } - } - } - - //output to temp file - lines.push_back(buf); - } - - oldFile.close(); - unlink (fileName.c_str()); - ofstream newFile (fileName.c_str()); - - //create new file - int fd = open(fileName.c_str(), O_RDWR | O_CREAT, 0664); - - copy(lines.begin(), lines.end(), ostream_iterator(newFile, "\n")); - newFile.close(); - - close(fd); - return true; -} - /* * Uncomment entry in Columnstore.xml */ @@ -1526,45 +1175,6 @@ bool storageSetup(bool amazonInstall) return true; } - -void setSystemName() -{ - Oam oam; - - //setup System Name - - if ( systemName.empty() ) - { - try { - systemName = sysConfig->getConfig(SystemSection, "SystemName"); - } - catch(...) - { - systemName = oam::UnassignedName; - } - } - - if ( systemName.empty() ) - systemName = "columnstore-1"; - - try - { - sysConfig->setConfig(SystemSection, "SystemName", systemName); - oam.changeMyCnf( "server_audit_syslog_info", systemName ); - } - catch (...) - { - cout << "ERROR: Problem setting SystemName from the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - if ( !writeConfig(sysConfig) ) - { - cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } -} - /* * Copy fstab file */ @@ -1748,162 +1358,6 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str } } - -bool singleServerDBrootSetup() -{ - Oam oam; - - cout << endl; - - //get number of dbroots - string moduledbrootcount = "ModuleDBRootCount1-3"; - unsigned int count; - - try - { - count = atoi(sysConfig->getConfig(ModuleSection, moduledbrootcount).c_str()); - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot count in the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - string dbrootList; - - for ( unsigned int id = 1 ; id < count + 1 ; ) - { - string moduledbrootid = "ModuleDBRootID1-" + oam.itoa(id) + "-3"; - - try - { - string dbrootid = sysConfig->getConfig(ModuleSection, moduledbrootid); - - if ( dbrootid != oam::UnassignedName) - { - sysConfig->setConfig(ModuleSection, moduledbrootid, oam::UnassignedName); - - dbrootList = dbrootList + dbrootid; - id ++; - - if ( id < count + 1 ) - dbrootList = dbrootList + ","; - } - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot ID in the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - } - - vector dbroots; - string tempdbrootList; - - while (true) - { - dbroots.clear(); - tempdbrootList = dbrootList; - - if ( tempdbrootList.empty()) - continue; - - //check for range - int firstID; - int lastID; - string::size_type pos = tempdbrootList.find("-", 0); - - if (pos != string::npos) - { - firstID = atoi(tempdbrootList.substr(0, pos).c_str()); - lastID = atoi(tempdbrootList.substr(pos + 1, 200).c_str()); - - if ( firstID >= lastID ) - { - cout << "Invalid Entry, please re-enter" << endl; - continue; - } - else - { - for ( int id = firstID ; id < lastID + 1 ; id++ ) - { - dbroots.push_back(oam.itoa(id)); - } - } - } - else - { - boost::char_separator sep(","); - boost::tokenizer< boost::char_separator > tokens(tempdbrootList, sep); - - for ( boost::tokenizer< boost::char_separator >::iterator it = tokens.begin(); - it != tokens.end(); - ++it) - { - dbroots.push_back(*it); - } - } - - break; - } - - int id = 1; - std::vector::iterator it = dbroots.begin(); - - for (; it != dbroots.end() ; it++, ++id) - { - //store DBRoot ID - string moduledbrootid = "ModuleDBRootID1-" + oam.itoa(id) + "-3"; - - try - { - sysConfig->setConfig(ModuleSection, moduledbrootid, *it); - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot ID in the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - string DBrootID = "DBRoot" + *it; - string pathID = "/var/lib/columnstore/data" + *it; - - try - { - sysConfig->setConfig(SystemSection, DBrootID, pathID); - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot in the MariaDB ColumnStore System Configuration file" << endl; - return false; - } - } - - //store number of dbroots - moduledbrootcount = "ModuleDBRootCount1-3"; - - try - { - sysConfig->setConfig(ModuleSection, moduledbrootcount, oam.itoa(dbroots.size())); - } - catch (...) - { - cout << "ERROR: Problem setting DBRoot count in the MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - //total dbroots on the system - DBRootCount = DBRootCount + dbroots.size(); - - if ( !writeConfig(sysConfig) ) - { - cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl; - exit(1); - } - - return true; -} - pthread_mutex_t THREAD_LOCK; void remoteInstallThread(void* arg)