diff --git a/CMakeLists.txt b/CMakeLists.txt index cab7bd282..aefcc420a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,6 +407,7 @@ IF (INSTALL_LAYOUT) SETA(CPACK_RPM_columnstore-platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "MariaDB-columnstore-libs" "snappy" "jemalloc" "net-tools" PARENT_SCOPE) endif() + SET(CPACK_RPM_columnstore-platform_PRE_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preInstall_platform.sh PARENT_SCOPE) SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/postInstall_platform.sh PARENT_SCOPE) SET(CPACK_RPM_columnstore-platform_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preUn_platform.sh PARENT_SCOPE) diff --git a/build/preInstall_platform.sh b/build/preInstall_platform.sh new file mode 100644 index 000000000..baa626d93 --- /dev/null +++ b/build/preInstall_platform.sh @@ -0,0 +1,7 @@ + +if [ "$1" == "2" ]; then + #Perform tasks to prepare for the upgrade installation + mcsadmin shutdown y > /dev/null 2>&1 + columnstore-pre-uninstall +fi +exit 0 diff --git a/cmake/cpackEngineRPM.cmake b/cmake/cpackEngineRPM.cmake index 717f752f0..0d361718e 100644 --- a/cmake/cpackEngineRPM.cmake +++ b/cmake/cpackEngineRPM.cmake @@ -98,6 +98,7 @@ endif() SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-libs") +SET(CPACK_RPM_columnstore-platform_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_platform.sh) SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_platform.sh) SET(CPACK_RPM_columnstore-libs_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_libs.sh) SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh) diff --git a/oam/install_scripts/columnstore-post-install.in b/oam/install_scripts/columnstore-post-install.in index c0384295f..5cb22c35e 100755 --- a/oam/install_scripts/columnstore-post-install.in +++ b/oam/install_scripts/columnstore-post-install.in @@ -31,6 +31,11 @@ if [ ! -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml ]; then exit 1 fi +if [ -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave ]; then + /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.new + /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf +fi + touch /dev/shm/columnstore-test && rm /dev/shm/columnstore-test if [ $? -ne 0 ] ; then echo "User $user will need R/W access to /dev/shm." diff --git a/oam/install_scripts/columnstore-pre-uninstall.in b/oam/install_scripts/columnstore-pre-uninstall.in index 41896c937..070633a41 100755 --- a/oam/install_scripts/columnstore-pre-uninstall.in +++ b/oam/install_scripts/columnstore-pre-uninstall.in @@ -94,6 +94,7 @@ fi if [ $quiet != 1 ]; then #make copy of Columnstore.xml /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1 + /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave > /dev/null 2>&1 /bin/cp -f @MARIADB_MYCNFDIR@/columnstore.cnf @MARIADB_MYCNFDIR@/columnstore.cnf.rpmsave > /dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/myCnf-include-args.text @ENGINE_SUPPORTDIR@/myCnf-include-args.text.rpmsave >& /dev/null rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave diff --git a/oamapps/mcsadmin/mcsadmin.cpp b/oamapps/mcsadmin/mcsadmin.cpp index e2970769e..c2a13ab0f 100644 --- a/oamapps/mcsadmin/mcsadmin.cpp +++ b/oamapps/mcsadmin/mcsadmin.cpp @@ -2781,7 +2781,7 @@ int processCommand(string* arguments) if ( DBRootStorageType == "hdfs") { string logFile = tmpDir + "/cc-restart.pdsh"; - cmd = "pdsh -a 'columnstore restart' > " + logFile + " 2>&1"; + cmd = "pdsh -a 'columnstore start' > " + logFile + " 2>&1"; system(cmd.c_str()); if (oam.checkLogStatus(logFile, "exit") ) @@ -2818,12 +2818,12 @@ int processCommand(string* arguments) if ( modulename == localModule ) { - cmd = "columnstore restart > " + tmpDir + "/start.log 2>&1"; + cmd = "columnstore start > " + tmpDir + "/startSystem.log 2>&1"; int rtnCode = system(cmd.c_str()); if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0) { - cout << endl << "error with running 'columnstore restart' on local module " << endl; + cout << endl << "error with running 'columnstore start' on local module " << endl; cout << endl << "**** startSystem Failed" << endl; break; } @@ -2836,7 +2836,7 @@ int processCommand(string* arguments) for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++) { //run remote command script - cmd = "remote_command.sh " + (*pt1).IPAddr + " " + password + " 'columnstore restart' 0"; + cmd = "remote_command.sh " + (*pt1).IPAddr + " " + password + " 'columnstore start' 0"; int rtnCode = system(cmd.c_str()); if (WEXITSTATUS(rtnCode) < 0) @@ -2885,7 +2885,7 @@ int processCommand(string* arguments) //just kick off local server cout << endl << " System being started, please wait..."; cout.flush(); - cmd = "columnstore restart > " + tmpDir + "/start.log 2>&1"; + cmd = "columnstore start > " + tmpDir + "/startSystem.log 2>&1"; int rtnCode = system(cmd.c_str()); if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0)