ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: AMBARI-19601: Warnings on ambari server upgrade related to HDF paths (jluniya)
Date Fri, 20 Jan 2017 02:00:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 ccd10f675 -> 9dc0e75e0


AMBARI-19601: Warnings on ambari server upgrade related to HDF paths (jluniya)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9dc0e75e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9dc0e75e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9dc0e75e

Branch: refs/heads/branch-2.5
Commit: 9dc0e75e0f3886730e2d64b855d37dc459c13642
Parents: ccd10f6
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Thu Jan 19 17:52:21 2017 -0800
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Thu Jan 19 18:00:07 2017 -0800

----------------------------------------------------------------------
 .../src/main/package/deb/control/preinst        | 46 ++++++++++++++++++++
 .../src/main/package/rpm/preinstall.sh          | 46 ++++++++++++++++++++
 2 files changed, 92 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc0e75e/ambari-server/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/deb/control/preinst b/ambari-server/src/main/package/deb/control/preinst
index 34af1c8..080e592 100644
--- a/ambari-server/src/main/package/deb/control/preinst
+++ b/ambari-server/src/main/package/deb/control/preinst
@@ -22,6 +22,9 @@ STACKS_FOLDER_OLD=${ROOT}/var/lib/ambari-server/resources/stacks_$(date
'+%d_%m_
 COMMON_SERVICES_FOLDER="${ROOT}/var/lib/ambari-server/resources/common-services"
 COMMON_SERVICES_FOLDER_OLD=${ROOT}/var/lib/ambari-server/resources/common-services_$(date
'+%d_%m_%y_%H_%M').old
 
+MPACKS_FOLDER="${ROOT}/var/lib/ambari-server/resources/mpacks"
+MPACKS_FOLDER_OLD=${ROOT}/var/lib/ambari-server/resources/mpacks_$(date '+%d_%m_%y_%H_%M').old
+
 AMBARI_PROPERTIES="${ROOT}/etc/ambari-server/conf/ambari.properties"
 AMBARI_PROPERTIES_OLD="$AMBARI_PROPERTIES.rpmsave"
 
@@ -41,34 +44,75 @@ SERVER_CONF_SAVE_BACKUP="${ROOT}/etc/ambari-server/conf_$(date '+%d_%m_%y_%H_%M'
 
 if [ -d "$SERVER_CONF_SAVE" ]
 then
+    echo "Backing up configs $SERVER_CONF_SAVE -> $SERVER_CONF_SAVE_BACKUP"
     mv "$SERVER_CONF_SAVE" "$SERVER_CONF_SAVE_BACKUP"
 fi
 
 if [ -f "$AMBARI_PROPERTIES" ]
 then
+    echo "Backing up Ambari properties $AMBARI_PROPERTIES -> $AMBARI_PROPERTIES_OLD"
     mv -f "$AMBARI_PROPERTIES" "$AMBARI_PROPERTIES_OLD"
 fi
 
 if [ -f "$AMBARI_ENV" ]
 then
+    echo "Backing up Ambari properties $AMBARI_ENV -> $AMBARI_ENV_OLD"
     mv -f "$AMBARI_ENV" "$AMBARI_ENV_OLD"
 fi
 
 if [ -f "$AMBARI_KRB_JAAS_LOGIN_FILE" ]
 then
+    echo "Backing up JAAS login file $AMBARI_KRB_JAAS_LOGIN_FILE -> $AMBARI_KRB_JAAS_LOGIN_FILE_OLD"
     mv -f "$AMBARI_KRB_JAAS_LOGIN_FILE" "$AMBARI_KRB_JAAS_LOGIN_FILE_OLD"
 fi
 
 if [ -d "$STACKS_FOLDER" ]
 then
+    echo "Backing up stacks directory $STACKS_FOLDER -> $STACKS_FOLDER_OLD"
     mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
 fi
 
 if [ -d "$COMMON_SERVICES_FOLDER" ]
 then
+    echo "Backing up common-services directory $COMMON_SERVICES_FOLDER -> $COMMON_SERVICES_FOLDER_OLD"
     mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
 fi
 
+if [ -d "$MPACKS_FOLDER" ]
+then
+    # Make a copy of mpacks folder
+    if [ ! -d "$MPACKS_FOLDER_OLD" ]; then
+        echo "Backing up mpacks directory $MPACKS_FOLDER -> $MPACKS_FOLDER_OLD"
+        cp -R "$MPACKS_FOLDER" "$MPACKS_FOLDER_OLD"
+    fi
+
+    # Update symlinks in $STACKS_FOLDER_OLD to point to $MPACKS_FOLDER_OLD
+    if [ -d "$STACKS_FOLDER_OLD" ]; then
+        for link in $(find "$STACKS_FOLDER_OLD" -type l)
+        do
+            target=`readlink $link`
+            if grep -q "$MPACKS_FOLDER/"<<<$target; then
+                new_target="${target/$MPACKS_FOLDER/$MPACKS_FOLDER_OLD}"
+                echo "Updating symlink $link -> $new_target"
+                ln -snf $new_target $link
+            fi
+        done
+    fi
+
+    # Update symlinks in $COMMON_SERVICES_FOLDER_OLD to point to $MPACKS_FOLDER_OLD
+    if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]; then
+    for link in $(find "$COMMON_SERVICES_FOLDER_OLD" -type l)
+        do
+            target=`readlink $link`
+            if grep -q "$MPACKS_FOLDER/"<<<$target; then
+                new_target="${target/$MPACKS_FOLDER/$MPACKS_FOLDER_OLD}"
+                echo "Updating symlink $link -> $new_target"
+                ln -snf $new_target $link
+            fi
+        done
+    fi
+fi
+
 if [ ! -d "$AMBARI_VIEWS_BACKUP_FOLDER" ] && [ -d "$AMBARI_VIEWS_FOLDER" ]
 then
     mkdir "$AMBARI_VIEWS_BACKUP_FOLDER"
