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

MCOL-3915 Remove some configuration from postConfigure. Default Columnstore.xml to a standard single server config.

This commit is contained in:
Jose
2020-04-14 20:59:37 +00:00
committed by root
parent 3b5da5ba00
commit 97b8e41ce3
3 changed files with 63 additions and 610 deletions

View File

@ -7,16 +7,16 @@
-->
<Columnstore Version="V1.0.0">
<ExeMgr1>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8601</Port>
<Module>unassigned</Module>
<Module>pm1</Module>
</ExeMgr1>
<JobProc>
<IPAddr>0.0.0.0</IPAddr>
<Port>8602</Port>
</JobProc>
<ProcMgr>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8603</Port>
</ProcMgr>
<ProcMgr_Alarm>
@ -24,7 +24,7 @@
<Port>8606</Port>
</ProcMgr_Alarm>
<ProcStatusControl>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8604</Port>
</ProcStatusControl>
<ProcStatusControlStandby>
@ -51,7 +51,7 @@
<Port>8800</Port>
</um1_ProcessMonitor>
<pm1_ProcessMonitor>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8800</Port>
</pm1_ProcessMonitor>
<dm1_ServerMonitor>
@ -63,19 +63,19 @@
<Port>8622</Port>
</um1_ServerMonitor>
<pm1_ServerMonitor>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8622</Port>
</pm1_ServerMonitor>
<pm1_WriteEngineServer>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8630</Port>
</pm1_WriteEngineServer>
<DDLProc>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8612</Port>
</DDLProc>
<DMLProc>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8614</Port>
</DMLProc>
<BatchInsert>
@ -93,138 +93,138 @@
<!-- <BPPCount>16</BPPCount> --> <!-- Default num cores * 2. A cap on the number of simultaneous primitives per jobstep -->
<PrefetchThreshold>1</PrefetchThreshold>
<PTTrace>0</PTTrace>
<RotatingDestination>y</RotatingDestination> <!-- Iterate thru UM ports; set to 'n' if UM/PM on same server -->
<RotatingDestination>n</RotatingDestination> <!-- Iterate thru UM ports; set to 'n' if UM/PM on same server -->
<!-- <HighPriorityPercentage>60</HighPriorityPercentage> -->
<!-- <MediumPriorityPercentage>30</MediumPriorityPercentage> -->
<!-- <LowPriorityPercentage>10</LowPriorityPercentage> -->
<DirectIO>y</DirectIO>
</PrimitiveServers>
<PMS1>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS1>
<PMS2>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS2>
<PMS3>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS3>
<PMS4>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS4>
<PMS5>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS5>
<PMS6>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS6>
<PMS7>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS7>
<PMS8>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS8>
<PMS9>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS9>
<PMS10>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS10>
<PMS11>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS11>
<PMS12>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS12>
<PMS13>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS13>
<PMS14>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS14>
<PMS15>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS15>
<PMS16>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS16>
<PMS17>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS17>
<PMS18>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS18>
<PMS19>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS19>
<PMS20>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS20>
<PMS21>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS21>
<PMS22>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS22>
<PMS23>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS23>
<PMS24>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS24>
<PMS25>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS25>
<PMS26>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS26>
<PMS27>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS27>
<PMS28>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS28>
<PMS29>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS29>
<PMS30>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS30>
<PMS31>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS31>
<PMS32>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8620</Port>
</PMS32>
<SystemConfig>
@ -232,7 +232,7 @@
<SystemName>columnstore-1</SystemName>
<ParentOAMModuleName>pm1</ParentOAMModuleName>
<StandbyOAMModuleName>unassigned</StandbyOAMModuleName>
<PrimaryUMModuleName>unassigned</PrimaryUMModuleName>
<PrimaryUMModuleName>pm1</PrimaryUMModuleName>
<ModuleHeartbeatPeriod>1</ModuleHeartbeatPeriod>
<ModuleHeartbeatCount>3</ModuleHeartbeatCount>
<ModuleProcMonWaitCount>12</ModuleProcMonWaitCount> // 2.5 minutes
@ -269,6 +269,7 @@
<hdfsRdwrScratch>/rdwrscratch</hdfsRdwrScratch> <!-- Do not set to an hdfs file path -->
<TempFileDir>/columnstore_tmp_files</TempFileDir>
<SystemTempFileDir>/tmp/columnstore_tmp_files</SystemTempFileDir>
<DataFilePlugin/>
</SystemConfig>
<SystemModuleConfig>
<ModuleType1>dm</ModuleType1>
@ -297,7 +298,7 @@
<ModuleType2>um</ModuleType2>
<ModuleDesc2>User Module</ModuleDesc2>
<RunType2>SIMPLEX</RunType2>
<ModuleCount2>1</ModuleCount2>
<ModuleCount2>0</ModuleCount2>
<ModuleIPAddr1-1-2>0.0.0.0</ModuleIPAddr1-1-2>
<ModuleHostName1-1-2>unassigned</ModuleHostName1-1-2>
<ModuleDisableState1-2>ENABLED</ModuleDisableState1-2>
@ -321,8 +322,8 @@
<ModuleDesc3>Performance Module</ModuleDesc3>
<RunType3>SIMPLEX</RunType3>
<ModuleCount3>1</ModuleCount3>
<ModuleIPAddr1-1-3>0.0.0.0</ModuleIPAddr1-1-3>
<ModuleHostName1-1-3>unassigned</ModuleHostName1-1-3>
<ModuleIPAddr1-1-3>127.0.0.1</ModuleIPAddr1-1-3>
<ModuleHostName1-1-3>localhost</ModuleHostName1-1-3>
<ModuleDisableState1-3>ENABLED</ModuleDisableState1-3>
<ModuleCPUCriticalThreshold3>0</ModuleCPUCriticalThreshold3>
<ModuleCPUMajorThreshold3>0</ModuleCPUMajorThreshold3>
@ -370,14 +371,14 @@
</WriteEngine>
<DBRM_Controller>
<NumWorkers>1</NumWorkers>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8616</Port>
</DBRM_Controller>
<!-- Worker Port: 8700 - 8720 is reserved to support External Modules-->
<DBRM_Worker1>
<IPAddr>0.0.0.0</IPAddr>
<IPAddr>127.0.0.1</IPAddr>
<Port>8700</Port>
<Module>unassigned</Module>
<Module>pm1</Module>
</DBRM_Worker1>
<DBRM_Worker2>
<IPAddr>0.0.0.0</IPAddr>
@ -437,18 +438,19 @@
<MaxOpenFiles>2K</MaxOpenFiles>
<DecreaseOpenFilesCount>200</DecreaseOpenFilesCount>
<FDCacheTrace>0</FDCacheTrace>
<NumBlocksPct>50</NumBlocksPct>
</DBBC>
<Installation>
<SystemStartupOffline>n</SystemStartupOffline>
<InitialInstallFlag>n</InitialInstallFlag>
<SingleServerInstall>n</SingleServerInstall>
<ServerTypeInstall>1</ServerTypeInstall>
<InitialInstallFlag>y</InitialInstallFlag>
<SingleServerInstall>y</SingleServerInstall>
<ServerTypeInstall>2</ServerTypeInstall>
<PMwithUM>n</PMwithUM>
<MySQLRep>n</MySQLRep>
<DBRootStorageType>internal</DBRootStorageType>
<UMStorageType>internal</UMStorageType>
<EEPackageType>rpm</EEPackageType>
<SystemLogConfigFile>unassigned</SystemLogConfigFile>
<EEPackageType>binary</EEPackageType>
<SystemLogConfigFile>/etc/rsyslog.d/49-columnstore.conf</SystemLogConfigFile>
<Cloud>unassigned</Cloud>
<AmazonVPCNextPrivateIP>autoassign</AmazonVPCNextPrivateIP>
<UMInstanceType>unassigned</UMInstanceType>
@ -472,7 +474,7 @@
<MySQLPort>3306</MySQLPort>
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
<LockFileDirectory>/var/lock/subsys</LockFileDirectory>
<ProfileFile>unassigned</ProfileFile>
<ProfileFile>/etc/profile.d/columnstoreAlias.sh</ProfileFile>
</Installation>
<ExtentMap>
<!--
@ -488,7 +490,7 @@
<MaxElems>128K</MaxElems> <!-- 128 buckets * 128K * 16 = 256 MB -->
<FifoSizeLargeSide>64</FifoSizeLargeSide>
<PmMaxMemorySmallSide>1G</PmMaxMemorySmallSide>
<TotalUmMemory>50%</TotalUmMemory>
<TotalUmMemory>25%</TotalUmMemory>
<TotalPmUmMemory>10%</TotalPmUmMemory>
<CPUniqueLimit>100</CPUniqueLimit>
<AllowDiskBasedJoin>N</AllowDiskBasedJoin>
@ -530,10 +532,10 @@
<Host>127.0.0.1</Host>
<Port>3306</Port>
<User>root</User>
<Password></Password>
<TLSCA></TLSCA>
<TLSClientCert></TLSClientCert>
<TLSClientKey></TLSClientKey>
<Password/>
<TLSCA/>
<TLSClientCert/>
<TLSClientKey/>
</CrossEngineSupport>
<QueryStats>
<Enabled>N</Enabled>
@ -553,4 +555,3 @@
<Enabled>N</Enabled>
</StorageManager>
</Columnstore>

View File

@ -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

View File

@ -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 <string> 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 <string> lines;
char line[200];
string buf;
string newLine;
string newLine1;
while (oldFile.getline(line, 200))
{
buf = line;
newLine = line;
std::vector<std::string>::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<string>(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 <string> 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<char> sep(",");
boost::tokenizer< boost::char_separator<char> > tokens(tempdbrootList, sep);
for ( boost::tokenizer< boost::char_separator<char> >::iterator it = tokens.begin();
it != tokens.end();
++it)
{
dbroots.push_back(*it);
}
}
break;
}
int id = 1;
std::vector<std::string>::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)