1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-20 01:42:27 +03:00

MCOL-3915. Cleanup postConfigure. PostConfigure and Installer no longer editing config file

This commit is contained in:
Jose
2020-04-15 17:15:34 +00:00
committed by root
parent 97b8e41ce3
commit ea39ac7f43
5 changed files with 31 additions and 2458 deletions

View File

@@ -78,7 +78,6 @@ bool uncommentCalpontXml( string entry);
extern string pwprompt;
bool noPrompting;
string mysqlpw = " ";
bool rootUser = true;
@@ -96,8 +95,6 @@ int main(int argc, char* argv[])
ModuleList performancemodulelist;
Module childmodule;
struct sysinfo myinfo;
string prompt;
string nodeps = "-h";
string installer_debug = "0";
@@ -216,291 +213,6 @@ int main(int argc, char* argv[])
IserverTypeInstall = atoi(serverTypeInstall.c_str());
if ( installType != "uninstall" )
{
//setup ProcessConfig.xml
switch ( IserverTypeInstall )
{
case (oam::INSTALL_COMBINE_DM_UM_PM): // combined #1 dm/um/pm on a single server
case (oam::INSTALL_COMBINE_DM_UM): // combined #2 dm/um on a same server
case (oam::INSTALL_COMBINE_PM_UM): // combined #3 um/pm on a same server
{
//module ProcessConfig.xml to setup all apps on the dm
if ( !updateProcessConfig(IserverTypeInstall) )
cout << "Update ProcessConfig.xml error" << endl;
break;
}
}
//set Resource Settings
switch ( IserverTypeInstall )
{
case (oam::INSTALL_COMBINE_DM_UM_PM): // combined #1 - dm/um/pm on a single server
{
if ( !writeConfig(sysConfig) )
{
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
try
{
sysConfig->setConfig("PrimitiveServers", "RotatingDestination", "n");
}
catch (...)
{
cout << "ERROR: Problem setting RotatingDestination in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
// are we using settings from previous config file?
if ( reuseConfig == "n" )
{
try
{
DBRootStorageType = sysConfig->getConfig(InstallSection, "DBRootStorageType");
}
catch (...)
{
cout << "ERROR: Problem getting DB Storage Data from the MariaDB ColumnStore System Configuration file" << endl;
return false;
}
string numBlocksPct;
if (numBlocksPctParam.empty()) {
numBlocksPct = "50";
if (DBRootStorageType == "hdfs")
numBlocksPct = "25";
}
else {
numBlocksPct = numBlocksPctParam;
}
try
{
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
if (*numBlocksPct.rbegin() == 'M' || *numBlocksPct.rbegin() == 'G') {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << endl;
}
else {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << "%" << endl;
}
}
catch (...)
{
cout << "ERROR: Problem setting NumBlocksPct in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
try
{
sysinfo(&myinfo);
}
catch (...) {}
//get memory stats
// long long total = myinfo.totalram / 1024 / 1000;
// adjust max memory, 25% of total memory
string percent;
if (totalUmMemoryParam.empty()) {
percent = "25%";
if (DBRootStorageType == "hdfs")
{
percent = "12%";
}
cout << " Setting 'TotalUmMemory' to " << percent << " of total memory. " << endl;
}
else {
percent = totalUmMemoryParam;
cout << " Setting 'TotalUmMemory' to " << percent << endl;
}
try
{
sysConfig->setConfig("HashJoin", "TotalUmMemory", percent);
}
catch (...)
{
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
else
{
try
{
string numBlocksPct;
string totalUmMemory;
if (!numBlocksPctParam.empty()) {
numBlocksPct = numBlocksPctParam;
}
else {
numBlocksPct = sysConfig->getConfig("DBBC", "NumBlocksPct");
}
if (!totalUmMemoryParam.empty()) {
totalUmMemory = totalUmMemoryParam;
}
else {
totalUmMemory = sysConfig->getConfig("HashJoin", "TotalUmMemory");
}
if (numBlocksPct.empty() || numBlocksPct == "")
{
numBlocksPct = "50";
}
if (totalUmMemory.empty() || totalUmMemory == "") {
totalUmMemory = "25%";
}
try
{
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
sysConfig->setConfig("HashJoin", "TotalUmMemory", totalUmMemory);
if (*numBlocksPct.rbegin() == 'M' || *numBlocksPct.rbegin() == 'G') {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << endl;
}
else {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << "%" << endl;
}
cout << " Setting 'TotalUmMemory' to " << totalUmMemory << endl;
}
catch (...)
{
cout << "ERROR: Problem setting NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
catch (...)
{
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in 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);
}
break;
}
default: // normal, seperate UM and PM
{
// are we using settings from previous config file?
if ( reuseConfig == "n" )
{
string numBlocksPct = "70";
string totalUmMemory = "50%";
if (!numBlocksPctParam.empty()) {
numBlocksPct = numBlocksPctParam;
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << endl;
}
else {
cout << endl << "NOTE: Using the default setting for 'NumBlocksPct' at " << numBlocksPct << "%" << endl;
}
if (!totalUmMemoryParam.empty()) {
totalUmMemory = totalUmMemoryParam;
cout << endl << "Setting 'TotalUmMemory' to " << totalUmMemory << endl;
}
else {
cout << endl << "Setting 'TotalUmMemory' to " << totalUmMemory << " of total memory." << endl;
}
try
{
sysinfo(&myinfo);
}
catch (...) {}
try
{
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
sysConfig->setConfig("HashJoin", "TotalUmMemory", totalUmMemory);
}
catch (...)
{
cout << "ERROR: Problem setting TotalUmMemory/NumBlocksPct in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
else
{
try
{
string numBlocksPct;
string totalUmMemory;
if (!numBlocksPctParam.empty()) {
numBlocksPct = numBlocksPctParam;
}
else {
numBlocksPct = sysConfig->getConfig("DBBC", "NumBlocksPct");
}
if (!totalUmMemoryParam.empty()) {
totalUmMemory = totalUmMemoryParam;
}
else {
totalUmMemory = sysConfig->getConfig("HashJoin", "TotalUmMemory");
}
if (numBlocksPct.empty() || numBlocksPct == "")
{
numBlocksPct = "70";
}
if (totalUmMemory.empty() || totalUmMemory == "") {
totalUmMemory = "50%";
}
try
{
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
sysConfig->setConfig("HashJoin", "TotalUmMemory", totalUmMemory);
if (*numBlocksPct.rbegin() == 'M' || *numBlocksPct.rbegin() == 'G') {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << endl;
}
else {
cout << endl << "NOTE: Setting 'NumBlocksPct' to " << numBlocksPct << "%" << endl;
}
cout << " Setting 'TotalUmMemory' to " << totalUmMemory << endl;
}
catch (...)
{
cout << "ERROR: Problem setting NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
catch (...)
{
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in 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);
}
break;
}
}
}
if ( !writeConfig(sysConfig) )
{
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
//get PPackage Type
try
{
@@ -707,9 +419,6 @@ int main(int argc, char* argv[])
// call the mysql setup scripts
mysqlSetup();
sleep(5);
// cout << "(3) SKIP_OAM_INIT is set, so will not start ColumnStore or init the system catalog" << endl;
sysConfig->setConfig("Installation", "MySQLRep", "n");
sysConfig->write();
exit(0);
}