From e6855c3221eafcffe7c26f4a991d5fa99df1ee0c Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 26 Oct 2018 09:10:45 -0500 Subject: [PATCH] MCOL-520 amazon changes --- oamapps/postConfigure/postConfigure.cpp | 184 +++++++++--------- .../postConfigure/quick_installer_amazon.sh | 10 +- .../quick_installer_multi_server.sh | 9 +- .../quick_installer_single_server.sh | 6 +- 4 files changed, 112 insertions(+), 97 deletions(-) diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 9735225b1..63ba2f9a2 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -805,12 +805,16 @@ int main(int argc, char* argv[]) { cout << "===== Quick Install Multi-Server Configuration =====" << endl << endl; + cout << "Multi-Server install defaulting to using local storage" << endl; + singleServerInstall = "2"; } else if (amazon_quick_install) { cout << "===== Quick Install Amazon Configuration =====" << endl << endl; + cout << "Amazon AMI EC2 install defaulting to using local storage" << endl; + singleServerInstall = "2"; } else @@ -856,95 +860,14 @@ int main(int argc, char* argv[]) if (temp == "1") { - singleServerInstall = temp; - 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; - - cmd = installDir + "/bin/installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + installDir; - system(cmd.c_str()); - exit(0); + singleServerInstall = "1"; + break; } else { if (temp == "2") { - singleServerInstall = temp; + singleServerInstall = "2"; break; } } @@ -953,14 +876,99 @@ int main(int argc, char* argv[]) if ( noPrompting ) exit(1); - - continue; } - - break; } } + // perform single server install + if (singleServerInstall == "1") + { + 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; + + cmd = installDir + "/bin/installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + installDir; + system(cmd.c_str()); + exit(0); + } + + // perform multi-node install + try { sysConfig->setConfig(InstallSection, "SingleServerInstall", "n"); diff --git a/oamapps/postConfigure/quick_installer_amazon.sh b/oamapps/postConfigure/quick_installer_amazon.sh index 95fb4978a..f1f287cbe 100755 --- a/oamapps/postConfigure/quick_installer_amazon.sh +++ b/oamapps/postConfigure/quick_installer_amazon.sh @@ -55,6 +55,7 @@ else fi if [[ $HOME = "/root" ]]; then + echo "" echo "${bold}Run post-install script${normal}" echo "" /usr/local/mariadb/columnstore/bin/post-install @@ -70,13 +71,14 @@ else echo "" $HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore - tmpDir=`$HOME/mariadb/columnstore/bin/getConfig SystemConfig SystemTempFileDir` - + export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib + echo "${bold}Run postConfigure script${normal}" echo "" if [[ $umCount = "" ]]; then - . $tmpDir;$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount $systemName -d + $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount $systemName -d else - . $tmpDir;$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount -um-count $umCount $systemName -d + $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount -um-count $umCount $systemName -d fi fi diff --git a/oamapps/postConfigure/quick_installer_multi_server.sh b/oamapps/postConfigure/quick_installer_multi_server.sh index 2a3042550..d47bdaacd 100755 --- a/oamapps/postConfigure/quick_installer_multi_server.sh +++ b/oamapps/postConfigure/quick_installer_multi_server.sh @@ -61,6 +61,7 @@ else fi if [[ $HOME = "/root" ]]; then + echo "" echo "${bold}Run post-install script${normal}" echo "" /usr/local/mariadb/columnstore/bin/post-install @@ -72,17 +73,19 @@ if [[ $HOME = "/root" ]]; then /usr/local/mariadb/columnstore/bin/postConfigure -qm -pm-ip-addrs $pmIpAddrs -um-ip-addrs $umIpAddrs $nonDistrubutedInstall $systemName fi else + echo "" echo "${bold}Run post-install script${normal}" echo "" $HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore - tmpDir=`$HOME/mariadb/columnstore/bin/getConfig SystemConfig SystemTempFileDir` + export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib echo "${bold}Run postConfigure script${normal}" echo "" if [[ $umIpAddrs = "" ]]; then - . $tmpDir;$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs $nonDistrubutedInstall $systemName + $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs $nonDistrubutedInstall $systemName else - . $tmpDir;$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs -um-ip-addrs $umIpAddrs $nonDistrubutedInstall $systemName + $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs -um-ip-addrs $umIpAddrs $nonDistrubutedInstall $systemName fi fi diff --git a/oamapps/postConfigure/quick_installer_single_server.sh b/oamapps/postConfigure/quick_installer_single_server.sh index aae015dba..5a88abbef 100755 --- a/oamapps/postConfigure/quick_installer_single_server.sh +++ b/oamapps/postConfigure/quick_installer_single_server.sh @@ -18,6 +18,7 @@ done if [ $HOME == "/root" ]; then + echo "" echo "Run post-install script" echo "" /usr/local/mariadb/columnstore/bin/post-install @@ -29,9 +30,10 @@ else echo "" $HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore - tmpDir=`$HOME/mariadb/columnstore/bin/getConfig SystemConfig SystemTempFileDir` + export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mariadb/columnstore/lib:$HOME/mariadb/columnstore/mysql/lib echo "Run postConfigure script" echo "" - . $tmpDir; $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qs + $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qs fi