@@ -76,6 +120,7 @@ fi
 
 if [ -d "$AMBARI_VIEWS_FOLDER" ] && [ -d "$AMBARI_VIEWS_BACKUP_FOLDER" ]
 then
+    echo "Backing up Ambari view jars $AMBARI_VIEWS_FOLDER/*.jar -> $AMBARI_VIEWS_BACKUP_FOLDER/"
     cp -u $AMBARI_VIEWS_FOLDER/*.jar $AMBARI_VIEWS_BACKUP_FOLDER/
 fi
 
@@ -87,6 +132,7 @@ do
         then
             mkdir -p "$AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER"
         fi
+        echo "Backing up Ambari server jar $f -> $AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER/"
         mv -f $f $AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER/
     fi
 done

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc0e75e/ambari-server/src/main/package/rpm/preinstall.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/rpm/preinstall.sh b/ambari-server/src/main/package/rpm/preinstall.sh
index 7977ab8..629d9cf 100644
--- a/ambari-server/src/main/package/rpm/preinstall.sh
+++ b/ambari-server/src/main/package/rpm/preinstall.sh
@@ -21,6 +21,9 @@ STACKS_FOLDER_OLD="${ROOT}/var/lib/ambari-server/resources/stacks_$(date
'+%d_%m
 COMMON_SERVICES_FOLDER=${ROOT}"/var/lib/ambari-server/resources/common-services"
 COMMON_SERVICES_FOLDER_OLD="${ROOT}/var/lib/ambari-server/resources/common-services_$(date
'+%d_%m_%y_%H_%M').old"
 
+MPACKS_FOLDER="${ROOT}/var/lib/ambari-server/resources/mpacks"
+MPACKS_FOLDER_OLD=${ROOT}/var/lib/ambari-server/resources/mpacks_$(date '+%d_%m_%y_%H_%M').old
+
 AMBARI_PROPERTIES="${ROOT}/etc/ambari-server/conf/ambari.properties"
 AMBARI_PROPERTIES_OLD="$AMBARI_PROPERTIES.rpmsave"
 
@@ -40,34 +43,75 @@ SERVER_CONF_SAVE_BACKUP="${ROOT}/etc/ambari-server/conf_$(date '+%d_%m_%y_%H_%M'
 
 if [ -d "$SERVER_CONF_SAVE" ]
 then
+    echo "Backing up configs $SERVER_CONF_SAVE -> $SERVER_CONF_SAVE_BACKUP"
     mv "$SERVER_CONF_SAVE" "$SERVER_CONF_SAVE_BACKUP"
 fi
 
 if [ -f "$AMBARI_PROPERTIES" ]
 then
+    echo "Backing up Ambari properties $AMBARI_PROPERTIES -> $AMBARI_PROPERTIES_OLD"
     cp -n "$AMBARI_PROPERTIES" "$AMBARI_PROPERTIES_OLD"
 fi
 
 if [ -f "$AMBARI_ENV" ]
 then
+    echo "Backing up Ambari properties $AMBARI_ENV -> $AMBARI_ENV_OLD"
     cp -n "$AMBARI_ENV" "$AMBARI_ENV_OLD"
 fi
 
 if [ -f "$AMBARI_KRB_JAAS_LOGIN_FILE" ]
 then
+    echo "Backing up JAAS login file $AMBARI_KRB_JAAS_LOGIN_FILE -> $AMBARI_KRB_JAAS_LOGIN_FILE_OLD"
     cp -n "$AMBARI_KRB_JAAS_LOGIN_FILE" "$AMBARI_KRB_JAAS_LOGIN_FILE_OLD"
 fi
 
 if [ -d "$STACKS_FOLDER" ]
 then
+    echo "Backing up stacks directory $STACKS_FOLDER -> $STACKS_FOLDER_OLD"
     mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
 fi
 
 if [ -d "$COMMON_SERVICES_FOLDER" ]
 then
+    echo "Backing up common-services directory $COMMON_SERVICES_FOLDER -> $COMMON_SERVICES_FOLDER_OLD"
     mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
 fi
 
+if [ -d "$MPACKS_FOLDER" ]
+then
+    # Make a copy of mpacks folder
+    if [ ! -d "$MPACKS_FOLDER_OLD" ]; then
+        echo "Backing up mpacks directory $MPACKS_FOLDER -> $MPACKS_FOLDER_OLD"
+        cp -R "$MPACKS_FOLDER" "$MPACKS_FOLDER_OLD"
+    fi
+
+    # Update symlinks in $STACKS_FOLDER_OLD to point to $MPACKS_FOLDER_OLD
+    if [ -d "$STACKS_FOLDER_OLD" ]; then
+        for link in $(find "$STACKS_FOLDER_OLD" -type l)
+        do
+            target=`readlink $link`
+            if grep -q "$MPACKS_FOLDER/"<<<$target; then
+                new_target="${target/$MPACKS_FOLDER/$MPACKS_FOLDER_OLD}"
+                echo "Updating symlink $link -> $new_target"
+                ln -snf $new_target $link
+            fi
+        done
+    fi
+
+    # Update symlinks in $COMMON_SERVICES_FOLDER_OLD to point to $MPACKS_FOLDER_OLD
+    if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]; then
+    for link in $(find "$COMMON_SERVICES_FOLDER_OLD" -type l)
+        do
+            target=`readlink $link`
+            if grep -q "$MPACKS_FOLDER/"<<<$target; then
+                new_target="${target/$MPACKS_FOLDER/$MPACKS_FOLDER_OLD}"
+                echo "Updating symlink $link -> $new_target"
+                ln -snf $new_target $link
+            fi
+        done
+    fi
+fi
+
 if [ ! -d "$AMBARI_VIEWS_BACKUP_FOLDER" ] && [ -d "$AMBARI_VIEWS_FOLDER" ]
 then
     mkdir "$AMBARI_VIEWS_BACKUP_FOLDER"
@@ -75,6 +119,7 @@ fi
 
 if [ -d "$AMBARI_VIEWS_FOLDER" ] && [ -d "$AMBARI_VIEWS_BACKUP_FOLDER" ]
 then
+    echo "Backing up Ambari view jars $AMBARI_VIEWS_FOLDER/*.jar -> $AMBARI_VIEWS_BACKUP_FOLDER/"
     cp -u $AMBARI_VIEWS_FOLDER/*.jar $AMBARI_VIEWS_BACKUP_FOLDER/
 fi
 
@@ -86,6 +131,7 @@ do
         then
             mkdir -p "$AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER"
         fi
+        echo "Backing up Ambari server jar $f -> $AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER/"
         mv -f $f $AMBARI_SERVER_JAR_FILES_BACKUP_FOLDER/
     fi
 done


Mime
View raw message