1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-2068 - added the memory command line parameters to the installer as well to support single type installations

This commit is contained in:
sneJ-
2019-01-16 20:14:56 +01:00
parent fdc9f55840
commit 83f493eef3
2 changed files with 153 additions and 50 deletions

View File

@ -126,10 +126,22 @@ int main(int argc, char* argv[])
mysqlpw = argv[10];
installer_debug = argv[11];
if (argc >= 13)
string totalBlocksPctParam = "";
string totalUmMemoryParam = "";
if (argc >= 13) {
installDir = argv[12];
else
if (argc >= 15) {
if (!string(argv[13]).compare("-")) {
totalBlocksPctParam = argv[13];
}
if (!string(argv[14]).compare("-")) {
totalUmMemoryParam = argv[14];
}
}
}
else {
installDir = "/usr/local/mariadb/columnstore";
}
ofstream file("/dev/null");
@ -151,6 +163,12 @@ int main(int argc, char* argv[])
cout << mysqlpw << endl;
cout << installer_debug << endl;
cout << installDir << endl;
if (!totalBlocksPctParam.empty()) {
cout << totalBlocksPctParam << endl;
}
if (!totalUmMemoryParam.empty()) {
cout << totalUmMemoryParam << endl;
}
// restore cout stream buffer
cout.rdbuf (strm_buffer);
@ -255,17 +273,27 @@ int main(int argc, char* argv[])
return false;
}
string numBlocksPct = "50";
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;
@ -282,7 +310,9 @@ int main(int argc, char* argv[])
// long long total = myinfo.totalram / 1024 / 1000;
// adjust max memory, 25% of total memory
string percent = "25%";
string percent;
if (totalUmMemoryParam.empty()) {
percent = "25%";
if (DBRootStorageType == "hdfs")
{
@ -290,7 +320,11 @@ int main(int argc, char* argv[])
}
cout << " Setting 'TotalUmMemory' to " << percent << " of total memory. " << endl;
}
else {
percent = totalUmMemoryParam;
cout << " Setting 'TotalUmMemory' to " << percent << endl;
}
try
{
sysConfig->setConfig("HashJoin", "TotalUmMemory", percent);
@ -305,30 +339,48 @@ int main(int argc, char* argv[])
{
try
{
string numBlocksPct = sysConfig->getConfig("DBBC", "NumBlocksPct");
string totalUmMemory = sysConfig->getConfig("HashJoin", "TotalUmMemory");
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", "50");
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
sysConfig->setConfig("HashJoin", "TotalUmMemory", totalUmMemory);
cout << endl << "NOTE: Setting 'NumBlocksPct' to 50%" << endl;
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 in the MariaDB ColumnStore System Configuration file" << endl;
cout << "ERROR: Problem setting NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
cout << endl << "NOTE: Using previous configuration setting for 'NumBlocksPct' = " << numBlocksPct << "%" << endl;
cout << " Using previous configuration setting for 'TotalUmMemory' = " << totalUmMemory << endl;
}
catch (...)
{
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
@ -350,7 +402,23 @@ int main(int argc, char* argv[])
// are we using settings from previous config file?
if ( reuseConfig == "n" )
{
cout << endl << "NOTE: Using the default setting for 'NumBlocksPct' at 70%" << endl;
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
{
@ -358,17 +426,14 @@ int main(int argc, char* argv[])
}
catch (...) {}
// adjust max memory, 50% of total memory
cout << endl << "Setting 'TotalUmMemory' to 50% of total memory." << endl;
try
{
sysConfig->setConfig("HashJoin", "TotalUmMemory", "50%");
sysConfig->setConfig("DBBC", "NumBlocksPct", numBlocksPct);
sysConfig->setConfig("HashJoin", "TotalUmMemory", totalUmMemory);
}
catch (...)
{
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
cout << "ERROR: Problem setting TotalUmMemory/NumBlocksPct in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
}
@ -376,15 +441,47 @@ int main(int argc, char* argv[])
{
try
{
string numBlocksPct = sysConfig->getConfig("DBBC", "NumBlocksPct");
string totalUmMemory = sysConfig->getConfig("HashJoin", "TotalUmMemory");
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);
cout << endl << "NOTE: Using previous configuration setting for 'NumBlocksPct' = " << numBlocksPct << "%" << endl;
cout << " Using previous configuration setting for 'TotalUmMemory' = " << totalUmMemory << endl;
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 (...)
{

View File

@ -333,9 +333,9 @@ int main(int argc, char* argv[])
cout << " -um-ip-addrs User Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx" << endl;
cout << " -x Do not resolve IP Addresses from host names" << endl;
cout << " -numBlocksPct amount of physical memory to utilize for disk block caching" << endl;
cout << " (percentages of the total memory need to be stated without suffix, explcit values with suffixes M or G)";
cout << " (percentages of the total memory need to be stated without suffix, explcit values with suffixes M or G)" << endl;
cout << " -totalUmMemory amount of physical memory to utilize for joins, intermediate results and set operations on the UM" << endl;
cout << " (percentages of the total memory need to be stated with suffix %, explcit values with suffixes M or G)";
cout << " (percentages of the total memory need to be stated with suffix %, explcit values with suffixes M or G)" << endl;
exit (0);
}
else if (string("-x") == argv[i])
@ -994,7 +994,6 @@ int main(int argc, char* argv[])
offLineAppCheck();
checkMysqlPort(mysqlPort, sysConfig);
if ( !writeConfig(sysConfig) )
{
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
@ -1003,7 +1002,14 @@ int main(int argc, char* argv[])
cout << endl << "===== Performing Configuration Setup and MariaDB ColumnStore Startup =====" << endl;
cmd = installDir + "/bin/installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + installDir;
if (numBlocksPctParam.empty()) {
numBlocksPctParam = "-";
}
if (totalUmMemoryParam.empty()) {
totalUmMemoryParam = "-";
}
cmd = installDir + "/bin/installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + installDir + " " + totalBlocksPctParam + " " + totalUmMemoryParam;
system(cmd.c_str());
exit(0);
}