You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-3915 Columnstore-post-install/postConfigure processed and columnstore started during installation
This commit is contained in:
@ -55,10 +55,9 @@ rm -f /var/lib/columnstore/data/bulk/tmpjob/* >/dev/null 2>&1
|
||||
#get temp base directory
|
||||
tmpDir="/tmp"
|
||||
#get columnstore temp file directory name
|
||||
TempFileDir=`mcsGetConfig SystemConfig TempFileDir`
|
||||
tmpDir=${tmpDir}${TempFileDir}
|
||||
tmpDir=/tmp/columnstore_tmp_files
|
||||
mkdir $tmpDir >/dev/null 2>&1
|
||||
chmod 777 $tmpDir
|
||||
chmod 664 $tmpDir
|
||||
|
||||
#create mount directories
|
||||
mkdir /mnt/tmp > /dev/null 2>&1
|
||||
@ -85,8 +84,8 @@ if [ $user = "root" ]; then
|
||||
systemctl=`which systemctl 2>/dev/null`
|
||||
if [ -n "$systemctl" ]; then
|
||||
|
||||
cp @ENGINE_SUPPORTDIR@/controllernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/controllernode.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/columnstore.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/columnstore.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/controllernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/controllernode.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/ddlproc.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
@ -97,12 +96,20 @@ if [ $user = "root" ]; then
|
||||
cp @ENGINE_SUPPORTDIR@/exemgr.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/primproc.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/primproc.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/workdernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/workernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/workernode.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/writeengine.service /usr/lib/systemd/system/. >/dev/null 2>&1
|
||||
cp @ENGINE_SUPPORTDIR@/writeengine.service /lib/systemd/system/. >/dev/null 2>&1
|
||||
|
||||
systemctl enable columnstore >/dev/null 2>&1
|
||||
systemctl enable controllernode > /dev/null 2>&1
|
||||
systemctl enable ddlproc > /dev/null 2>&1
|
||||
systemctl enable dmlproc > /dev/null 2>&1
|
||||
systemctl enable exemgr > /dev/null 2>&1
|
||||
systemctl enable primproc > /dev/null 2>&1
|
||||
systemctl enable workernode > /dev/null 2>&1
|
||||
systemctl enable writeengine > /dev/null 2>&1
|
||||
|
||||
else
|
||||
chkconfig=`which chkconfig 2>/dev/null`
|
||||
if [ -n "$chkconfig" ]; then
|
||||
@ -164,29 +171,7 @@ if [ -z "aws" ]; then
|
||||
MCSgetCredentials.sh >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
cat <<EOD
|
||||
The next step on the node that will become PM1:
|
||||
|
||||
postConfigure
|
||||
|
||||
|
||||
EOD
|
||||
|
||||
#postConfigure scripts
|
||||
#post-mysqld-install --tmpDir=$tmpDir > $tmpDir/post-mysqld-install.log 2>&1
|
||||
#post-mysql-install --tmpDir=$tmpDir > $tmpDir/post-mysql-install.log 2>&1
|
||||
#columnstore restart > /dev/null 2>&1
|
||||
#dbbuilder 7 > $tmpDir/dbbuilder.log 2>&1
|
||||
|
||||
postConfigure -qs
|
||||
|
||||
PROGS='workernode controllernode PrimProc ExeMgr DMLProc DDLProc mysqld WriteEngineServer'
|
||||
MCS_INSTALL_DIR=/usr
|
||||
|
||||
kill $(pidof $PROGS) > /dev/null
|
||||
sleep 3
|
||||
kill -9 $(pidof $PROGS) > /dev/null
|
||||
@ENGINE_BINDIR@/clearShm
|
||||
systemctl start columnstore
|
||||
|
||||
exit 0
|
||||
|
@ -3,10 +3,14 @@ Description=MariaDB Columnstore
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=@ENGINE_BINDIR@/columnstore-post-install
|
||||
|
||||
# Execute a dummy program
|
||||
ExecStart=/bin/true
|
||||
|
||||
# This service shall be considered active after start
|
||||
RemainAfterExit=yes
|
||||
Restart=on-abort
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -4,10 +4,8 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/controllernode.log && chmod 666 /var/log/mariadb/columnstore/controllernode.log"
|
||||
ExecStart=@ENGINE_BINDIR@/controllernode &> /var/log/mariadb/columnstore/controllernode.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -4,10 +4,9 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/ddlproc.log && chmod 666 /var/log/mariadb/columnstore/ddlproc.log"
|
||||
ExecStart=@ENGINE_BINDIR@/DDLProc &> /var/log/mariadb/columnstore/ddlproc.log
|
||||
Restart=on-failure
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -4,10 +4,8 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/dmlproc.log && chmod 666 /var/log/mariadb/columnstore/dmlproc.log"
|
||||
ExecStart=@ENGINE_BINDIR@/DMLProc &> /var/log/mariadb/columnstore/dmlproc.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -4,10 +4,7 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/exemgr.log && chmod 666 /var/log/mariadb/columnstore/exemgr.log"
|
||||
ExecStart=@ENGINE_BINDIR@/ExeMgr &> /var/log/mariadb/columnstore/exemgr.log
|
||||
ExecStart=@ENGINE_BINDIR@/ExeMgr
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
|
@ -4,10 +4,8 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/primproc.log && chmod 666 /var/log/mariadb/columnstore/primproc.log"
|
||||
ExecStart=@ENGINE_BINDIR@/PrimProc &> /var/log/mariadb/columnstore/primproc.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -4,11 +4,9 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "touch /var/log/mariadb/columnstore/workernode.log && chmod 666 /var/log/mariadb/columnstore/workernode.log"
|
||||
ExecStartPre=@ENGINE_BINDIR@/bash -c "clearShm > /dev/null 2>&1"
|
||||
ExecStart=@ENGINE_BINDIR@/workernode DBRM_Worker1 &> /var/log/mariadb/columnstore/workernode.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -4,10 +4,8 @@ PartOf=columnstore.service
|
||||
After=columnstore.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
GuessMainPID=yes
|
||||
ExecStartPre=/usr/bin/bash -c "touch /var/log/mariadb/columnstore/writeengineserver.log && chmod 666 /var/log/mariadb/columnstore/writeengineserver.log"
|
||||
ExecStart=/usr/bin/WriteEngineServer &> /var/log/mariadb/columnstore/writeengineserver.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=columnstore.service
|
||||
|
@ -697,135 +697,20 @@ int main(int argc, char* argv[])
|
||||
|
||||
string idbstartcmd = "columnstore start";
|
||||
|
||||
{
|
||||
//
|
||||
// perform single-server install from auto-installer
|
||||
//
|
||||
if ( calpont_rpm1 != "dummy.rpm" )
|
||||
{
|
||||
//
|
||||
// perform single-server install from postConfigure
|
||||
//
|
||||
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
sleep(5);
|
||||
|
||||
if (getenv("SKIP_OAM_INIT"))
|
||||
{
|
||||
cout << "(2) 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);
|
||||
}
|
||||
|
||||
//start on local module
|
||||
int rtnCode = system(idbstartcmd.c_str());
|
||||
|
||||
if (WEXITSTATUS(rtnCode) != 0)
|
||||
cout << "Error starting MariaDB ColumnStore local module" << endl;
|
||||
else
|
||||
cout << "Start MariaDB ColumnStore request successful" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// perform single-server install from postConfigure
|
||||
//
|
||||
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
sleep(5);
|
||||
|
||||
if (getenv("SKIP_OAM_INIT"))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
//startup mysqld and infinidb processes
|
||||
cout << endl;
|
||||
cmd = "clearShm > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
system(idbstartcmd.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// check for system going ACTIVE
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
sleep(5);
|
||||
cout << endl << "Starting MariaDB ColumnStore Database Platform Starting, please wait .";
|
||||
cout.flush();
|
||||
|
||||
string ProfileFile;
|
||||
try
|
||||
{
|
||||
ProfileFile = sysConfig->getConfig(InstallSection, "ProfileFile");
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( waitForActive() )
|
||||
{
|
||||
cout << " DONE" << endl;
|
||||
|
||||
string logFile = tmpDir + "/dbbuilder.log";
|
||||
cmd = "dbbuilder 7 > " + logFile;
|
||||
system(cmd.c_str());
|
||||
|
||||
if (oam.checkLogStatus(logFile, "System Catalog created") )
|
||||
cout << endl << "System Catalog Successfully Created" << endl;
|
||||
else
|
||||
{
|
||||
if ( oam.checkLogStatus(logFile, "System catalog appears to exist") )
|
||||
{
|
||||
cout.flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << endl << "System Catalog Create Failure" << endl;
|
||||
cout << "Check latest log file in " << logFile << endl;
|
||||
cout << " IMPORTANT: Once issue has been resolved, rerun postConfigure" << endl << endl;
|
||||
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl << "MariaDB ColumnStore Install Successfully Completed, System is Active" << endl << endl;
|
||||
|
||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||
|
||||
cout << ". " << ProfileFile << endl << endl;
|
||||
|
||||
cout << "Enter 'mariadb' to access the MariaDB ColumnStore SQL console" << endl;
|
||||
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
||||
|
||||
cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias.sh" << endl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << " FAILED" << endl;
|
||||
|
||||
cout << " IMPORTANT: There was a system startup failed, once issue has been resolved, rerun postConfigure" << endl << endl;
|
||||
|
||||
cout << endl << "ERROR: MariaDB ColumnStore Process failed to start, check log files in /var/log/mariadb/columnstore" << endl;
|
||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||
|
||||
cout << ". " << ProfileFile << endl << endl;
|
||||
|
||||
cout << "Enter 'mariadb' to access the MariaDB ColumnStore SQL console" << endl;
|
||||
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
||||
|
||||
cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias" << endl << endl;
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
||||
exit (0);
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -177,9 +177,7 @@ string hadoopInstalled = "n";
|
||||
string mysqlPort = oam::UnassignedName;
|
||||
string systemName;
|
||||
|
||||
|
||||
|
||||
bool noPrompting = false;
|
||||
bool noPrompting = true;
|
||||
bool rootUser = true;
|
||||
string USER = "root";
|
||||
bool hdfs = false;
|
||||
@ -257,7 +255,6 @@ int main(int argc, char* argv[])
|
||||
DBRootModule dbrootmodule;
|
||||
DBRootList dbrootlist;
|
||||
PerformanceModuleList performancemodulelist;
|
||||
int DBRMworkernodeID = 0;
|
||||
string nodeps = "-h";
|
||||
bool startOfflinePrompt = false;
|
||||
noPrompting = false;
|
||||
@ -300,98 +297,9 @@ int main(int argc, char* argv[])
|
||||
|
||||
tmpDir = startup::StartUp::tmpDir();
|
||||
|
||||
for ( int i = 1; i < argc; i++ )
|
||||
{
|
||||
if( string("-h") == argv[i] || string("--help") == argv[i] )
|
||||
{
|
||||
cout << endl;
|
||||
cout << "This is the MariaDB ColumnStore System Configuration and Installation tool." << endl;
|
||||
cout << "It will Configure the MariaDB ColumnStore System based on Operator inputs and" << endl;
|
||||
cout << "will perform a Package Installation of all of the Modules within the" << endl;
|
||||
cout << "System that is being configured." << endl;
|
||||
cout << endl;
|
||||
cout << "IMPORTANT: This tool is required to run on a Performance Module #1 (pm1) Server." << endl;
|
||||
cout << endl;
|
||||
cout << "Instructions:" << endl << endl;
|
||||
cout << " Press 'enter' to accept a value in (), if available or" << endl;
|
||||
cout << " Enter one of the options within [], if available, or" << endl;
|
||||
cout << " Enter a new value" << endl << endl;
|
||||
cout << endl;
|
||||
cout << "Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-port][-i][-sn]" << endl;
|
||||
cout << " [-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count][-x][-xr]" << endl;
|
||||
cout << " [-numBlocksPct][-totalUmMemory][-sm-bucket][-sm-region][-sm-id]" << endl;
|
||||
cout << " [-sm-secret][-sm-endpoint][-sm-cache][-sm-prefix]" << endl;
|
||||
cout << " -h Help" << endl;
|
||||
cout << " -c Config File to use to extract configuration data, default is " << endl;
|
||||
cout << " Columnstore.xml.rpmsave" << endl;
|
||||
cout << " -u Upgrade, Install using the Config File from -c, default is " << endl;
|
||||
cout << " Columnstore.xml.rpmsave. If ssh-keys aren't setup, you should provide " << endl;
|
||||
cout << " passwords as command line arguments" << endl;
|
||||
cout << " -p Unix Password, used with no-prompting option" << endl;
|
||||
cout << " -qs Quick Install - Single Server" << endl;
|
||||
cout << " -qm Quick Install - Multi Server" << endl;
|
||||
cout << " -port MariaDB ColumnStore Port Address" << endl;
|
||||
cout << " -sn System Name" << endl;
|
||||
cout << " -pm-ip-addrs Performance Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx" << endl;
|
||||
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 << " -xr Resolve host names into their reverse DNS host names. Only applied in " << endl;
|
||||
cout << " combination with -x" << 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," << endl;
|
||||
cout << " explicit values with suffixes M or G)" << endl;
|
||||
cout << " -totalUmMemory amount of physical memory to utilize for joins, intermediate" << endl;
|
||||
cout << " results and set operations on the UM. (percentages of the total memory" << endl;
|
||||
cout << " need to be stated with suffix %, explcit values with suffixes M or G)" << endl;
|
||||
cout << endl;
|
||||
cout << " S3-compat storage quick-configure options:" << endl;
|
||||
cout << " (See /etc/columnstore/storagemanager.cnf.example for more information)" << endl;
|
||||
cout << " -sm-bucket bucket The bucket to use." << endl;
|
||||
cout << " -sm-region region The region to use." << endl;
|
||||
cout << " -sm-id id The ID to use; equivalent to AWS_ACCESS_KEY_ID in AWS" << endl;
|
||||
cout << " -sm-secret secret The secret; equivalent to AWS_SECRET_ACCESS_KEY in AWS" << endl;
|
||||
cout << " -sm-endpoint host The host to connect to" << endl;
|
||||
cout << " -sm-cache size The amount of disk space to use as a local cache" << endl;
|
||||
cout << " -sm-prefix prefix Where storagemanager will store its files" << endl;
|
||||
exit (0);
|
||||
}
|
||||
else if( string("-qs") == argv[i] )
|
||||
{
|
||||
single_server_quick_install = true;
|
||||
noPrompting = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << " ERROR: Invalid Argument = " << argv[i] << endl;
|
||||
cout << "Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-port][-i][-sn]" << endl;
|
||||
cout << " [-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count][-x][-xr]" << endl;
|
||||
cout << " [-numBlocksPct][-totalUmMemory][-sm-bucket][-sm-region][-sm-id]" << endl;
|
||||
cout << " [-sm-secret][-sm-endpoint][-sm-cache][-sm-prefix]" << endl;
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
if ( oldFileName == oam::UnassignedName )
|
||||
oldFileName = std::string(MCSSYSCONFDIR) + "/columnstore/Columnstore.xml.rpmsave";
|
||||
|
||||
cout << endl;
|
||||
cout << "This is the MariaDB ColumnStore System Configuration and Installation tool." << endl;
|
||||
cout << "It will Configure the MariaDB ColumnStore System and will perform a Package" << endl;
|
||||
cout << "Installation of all of the Servers within the System that is being configured." << endl;
|
||||
cout << endl;
|
||||
|
||||
cout << "IMPORTANT: This tool requires to run on the Performance Module #1" << endl;
|
||||
cout << endl;
|
||||
|
||||
// MCOL-3675
|
||||
struct stat dir_info;
|
||||
if (stat(tmpDir.c_str(), &dir_info) != 0)
|
||||
{
|
||||
cerr<<endl<<tmpDir<<" directory not found."<<endl;
|
||||
cerr<<"Make sure columnstore-post-install is run before you run this tool. Exiting."<<endl<<endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
string ProfileFile;
|
||||
try
|
||||
{
|
||||
@ -400,15 +308,17 @@ int main(int argc, char* argv[])
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
// MCOL-3676
|
||||
if (ProfileFile.empty())
|
||||
{
|
||||
cerr<<endl<<"ProfileFile variable not set in the Config file."<<endl;
|
||||
cerr<<"Make sure columnstore-post-install is run before you run this tool. Exiting."<<endl<<endl;
|
||||
exit(1);
|
||||
}
|
||||
//get current time and date
|
||||
time_t now;
|
||||
now = time(NULL);
|
||||
struct tm tm;
|
||||
localtime_r(&now, &tm);
|
||||
char timestamp[200];
|
||||
strftime (timestamp, 200, "%m:%d:%y-%H:%M:%S", &tm);
|
||||
string currentDate = timestamp;
|
||||
|
||||
string postConfigureLog = "/var/log/columnstore-postconfigure-" + currentDate;
|
||||
|
||||
//check if MariaDB ColumnStore is up and running
|
||||
if (oam.checkSystemRunning())
|
||||
{
|
||||
cout << "MariaDB ColumnStore is running, can't run postConfigure while MariaDB ColumnStore is running. Exiting.." << endl;
|
||||
@ -480,112 +390,6 @@ int main(int argc, char* argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//check for local ip address as pm1
|
||||
ModuleConfig moduleconfig;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("pm1", moduleconfig);
|
||||
|
||||
if (moduleconfig.hostConfigList.size() > 0 )
|
||||
{
|
||||
HostConfigList::iterator pt1 = moduleconfig.hostConfigList.begin();
|
||||
|
||||
// MCOL-1607. The 'am I pm1?' check below requires an ipaddr.
|
||||
string PM1ipAdd = oam.getIPAddress((*pt1).IPAddr.c_str());
|
||||
if (PM1ipAdd.empty())
|
||||
PM1ipAdd = (*pt1).IPAddr; // this is what it was doing before
|
||||
|
||||
//cout << PM1ipAdd << endl;
|
||||
|
||||
if ( PM1ipAdd != "127.0.0.1" )
|
||||
{
|
||||
if ( PM1ipAdd != "0.0.0.0")
|
||||
{
|
||||
struct ifaddrs* ifap, *ifa;
|
||||
struct sockaddr_in* sa;
|
||||
char* addr;
|
||||
bool found = false;
|
||||
|
||||
if (getifaddrs (&ifap) == 0 )
|
||||
{
|
||||
for (ifa = ifap; ifa; ifa = ifa->ifa_next)
|
||||
{
|
||||
if (ifa->ifa_addr == NULL )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ifa->ifa_addr->sa_family == AF_INET)
|
||||
{
|
||||
sa = (struct sockaddr_in*) ifa->ifa_addr;
|
||||
addr = inet_ntoa(sa->sin_addr);
|
||||
//printf("Interface: %s\tAddress: %s\n", ifa->ifa_name, addr);
|
||||
|
||||
if ( PM1ipAdd == addr )
|
||||
{
|
||||
//match
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
|
||||
freeifaddrs(ifap);
|
||||
|
||||
if (!found)
|
||||
{
|
||||
|
||||
string answer = "y";
|
||||
|
||||
while (true)
|
||||
{
|
||||
cout << endl << "The Configured PM1 IP Address of " << PM1ipAdd << " does not match any of the" << endl;
|
||||
cout << "Server Ethernet IP addresses there were detected, do you want to continue?" << endl;
|
||||
cout << "This is to make sure that you arent running postConfigure from a non-PM1 node." << endl;
|
||||
prompt = "Enter 'y' to continue using Configured IP address [y,n] (y) > ";
|
||||
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) answer = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ( answer == "y" || answer == "n" )
|
||||
{
|
||||
cout << endl;
|
||||
break;
|
||||
}
|
||||
else
|
||||
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( answer == "n" )
|
||||
{
|
||||
cout << endl;
|
||||
cout << "ERROR: postConfigure install can only be done on the PM1" << endl;
|
||||
cout << "designated node. The configured PM1 IP address doesn't match the local" << endl;
|
||||
cout << "IP Address. exiting..." << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
//check mysql port changes
|
||||
string MySQLPort;
|
||||
|
||||
@ -623,111 +427,90 @@ int main(int argc, char* argv[])
|
||||
{}
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
|
||||
if (single_server_quick_install)
|
||||
{
|
||||
cout << "===== Quick Install Single-Server Configuration =====" << endl << endl;
|
||||
|
||||
cout << "Single-Server install is used when there will only be 1 server configured" << endl;
|
||||
cout << "on the system. It can also be used for production systems, if the plan is" << endl;
|
||||
cout << "to stay single-server." << endl;
|
||||
|
||||
singleServerInstall = "1";
|
||||
}
|
||||
|
||||
// perform single server install
|
||||
if (singleServerInstall == "1")
|
||||
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
|
||||
{
|
||||
cout << endl << "Performing the Single Server Install." << endl << endl;
|
||||
|
||||
if ( reuseConfig == "n" )
|
||||
{
|
||||
//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());
|
||||
|
||||
// setup storage
|
||||
if (!storageSetup(false))
|
||||
{
|
||||
cout << "ERROR: Problem setting up storage" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (hdfs || !rootUser)
|
||||
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();
|
||||
|
||||
if (startOfflinePrompt)
|
||||
offLineAppCheck();
|
||||
|
||||
checkMysqlPort(mysqlPort, sysConfig);
|
||||
if ( !writeConfig(sysConfig) )
|
||||
{
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << endl << "===== Performing Configuration Setup and MariaDB ColumnStore Startup =====" << endl;
|
||||
|
||||
if (numBlocksPctParam.empty()) {
|
||||
numBlocksPctParam = "-";
|
||||
}
|
||||
if (totalUmMemoryParam.empty()) {
|
||||
totalUmMemoryParam = "-";
|
||||
}
|
||||
|
||||
cmd = "columnstore_installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + numBlocksPctParam + " " + totalUmMemoryParam;
|
||||
system(cmd.c_str());
|
||||
exit(0);
|
||||
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());
|
||||
|
||||
// setup storage
|
||||
if (!storageSetup(false))
|
||||
{
|
||||
cout << "ERROR: Problem setting up storage" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (hdfs || !rootUser)
|
||||
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();
|
||||
|
||||
if (startOfflinePrompt)
|
||||
offLineAppCheck();
|
||||
|
||||
checkMysqlPort(mysqlPort, sysConfig);
|
||||
if ( !writeConfig(sysConfig) )
|
||||
{
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (numBlocksPctParam.empty()) {
|
||||
numBlocksPctParam = "-";
|
||||
}
|
||||
if (totalUmMemoryParam.empty()) {
|
||||
totalUmMemoryParam = "-";
|
||||
}
|
||||
|
||||
cmd = "columnstore_installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + numBlocksPctParam + " " + totalUmMemoryParam;
|
||||
system(cmd.c_str());
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -799,69 +582,6 @@ bool checkSaveConfigFile()
|
||||
else
|
||||
singleServerInstall = "2";
|
||||
|
||||
if ( !noPrompting )
|
||||
{
|
||||
cout << endl << "A copy of the MariaDB ColumnStore Configuration file has been saved during Package install." << endl;
|
||||
|
||||
if ( singleServerInstall == "1")
|
||||
cout << "It's Configured for a Single Server Install." << endl;
|
||||
else
|
||||
cout << "It's Configured for a Multi-Server Install." << endl;
|
||||
|
||||
cout << "You have an option of utilizing the configuration data from that file or starting" << endl;
|
||||
cout << "with the MariaDB ColumnStore Configuration File that comes with the MariaDB ColumnStore Package." << endl;
|
||||
cout << "You will only want to utilize the old configuration data when performing the same" << endl;
|
||||
cout << "type of install, i.e. Single or Multi-Server" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "The MariaDB ColumnStore Configuration Data is taken from " << oldFileName << endl;
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
|
||||
while (true)
|
||||
{
|
||||
pcommand = callReadline("Do you want to utilize the configuration data from the saved copy? [y,n] > ");
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0)
|
||||
{
|
||||
reuseConfig = pcommand;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( noPrompting )
|
||||
reuseConfig = "y";
|
||||
else
|
||||
{
|
||||
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
string cmd;
|
||||
|
||||
if ( reuseConfig == "y" )
|
||||
break;
|
||||
|
||||
if ( reuseConfig == "n" )
|
||||
{
|
||||
extentMapCheckOnly = "-e";
|
||||
break;
|
||||
}
|
||||
else
|
||||
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
|
||||
}
|
||||
|
||||
// clear this entry out to validate updates being made
|
||||
Config* sysConfig = Config::makeConfig();
|
||||
sysConfig->setConfig("ExeMgr1", "IPAddr", "0.0.0.0");
|
||||
@ -1394,248 +1114,16 @@ bool storageSetup(bool amazonInstall)
|
||||
return true;
|
||||
}
|
||||
|
||||
cout << "===== Setup Storage Configuration =====" << endl << endl;
|
||||
|
||||
string storageType;
|
||||
|
||||
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM && amazonInstall )
|
||||
try
|
||||
{
|
||||
//
|
||||
// get Frontend Data storage type
|
||||
//
|
||||
|
||||
cout << "----- Setup User Module MariaDB ColumnStore Data Storage Mount Configuration -----" << endl << endl;
|
||||
|
||||
cout << "There are 2 options when configuring the storage: internal and external" << endl << endl;
|
||||
cout << " 'internal' - This is specified when a local disk is used for the Data storage." << endl << endl;
|
||||
cout << " 'external' - This is specified when the MariaDB ColumnStore Data directory is externally mounted." << endl << endl;
|
||||
|
||||
try
|
||||
{
|
||||
UMStorageType = sysConfig->getConfig(InstallSection, "UMStorageType");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem getting UM DB Storage Data from the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
storageType = "1";
|
||||
|
||||
if ( UMStorageType == "external" )
|
||||
storageType = "2";
|
||||
|
||||
prompt = "Select the type of Data Storage [1=internal, 2=external] (" + storageType + ") > ";
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) storageType = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ( storageType == "1" || storageType == "2")
|
||||
break;
|
||||
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( storageType == "1" )
|
||||
UMStorageType = "internal";
|
||||
else
|
||||
{
|
||||
|
||||
cout << endl << "NOTE: The volume type. This can be gp2 for General Purpose SSD, io1 for" << endl;
|
||||
cout << " Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold" << endl;
|
||||
cout << " HDD, or standard for Magnetic volumes." << endl;
|
||||
|
||||
UMStorageType = "external";
|
||||
|
||||
cout << endl;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("UMVolumeType", UMVolumeType);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( UMVolumeType.empty() || UMVolumeType == "" || UMVolumeType == oam::UnassignedName)
|
||||
UMVolumeType = "gp2";
|
||||
|
||||
while (true)
|
||||
{
|
||||
string prompt = "Enter EBS Volume Type (gp2, io1, sc1, st1, standard) : (" + UMVolumeType + ") > ";
|
||||
pcommand = callReadline(prompt);
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) UMVolumeType = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ( UMVolumeType == "standard" || UMVolumeType == "gp2" || UMVolumeType == "io1" || UMVolumeType == "sc1" || UMVolumeType == "st1")
|
||||
break;
|
||||
else
|
||||
{
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
//set UMVolumeType
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(InstallSection, "UMVolumeType", UMVolumeType);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem setting UMVolumeType in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
string minSize = "1";
|
||||
string maxSize = "16384";
|
||||
|
||||
if (UMVolumeType == "io1")
|
||||
minSize = "4";
|
||||
|
||||
if (UMVolumeType == "sc1" || UMVolumeType == "st1")
|
||||
minSize = "500";
|
||||
|
||||
if (UMVolumeType == "standard")
|
||||
maxSize = "1024";
|
||||
|
||||
cout << endl;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("UMVolumeSize", UMVolumeSize);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( UMVolumeSize.empty() || UMVolumeSize == "" || UMVolumeSize == oam::UnassignedName)
|
||||
UMVolumeSize = minSize;
|
||||
|
||||
while (true)
|
||||
{
|
||||
string prompt = "Enter EBS Volume storage size in GB: [" + minSize + "," + maxSize + "] (" + UMVolumeSize + ") > ";
|
||||
pcommand = callReadline(prompt);
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) UMVolumeSize = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ( atoi(UMVolumeSize.c_str()) < atoi(minSize.c_str()) || atoi(UMVolumeSize.c_str()) > atoi(maxSize.c_str()) )
|
||||
{
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
//set UMVolumeSize
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(InstallSection, "UMVolumeSize", UMVolumeSize);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem setting UMVolumeSize in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ( UMVolumeType == "io1" )
|
||||
{
|
||||
string minIOPS = UMVolumeSize;
|
||||
string maxIOPS = oam.itoa(atoi(UMVolumeSize.c_str()) * 30);
|
||||
|
||||
cout << endl;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("UMVolumeIOPS", UMVolumeIOPS);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( UMVolumeIOPS.empty() || UMVolumeIOPS == "" || UMVolumeIOPS == oam::UnassignedName)
|
||||
UMVolumeIOPS = maxIOPS;
|
||||
|
||||
while (true)
|
||||
{
|
||||
string prompt = "Enter EBS Volume IOPS: [" + minIOPS + "," + maxIOPS + "] (" + UMVolumeIOPS + ") > ";
|
||||
pcommand = callReadline(prompt);
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) UMVolumeSize = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ( atoi(UMVolumeSize.c_str()) < atoi(minIOPS.c_str()) || atoi(UMVolumeSize.c_str()) > atoi(maxIOPS.c_str()) )
|
||||
{
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
//set UMVolumeIOPS
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(InstallSection, "UMVolumeIOPS", UMVolumeIOPS);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem setting UMVolumeIOPS in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(InstallSection, "UMStorageType", UMStorageType);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem setting UMStorageType in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
sysConfig->setConfig(InstallSection, "UMStorageType", "internal");
|
||||
}
|
||||
else
|
||||
catch (...)
|
||||
{
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(InstallSection, "UMStorageType", "internal");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cout << "ERROR: Problem setting UMStorageType in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
cout << "ERROR: Problem setting UMStorageType in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
//check if gluster is installed
|
||||
@ -1716,104 +1204,6 @@ bool storageSetup(bool amazonInstall)
|
||||
if (DBRootStorageType == "storagemanager")
|
||||
storageType = "4";
|
||||
|
||||
cout << endl << "----- Setup Performance Module DBRoot Data Storage Mount Configuration -----" << endl << endl;
|
||||
|
||||
cout << "Columnstore supports the following storage options..." << endl;
|
||||
cout << " 1 - internal. This uses the linux VFS to access files and does" << endl <<
|
||||
" not manage the filesystem." << endl;
|
||||
cout << " 2 - external *. If you have other mountable filesystems you would" << endl <<
|
||||
" like ColumnStore to use & manage, select this option." << endl;
|
||||
cout << " 3 - GlusterFS * Note: glusterd service must be running and enabled on" << endl <<
|
||||
" all PMs." << endl;
|
||||
cout << " 4 - S3-compatible cloud storage *. Note: that should be configured" << endl <<
|
||||
" before running postConfigure (see storagemanager.cnf)" << endl;
|
||||
cout << " * - This option enables data replication and server failover in a" << endl <<
|
||||
" multi-node configuration." << endl;
|
||||
|
||||
cout << endl << "These options are available on this system: [1, 2";
|
||||
if (glusterInstalled == "y" && singleServerInstall != "1")
|
||||
cout << ", 3";
|
||||
if (storageManagerInstalled)
|
||||
cout << ", 4";
|
||||
cout << "]" << endl;
|
||||
|
||||
prompt = "Select the type of data storage (" + storageType + ") > ";
|
||||
|
||||
while (true)
|
||||
{
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) storageType = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
if ((storageType == "1" || storageType == "2") // these are always valid options
|
||||
|| (glusterInstalled == "y" && singleServerInstall != "1" && storageType == "3") // allow gluster if installed
|
||||
|| (storageManagerInstalled && storageType == "4") // allow storagemanager if installed
|
||||
)
|
||||
break;
|
||||
|
||||
// if it gets here the selection was invalid
|
||||
if (noPrompting)
|
||||
{
|
||||
cout << endl << "Invalid selection" << endl << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << endl << "Invalid selection, please re-enter" << endl << endl;
|
||||
|
||||
#if 0
|
||||
old version
|
||||
if ( ( glusterInstalled == "n" || (glusterInstalled == "y" && singleServerInstall == "1")) && hadoopInstalled == "n" )
|
||||
{
|
||||
if ( storageType == "1" || storageType == "2")
|
||||
break;
|
||||
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( (glusterInstalled == "y" && singleServerInstall != "1") && hadoopInstalled == "n" )
|
||||
{
|
||||
if ( storageType == "1" || storageType == "2" || storageType == "3")
|
||||
break;
|
||||
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( ( glusterInstalled == "n" || (glusterInstalled == "y" && singleServerInstall == "1")) && hadoopInstalled == "y" )
|
||||
{
|
||||
if ( storageType == "1" || storageType == "2" || storageType == "4")
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( (glusterInstalled == "y" && singleServerInstall != "1") && hadoopInstalled == "y" )
|
||||
{
|
||||
if ( storageType == "1" || storageType == "2" || storageType == "3" || storageType == "4")
|
||||
break;
|
||||
|
||||
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
|
||||
|
||||
if ( noPrompting )
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (storageType != "3" && DataRedundancy)
|
||||
{
|
||||
cout << "WARNING: This system was previously configured with ColumnStore DataRedundancy storage." << endl;
|
||||
@ -2157,19 +1547,6 @@ void setSystemName()
|
||||
if ( systemName.empty() )
|
||||
systemName = "columnstore-1";
|
||||
|
||||
if (!single_server_quick_install || !multi_server_quick_install)
|
||||
{
|
||||
prompt = "Enter System Name (" + systemName + ") > ";
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0) systemName = pcommand;
|
||||
|
||||
callFree(pcommand);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sysConfig->setConfig(SystemSection, "SystemName", systemName);
|
||||
@ -2426,20 +1803,7 @@ bool singleServerDBrootSetup()
|
||||
while (true)
|
||||
{
|
||||
dbroots.clear();
|
||||
|
||||
prompt = "Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm1' (" + dbrootList + ") > ";
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
|
||||
if (pcommand)
|
||||
{
|
||||
if (strlen(pcommand) > 0)
|
||||
{
|
||||
tempdbrootList = pcommand;
|
||||
callFree(pcommand);
|
||||
}
|
||||
else
|
||||
tempdbrootList = dbrootList;
|
||||
}
|
||||
tempdbrootList = dbrootList;
|
||||
|
||||
if ( tempdbrootList.empty())
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user