From 7ec0a27a1228ea912b9fe886e9c31fc9c0586885 Mon Sep 17 00:00:00 2001 From: david hill Date: Thu, 10 Aug 2017 17:00:59 -0500 Subject: [PATCH] MCOL-750 - fix install failures - timing issues --- oam/install_scripts/CMakeLists.txt | 3 +- oam/install_scripts/binary_installer.sh | 172 ++++++++------- oam/install_scripts/package_installer.sh | 266 +++++++++++++++++++++++ oamapps/postConfigure/installer.cpp | 16 +- oamapps/postConfigure/postConfigure.cpp | 12 +- procmgr/main.cpp | 41 ++-- procmgr/processmanager.cpp | 4 +- 7 files changed, 387 insertions(+), 127 deletions(-) create mode 100644 oam/install_scripts/package_installer.sh diff --git a/oam/install_scripts/CMakeLists.txt b/oam/install_scripts/CMakeLists.txt index 09e72fdb1..6b7296c54 100644 --- a/oam/install_scripts/CMakeLists.txt +++ b/oam/install_scripts/CMakeLists.txt @@ -7,8 +7,7 @@ install(PROGRAMS post-install transactionLogArchiver.sh module_installer.sh startupTests.sh - user_installer.sh - performance_installer.sh + package_installer.sh remote_scp_get.sh columnstoreAlias run.sh diff --git a/oam/install_scripts/binary_installer.sh b/oam/install_scripts/binary_installer.sh index 564e07867..7e1327502 100644 --- a/oam/install_scripts/binary_installer.sh +++ b/oam/install_scripts/binary_installer.sh @@ -72,7 +72,7 @@ send_user "\n" send_user "Stop ColumnStore service " send date\n send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore stop'\n" -set timeout 10 +set timeout 30 expect { "word: " { send "$PASSWORD\n" } "passphrase" { send "$PASSWORD\n" } @@ -82,8 +82,6 @@ set timeout 60 expect { "Exit status 0" { send_user "DONE" } "No such file" { send_user "ERROR: post-install Not Found\n" ; exit 1 } - "MariaDB Columnstore syslog logging not working" { send_user "ERROR: MariaDB Columnstore System logging not setup\n" ; exit 1 } - "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } @@ -91,96 +89,93 @@ expect { } send_user "\n" +# +# remove MariaDB Columnstore files +# +send_user "Uninstall MariaDB Columnstore Package " +send " \n" +send date\n +send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/pre-uninstall --installdir=$INSTALLDIR >/dev/null 2>&1'\n" +set timeout 30 +expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } +} +set timeout 20 +expect { + "Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit 1} + "service not known" { send_user "FAILED: Invalid Host\n" ; exit 1} + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + "MariaDB Columnstore uninstall completed" { send_user "DONE" } + "Exit status 0" { send_user "DONE" } +} +send_user "\n" -if { $INSTALLTYPE == "initial" || $INSTALLTYPE == "uninstall" } { - # - # remove MariaDB Columnstore files - # - send_user "Uninstall MariaDB Columnstore Package " - send " \n" - send date\n - send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/pre-uninstall --installdir=$INSTALLDIR >/dev/null 2>&1'\n" - set timeout 10 - expect { - "word: " { send "$PASSWORD\n" } - "passphrase" { send "$PASSWORD\n" } - } - set timeout 20 - expect { - "Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit 1} - "service not known" { send_user "FAILED: Invalid Host\n" ; exit 1} - "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } - "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } - "MariaDB Columnstore uninstall completed" { send_user "DONE" } - "Exit status 0" { send_user "DONE" } - } - send_user "\n" +if { $INSTALLTYPE == "uninstall" } { exit 0 } + +# needed for some reason, if not here the 'columnstore start' will run before the package is installed +sleep 60 + +# +# send the MariaDB Columnstore package +# +send_user "Copy New MariaDB Columnstore Package to Module " +send " \n" +send date\n +send "scp -v $CALPONTPKG $USERNAME@$SERVER:$CALPONTPKG\n" +set timeout 30 +expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } +} +set timeout 120 +expect { + "Exit status 0" { send_user "DONE" } + "100%" { send_user "DONE" } + "scp :" { send_user "ERROR\n" ; + send_user "\n*** Installation ERROR\n" ; + exit 1 } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "No such file or directory" { send_user "ERROR: Invalid package\n" ; exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "ERROR: Timeout\n" ; exit 1 } +} +send_user "\n" +# +# install package +# +send_user "Install MariaDB Columnstore Package on Module " +send " \n" +send date\n +send "ssh -v $USERNAME@$SERVER 'tar -C $PREFIX --exclude db -zxf $CALPONTPKG'\n" +set timeout 30 +expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } +} +set timeout 120 +expect { + "Exit status 0" { send_user "DONE" } + "No such file" { send_user "ERROR: Binary Install Failed, binary/releasenum not found\n" ; exit 1 } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "ERROR: Timeout\n" ; exit 1 } } -if { $INSTALLTYPE == "uninstall" } { - exit 0 -} - -if { $INSTALLTYPE == "initial" } { - # - # send the MariaDB Columnstore package - # - send_user "Copy New MariaDB Columnstore Package to Module " - send " \n" - send date\n - send "scp -v $CALPONTPKG $USERNAME@$SERVER:$CALPONTPKG\n" - set timeout 10 - expect { - "word: " { send "$PASSWORD\n" } - "passphrase" { send "$PASSWORD\n" } - } - set timeout 120 - expect { - "Exit status 0" { send_user "DONE" } - "100%" { send_user "DONE" } - "scp :" { send_user "ERROR\n" ; - send_user "\n*** Installation ERROR\n" ; - exit 1 } - "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } - "No such file or directory" { send_user "ERROR: Invalid package\n" ; exit 1 } - "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} - "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } - "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } - "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } - timeout { send_user "ERROR: Timeout\n" ; exit 1 } - } - send_user "\n" - # - # install package - # - send_user "Install MariaDB Columnstore Package on Module " - send " \n" - send date\n - send "ssh -v $USERNAME@$SERVER 'tar -C $PREFIX --exclude db -zxf $CALPONTPKG'\n" - set timeout 10 - expect { - "word: " { send "$PASSWORD\n" } - "passphrase" { send "$PASSWORD\n" } - } - set timeout 120 - expect { - "Exit status 0" { send_user "DONE" } - "No such file" { send_user "ERROR: Binary Install Failed, binary/releasenum not found\n" ; exit 1 } - "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } - "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} - "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } - "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } - "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } - timeout { send_user "ERROR: Timeout\n" ; exit 1 } - } -} send_user "\n" send_user "Run post-install script " send " \n" send date\n send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/post-install --installdir=$INSTALLDIR'\n" -set timeout 10 +set timeout 30 expect { "word: " { send "$PASSWORD\n" } "passphrase" { send "$PASSWORD\n" } @@ -197,13 +192,16 @@ expect { "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } "columnstore start" { send_user "DONE" } } - send_user "\n" + +# needed for some reason, if not here the 'columnstore start' will run before the package is installed +sleep 30 + send_user "Start ColumnStore service " send " \n" send date\n send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore restart'\n" -set timeout 10 +set timeout 30 expect { "word: " { send "$PASSWORD\n" } "passphrase" { send "$PASSWORD\n" } @@ -231,7 +229,7 @@ if { $AMAZONINSTALL == "1" } { send " \n" send date\n send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" - set timeout 10 + set timeout 30 expect { "word: " { send "$PASSWORD\n" } "passphrase" { send "$PASSWORD\n" } diff --git a/oam/install_scripts/package_installer.sh b/oam/install_scripts/package_installer.sh new file mode 100644 index 000000000..676377556 --- /dev/null +++ b/oam/install_scripts/package_installer.sh @@ -0,0 +1,266 @@ +#!/usr/bin/expect +# +# $Id: package_installer.sh 1128 2009-01-05 16:36:59Z rdempsey $ +# +# Install RPM and custom OS files on system +# Argument 1 - Remote Module Name +# Argument 2 - Remote Server Host Name or IP address +# Argument 3 - Root Password of remote server +# Argument 4 - Package name being installed +# Argument 5 - Install Type, "initial" or "upgrade" +# Argument 6 - Debug flag 1 for on, 0 for off +set timeout 30 +set USERNAME root +set MODULE [lindex $argv 0] +set SERVER [lindex $argv 1] +set PASSWORD [lindex $argv 2] +set VERSION [lindex $argv 3] +set INSTALLTYPE [lindex $argv 4] +set AMAZONINSTALL [lindex $argv 5] +set PKGTYPE [lindex $argv 6] +set NODEPS [lindex $argv 7] +set DEBUG [lindex $argv 8] +set INSTALLDIR "/usr/local/mariadb/columnstore" +set IDIR [lindex $argv 9] +if { $IDIR != "" } { + set INSTALLDIR $IDIR +} +set USERNAME "root" +set UNM [lindex $argv 10] +if { $UNM != "" } { + set USERNAME $UNM +} + +set BASH "/bin/bash " +#if { $DEBUG == "1" } { +# set BASH "/bin/bash -x " +#} + +set HOME "$env(HOME)" + +log_user $DEBUG +spawn -noecho /bin/bash +# +if { $PKGTYPE == "rpm" } { + set PKGERASE "rpm -e --nodeps \$(rpm -qa | grep '^mariadb-columnstore')" + set PKGERASE1 "rpm -e --nodeps " + + set PKGINSTALL "rpm -ivh $NODEPS --force mariadb-columnstore*$VERSION*rpm" + set PKGUPGRADE "rpm -Uvh --noscripts mariadb-columnstore*$VERSION*rpm" +} else { + if { $PKGTYPE == "deb" } { + set PKGERASE "dpkg -P \$(dpkg --get-selections | grep '^mariadb-columnstore')" + set PKGERASE1 "dpkg -P " + set PKGINSTALL "dpkg -i --force-confnew mariadb-columnstore*$VERSION*deb" + set PKGUPGRADE "dpkg -i --force-confnew mariadb-columnstore*$VERSION*deb" + } else { + if { $PKGTYPE != "bin" } { + send_user "Invalid Package Type of $PKGTYPE" + exit 1 + } + } +} + +# check and see if remote server has ssh keys setup, set PASSWORD if so +send_user " " +send "ssh -v $USERNAME@$SERVER 'time'\n" +set timeout 20 +expect { + "Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit 1 } + "service not known" { send_user "FAILED: Invalid Host\n" ; exit 1 } + "authenticity" { send "yes\n" + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } + } + "sys" { set PASSWORD "ssh" } + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "ERROR: Timeout to host\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } +} + +send_user "\n" + +send_user "Stop ColumnStore service " +send date\n +send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore stop'\n" +set timeout 30 +expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } +} +set timeout 60 +# check return +expect { + "Exit status 0" { send_user "DONE" } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "TIMEOUT: Continue" } +} +send_user "\n" + +# needed for some reason, if not here the 'columnstore start' will run before the package is installed +sleep 60 + +# +# erase package +# +send_user "Erase MariaDB Columnstore Packages on Module " +send "ssh -v $USERNAME@$SERVER '$PKGERASE '\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 120 +expect { + "error: --purge needs at least one package" { send_user "DONE" } + "error: Failed dependencies" { send_user "ERROR: Failed dependencies\n" ; exit 1 } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } + timeout { send_user "TIMEOUT: Continue" } +} +send_user "\n" + +if { $INSTALLTYPE == "uninstall" } { exit 0 } + +# +# send the package +# +send_user "Copy New MariaDB Columnstore Package to Module " +send "ssh -v $USERNAME@$SERVER 'rm -f /root/mariadb-columnstore-*.$PKGTYPE'\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 30 +expect { + "Exit status 0" { send_user "DONE" } + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "TIMEOUT: Continue" } +} +send_user "\n" + +send "scp -v $HOME/mariadb-columnstore*$VERSION*$PKGTYPE $USERNAME@$SERVER:.\n" +if { $PASSWORD != "ssh"} { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 180 +expect { + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } + "Exit status 1" { send_user "ERROR: scp failed" ; exit 1 } + timeout { send_user "TIMEOUT: Continue" } +} +send_user "\n" + +# +# install package +# +send_user "Install MariaDB Columnstore Packages on Module " + +send "ssh -v $USERNAME@$SERVER '$PKGINSTALL '\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 180 +expect { + "error: Failed dependencies" { send_user "ERROR: Failed dependencies\n" ; + send_user "\n*** Installation ERROR\n" ; + exit 1 } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "needs" { send_user "ERROR: disk space issue\n" ; exit 1 } + "conflicts" { send_user "ERROR: File Conflict issue\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } + "Exit status 1" { send_user "ERROR: install failed" ; exit 1 } + timeout { send_user "TIMEOUT: Continue" } +} + +send_user "\n" + +# needed for some reason, if not here the 'columnstore start' will run before the package is installed +sleep 30 + +send_user "Start ColumnStore service " +send " \n" +send date\n +send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore restart'\n" +set timeout 10 +expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } +} +set timeout 60 +# check return +expect { + "Exit status 0" { send_user "DONE" } + "No such file" { send_user "ERROR: $INSTALLDIR/bin/columnstore Not Found\n" ; exit 1 } + "MariaDB Columnstore syslog logging not working" { send_user "ERROR: MariaDB Columnstore System logging not setup\n" ; exit 1 } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + "Starting MariaDB" { send_user "DONE" } + timeout { send_user "TIMEOUT: Continue" } +} +send_user "\n" + +if { $AMAZONINSTALL == "1" } { + # + # copy over customer OS files + # + send_user "Copy MariaDB Columnstore OS files to Module " + send " \n" + send date\n + send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" + set timeout 10 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + } + set timeout 60 + expect { + "Exit status 0" { send_user "DONE" } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + timeout { send_user "TIMEOUT: Continue" } + } +} +send_user "\n" + + +send_user "\nInstallation Successfully Completed on '$MODULE'\n" +exit 0 + diff --git a/oamapps/postConfigure/installer.cpp b/oamapps/postConfigure/installer.cpp index 208b9a592..831fccefe 100644 --- a/oamapps/postConfigure/installer.cpp +++ b/oamapps/postConfigure/installer.cpp @@ -555,10 +555,10 @@ int main(int argc, char *argv[]) temppwprompt = "none"; cout << endl << "----- Performing Uninstall on Module '" + remoteModuleName + "' -----" << endl << endl; - cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + temppwprompt + " " + installer_debug; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + temppwprompt + " " + installer_debug; int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "ERROR: returned from user_installer.sh" << endl; + cout << endl << "ERROR: returned from package_installer.sh" << endl; exit(1); } } @@ -581,10 +581,10 @@ int main(int argc, char *argv[]) if ( packageType != "binary" ) { //run remote installer script cout << endl << "----- Performing Uninstall on Module '" + remoteModuleName + "' -----" << endl << endl; - cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + installer_debug; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + installer_debug; int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "ERROR returned from performance_installer.sh" << endl; + cout << endl << "ERROR returned from package_installer.sh" << endl; exit(1); } } @@ -649,10 +649,10 @@ int main(int argc, char *argv[]) temppwprompt = "none"; cout << endl << "----- Performing Install on Module '" + remoteModuleName + "' -----" << endl << endl; - cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + temppwprompt + " " + installer_debug; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + temppwprompt + " " + installer_debug; int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "ERROR returned from user_installer.sh" << endl; + cout << endl << "ERROR returned from package_installer.sh" << endl; exit(1); } } @@ -675,10 +675,10 @@ int main(int argc, char *argv[]) //run remote installer script if ( packageType != "binary" ) { cout << endl << "----- Performing Install on Module '" + remoteModuleName + "' -----" << endl << endl; - cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + installer_debug; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpont_rpm1 + " " + calpont_rpm2 + " " + calpont_rpm3 + " " + mysql_rpm + " " + mysqld_rpm + " " + installType + " " + packageType + " " + nodeps + " " + installer_debug; int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "ERROR returned from performance_installer.sh" << endl; + cout << endl << "ERROR returned from package_installer.sh" << endl; exit(1); } } diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index d641b1c4d..0012a20d8 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -2938,7 +2938,7 @@ int main(int argc, char *argv[]) temppwprompt = "none"; //run remote installer script - cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile; if ( thread_remote_installer ) { thr_data[thread_id].command = cmd; @@ -2956,7 +2956,7 @@ int main(int argc, char *argv[]) { int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "Error returned from user_installer.sh" << endl; + cout << endl << "Error returned from package_installer.sh" << endl; exit(1); } @@ -3065,7 +3065,7 @@ int main(int argc, char *argv[]) { int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "Error returned from user_installer.sh" << endl; + cout << endl << "Error returned from package_installer.sh" << endl; exit(1); } } @@ -3083,7 +3083,7 @@ int main(int argc, char *argv[]) if ( EEPackageType != "binary" ) { //run remote installer script - cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile; + cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile; if ( thread_remote_installer ) { thr_data[thread_id].command = cmd; @@ -3102,7 +3102,7 @@ int main(int argc, char *argv[]) { int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "Error returned from performance_installer.sh" << endl; + cout << endl << "Error returned from package_installer.sh" << endl; exit(1); } } @@ -3134,7 +3134,7 @@ int main(int argc, char *argv[]) { int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) != 0) { - cout << endl << "Error returned from user_installer.sh" << endl; + cout << endl << "Error returned from package_installer.sh" << endl; exit(1); } } diff --git a/procmgr/main.cpp b/procmgr/main.cpp index 228980f43..2d03626bf 100644 --- a/procmgr/main.cpp +++ b/procmgr/main.cpp @@ -563,32 +563,29 @@ static void startMgrProcessThread() log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR); } - //if non-distrubuted install, send out a start service just to make sure Columnstore is runing on remote nodes + //Send out a start service just to make sure Columnstore is runing on remote nodes //note this only works for systems with ssh-keys - if ( DistributedInstall == "n" ) + for( unsigned int i = 0 ; i < systemmoduletypeconfig.moduletypeconfig.size(); i++) { - for( unsigned int i = 0 ; i < systemmoduletypeconfig.moduletypeconfig.size(); i++) - { - int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount; - if( moduleCount == 0) + int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount; + if( moduleCount == 0) + continue; + + DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin(); + for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++) + { + //skip OAM Parent module + if ( (*pt).DeviceName == config.moduleName() ) continue; - DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin(); - for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++) + HostConfigList::iterator pt1 = (*pt).hostConfigList.begin(); + for( ; pt1 != (*pt).hostConfigList.end() ; pt1++) { - //skip OAM Parent module - if ( (*pt).DeviceName == config.moduleName() ) - continue; - - HostConfigList::iterator pt1 = (*pt).hostConfigList.begin(); - for( ; pt1 != (*pt).hostConfigList.end() ; pt1++) - { - //run remote command script - string cmd = startup::StartUp::installDir() + "/bin/remote_command.sh " + (*pt1).IPAddr + " ssh '" + startup::StartUp::installDir() + "/bin/columnstore restart' 0"; - system(cmd.c_str()); - } + //run remote command script + string cmd = startup::StartUp::installDir() + "/bin/remote_command.sh " + (*pt1).IPAddr + " ssh '" + startup::StartUp::installDir() + "/bin/columnstore restart' 0"; + system(cmd.c_str()); } - } + } } //distribute system and process config files @@ -599,7 +596,7 @@ static void startMgrProcessThread() { int status = API_SUCCESS; int k = 0; - for( ; k < 30 ; k++ ) + for( ; k < 60 ; k++ ) { if ( startsystemthreadStop ) { processManager.setSystemState(oam::MAN_OFFLINE); @@ -643,7 +640,7 @@ static void startMgrProcessThread() sleep(1); } - if ( k == 30 || status == API_FAILURE) { + if ( k == 60 || status == API_FAILURE) { // system didn't successfull restart processManager.setSystemState(oam::FAILED); // exit thread diff --git a/procmgr/processmanager.cpp b/procmgr/processmanager.cpp index 95eeeef40..6274ae3b5 100644 --- a/procmgr/processmanager.cpp +++ b/procmgr/processmanager.cpp @@ -5088,7 +5088,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str string logFile = "/tmp/" + remoteModuleName + "_user_installer.log"; log.writeLog(__LINE__, "addModule - user_installer run for " + remoteModuleName, LOG_TYPE_DEBUG); - string cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + packageType + " --nodeps 1 > " + logFile; + string cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + packageType + " --nodeps 1 > " + logFile; log.writeLog(__LINE__, "addModule cmd: " + cmd, LOG_TYPE_DEBUG); @@ -5181,7 +5181,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str if ( packageType != "binary" ) { string logFile = "/tmp/" + remoteModuleName + "_performance_installer.log"; log.writeLog(__LINE__, "addModule - performance_installer run for " + remoteModuleName, LOG_TYPE_DEBUG); - string cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + packageType + + " --nodeps 1 > " + logFile; + string cmd = installDir + "/bin/package_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + AmazonInstall + " " + packageType + + " --nodeps 1 > " + logFile; log.writeLog(__LINE__, "addModule cmd: " + cmd, LOG_TYPE_DEBUG); bool passed = false;