From 3bb347679a64fc18eaa7470df354c76d3bc4a33f Mon Sep 17 00:00:00 2001 From: david hill Date: Wed, 5 Jul 2017 06:44:20 -0500 Subject: [PATCH] MCOL-715 - fixed um storage type setup --- oam/cloud/MCSInstanceCmds.sh | 11 +++++--- oam/cloud/MCSVolumeCmds.sh | 36 ++++++++++++++----------- oam/install_scripts/module_installer.sh | 1 + oam/install_scripts/post-install | 4 +-- oamapps/postConfigure/postConfigure.cpp | 8 +++--- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/oam/cloud/MCSInstanceCmds.sh b/oam/cloud/MCSInstanceCmds.sh index fbd0b6f31..32e674f90 100755 --- a/oam/cloud/MCSInstanceCmds.sh +++ b/oam/cloud/MCSInstanceCmds.sh @@ -4,7 +4,12 @@ # # 1. Amazon EC2 -prefix=/usr/local +if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then + COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore +fi + +export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR + #check command if [ "$1" = "" ]; then @@ -87,9 +92,9 @@ if [ "$1" = "deassignElasticIP" ]; then fi -$prefix/mariadb/columnstore/bin/MCSgetCredentials.sh >/dev/null 2>&1 +$COLUMNSTORE_INSTALL_DIR/bin/MCSgetCredentials.sh >/dev/null 2>&1 -test -f $prefix//mariadb/columnstore/post/functions && . $prefix//mariadb/columnstore/post/functions +test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions #default instance to null instance="" diff --git a/oam/cloud/MCSVolumeCmds.sh b/oam/cloud/MCSVolumeCmds.sh index cb87ae039..ff9b1681a 100755 --- a/oam/cloud/MCSVolumeCmds.sh +++ b/oam/cloud/MCSVolumeCmds.sh @@ -4,7 +4,11 @@ # # 1. Amazon EC2 -prefix=/usr/local +if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then + COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore +fi + +export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR #check command if [ "$1" = "" ]; then @@ -93,14 +97,14 @@ if [ "$1" = "createTag" ]; then fi -test -f $prefix/mariadb/columnstore/post/functions && . $prefix/mariadb/columnstore/post/functions +test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions AWSCLI="aws ec2 " -$prefix/mariadb/columnstore/bin/MCSgetCredentials.sh >/dev/null 2>&1 +$COLUMNSTORE_INSTALL_DIR/MCSgetCredentials.sh >/dev/null 2>&1 #get Region -Region=`$prefix/mariadb/columnstore/bin/MCSInstanceCmds.sh getRegion` +Region=`$COLUMNSTORE_INSTALL_DIR/bin/MCSInstanceCmds.sh getRegion` checkInfostatus() { #check if attached @@ -153,21 +157,21 @@ checkInfostatus() { createvolume() { # get zone - zone=`$prefix/mariadb/columnstore/bin/MCSInstanceCmds.sh getZone` + zone=`$COLUMNSTORE_INSTALL_DIR/bin/MCSInstanceCmds.sh getZone` if [ $moduleType == "um" ]; then # get type - volumeType=`$prefix/mariadb/columnstore/bin/getConfig Installation UMVolumeType` + volumeType=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMVolumeType` if [ $volumeType == "io1" ]; then # get IOPS - volumeIOPS=`$prefix/mariadb/columnstore/bin/getConfig Installation UMVolumeIOPS` + volumeIOPS=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMVolumeIOPS` fi else # pm # get type - volumeType=`$prefix/mariadb/columnstore/bin/getConfig Installation PMVolumeType` + volumeType=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMVolumeType` if [ $volumeType == "io1" ]; then # get IOPS - volumeIOPS=`$prefix/mariadb/columnstore/bin/getConfig Installation PMVolumeIOPS` + volumeIOPS=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation PMVolumeIOPS` fi fi @@ -211,7 +215,7 @@ detachvolume() { sleep 1 done test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions - $prefix/mariadb/columnstore/bin/cplogger -w 100 "detachvolume failed: $STATUS" + $COLUMNSTORE_INSTALL_DIR/bin/cplogger -w 100 "detachvolume failed: $STATUS" echo "failed" exit 1 fi @@ -221,8 +225,8 @@ detachvolume() { exit 0 fi - test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions - $prefix/mariadb/columnstore/bin/cplogger -w 100 "detachvolume failed status: $STATUS" + test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions + $COLUMNSTORE_INSTALL_DIR/bin/cplogger -w 100 "detachvolume failed status: $STATUS" echo $STATUS exit 1 } @@ -245,8 +249,8 @@ attachvolume() { ((retries++)) sleep 1 done - test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions - $prefix/mariadb/columnstore/bin/cplogger -w 100 "attachvolume failed: $STATUS" + test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions + $COLUMNSTORE_INSTALL_DIR/bin/cplogger -w 100 "attachvolume failed: $STATUS" echo "failed" exit 1 fi @@ -256,8 +260,8 @@ attachvolume() { exit 0 fi - test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions - $prefix/mariadb/columnstore/bin/cplogger -w 100 "attachvolume failed: $STATUS" + test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/post/functions + $COLUMNSTORE_INSTALL_DIR/bin/cplogger -w 100 "attachvolume failed: $STATUS" echo $STATUS exit 1 } diff --git a/oam/install_scripts/module_installer.sh b/oam/install_scripts/module_installer.sh index fcc80ab8c..5822c4082 100755 --- a/oam/install_scripts/module_installer.sh +++ b/oam/install_scripts/module_installer.sh @@ -69,6 +69,7 @@ if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then cat $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab else sudo touch /etc/fstab + sudo chmod 666 /etc/fstab sudo rm -f /etc/fstab.columnstoreSave sudo cp /etc/fstab /etc/fstab.columnstoreSave sudo cat $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab >> /etc/fstab diff --git a/oam/install_scripts/post-install b/oam/install_scripts/post-install index c9a3d707f..bb8edf5c8 100755 --- a/oam/install_scripts/post-install +++ b/oam/install_scripts/post-install @@ -229,12 +229,12 @@ else $SUDO mkdir /var/lock/subsys > /dev/null 2>&1 $SUDO chmod 777 /var/lock/subsys > /dev/null 2>&1 $SUDO rm -f /var/lock/subsys/mysql-Columnstore - $SUDO chmod 644 /etc/fstab + $SUDO chmod 666 /etc/fstab fi # install Columnstore Log Rotate File $SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1 -$SUDO chmod 644 /etc/logrotate.d/columnstore +$SUDO chmod 666 /etc/logrotate.d/columnstore #check if MariaDB Columnstore system logging was setup cat /tmp/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1 diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index f96f210e0..66bffa5e6 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -4213,7 +4213,7 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( UMVolumeType.empty() || UMVolumeType == "") + if ( UMVolumeType.empty() || UMVolumeType == "" || UMVolumeType == oam::UnassignedName) UMVolumeType = "gp2"; while(true) @@ -4311,7 +4311,7 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( UMVolumeIOPS.empty() || UMVolumeIOPS == "") + if ( UMVolumeIOPS.empty() || UMVolumeIOPS == "" || UMVolumeIOPS == oam::UnassignedName) UMVolumeIOPS = maxIOPS; while(true) @@ -4556,7 +4556,7 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( PMVolumeType.empty() || PMVolumeType == "") + if ( PMVolumeType.empty() || PMVolumeType == "" || PMVolumeType == oam::UnassignedName) PMVolumeType = "gp2"; while(true) @@ -4739,7 +4739,7 @@ bool storageSetup(bool amazonInstall) DataFileEnvFile = "setenv-hdfs-20"; } - if (DataFileEnvFile.empty() || DataFileEnvFile == "") + if (DataFileEnvFile.empty() || DataFileEnvFile == "" || DataFileEnvFile == oam::UnassignedName) DataFileEnvFile = "setenv-hdfs-20"; cout << endl;