AMBARI-18392 : Cluster failure due to APP_TIMELINE_SERVER and RESOURCEMANAGER 
failed to start. (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: bead01cfe1a10be6a8dae0c9e681d4254b35db4e
Parents: 513965f
Author: Aravindan Vijayan <avija...@hortonworks.com>
Authored: Thu Sep 15 09:25:50 2016 -0700
Committer: Aravindan Vijayan <avija...@hortonworks.com>
Committed: Thu Sep 15 09:25:50 2016 -0700

----------------------------------------------------------------------
 .../main/resources/scripts/Ambaripreupload.py   | 76 ++++++++++----------
 1 file changed, 38 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bead01cf/ambari-server/src/main/resources/scripts/Ambaripreupload.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 09dcd7e..1082b5e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -331,50 +331,50 @@ with Environment() as env:
     spark_client_dir = format("/usr/hdp/{stack_version}/spark")
 
     if os.path.exists(spark_client_dir):
-      # Rename /usr/hdp/{stack_version}/oozie/share/lib/spark to spark-orig
-      Execute(("mv",
-               format("{oozie_shared_lib}/lib/spark"),
-               format("{oozie_shared_lib}/lib/spark-orig")),
-               sudo=True)
+      try:
+        # Rename /usr/hdp/{stack_version}/oozie/share/lib/spark to spark-orig
+        if not os.path.exists(format("{oozie_shared_lib}/lib/spark-orig")):
+          Execute(("mv",
+                   format("{oozie_shared_lib}/lib/spark"),
+                   format("{oozie_shared_lib}/lib/spark-orig")),
+                   sudo=True)
 
-      # Create /usr/hdp/{stack_version}/oozie/share/lib/spark
-      Directory(format("{oozie_shared_lib}/lib/spark"),
-                owner = oozie_user,
-                create_parents = True
-                )
+        # Create /usr/hdp/{stack_version}/oozie/share/lib/spark
+        if not os.path.exists(format("{oozie_shared_lib}/lib/spark")):
+          Execute(('mkdir', format('{oozie_shared_lib}/lib/spark')),
+                sudo=True)
 
-      # Copy oozie-sharelib-spark from 
/usr/hdp/{stack_version}/oozie/share/lib/spark-orig to spark
-      Execute(format("cp -f 
{oozie_shared_lib}/lib/spark-orig/oozie-sharelib-spark*.jar 
{oozie_shared_lib}/lib/spark"),
-              user=oozie_user)
+        # Copy oozie-sharelib-spark from 
/usr/hdp/{stack_version}/oozie/share/lib/spark-orig to spark
+        Execute(format("cp -f 
{oozie_shared_lib}/lib/spark-orig/oozie-sharelib-spark*.jar 
{oozie_shared_lib}/lib/spark"))
 
-      # Copy /usr/hdp/{stack_version}/spark-client/*.jar except 
spark-examples*.jar
-      Execute(format("cp -P {spark_client_dir}/lib/*.jar 
{oozie_shared_lib}/lib/spark"),
-              user=oozie_user)
-      Execute(format("find {oozie_shared_lib}/lib/spark/ -type l -delete"),
-              user=oozie_user)
-      try:
-        Execute(format("rm -f 
{oozie_shared_lib}/lib/spark/spark-examples*.jar"),
-                user=oozie_user)
-      except:
-        print "No spark-examples jar files found in Spark client lib."
+        # Copy /usr/hdp/{stack_version}/spark-client/*.jar except 
spark-examples*.jar
+        Execute(format("cp -P {spark_client_dir}/lib/*.jar 
{oozie_shared_lib}/lib/spark"))
+        Execute(format("find {oozie_shared_lib}/lib/spark/ -type l -delete"))
+        try:
+          Execute(format("rm -f 
{oozie_shared_lib}/lib/spark/spark-examples*.jar"))
+        except:
+          print "No spark-examples jar files found in Spark client lib."
 
-      # Copy /usr/hdp/{stack_version}/spark-client/python/lib/*.zip & *.jar to 
/usr/hdp/{stack_version}/oozie/share/lib/spark
-      Execute(format("cp -f {spark_client_dir}/python/lib/*.zip 
{oozie_shared_lib}/lib/spark"),
-              user=oozie_user)
+        # Copy /usr/hdp/{stack_version}/spark-client/python/lib/*.zip & *.jar 
to /usr/hdp/{stack_version}/oozie/share/lib/spark
+        Execute(format("cp -f {spark_client_dir}/python/lib/*.zip 
{oozie_shared_lib}/lib/spark"))
 
-      try:
-        Execute(format("cp -f {spark_client_dir}/python/lib/*.jar 
{oozie_shared_lib}/lib/spark"),
-              user=oozie_user)
-      except:
-        print "No jar files found in Spark client python lib."
+        try:
+          Execute(format("cp -f {spark_client_dir}/python/lib/*.jar 
{oozie_shared_lib}/lib/spark"))
+        except:
+          print "No jar files found in Spark client python lib."
+
+        Execute(("chmod", "-R", "0755", 
format('{oozie_shared_lib}/lib/spark')),
+                sudo=True)
 
-      # Skipping this step since it might cause issues to automated scripts 
that rely on hdfs://user/oozie/share/lib
-      # Rename /usr/hdp/{stack_version}/oozie/share/lib to lib_ts
-      # millis = int(round(time.time() * 1000))
-      # Execute(("mv",
-      #          format("{oozie_shared_lib}/lib"),
-      #          format("{oozie_shared_lib}/lib_{millis}")),
-      #         sudo=True)
+        # Skipping this step since it might cause issues to automated scripts 
that rely on hdfs://user/oozie/share/lib
+        # Rename /usr/hdp/{stack_version}/oozie/share/lib to lib_ts
+        # millis = int(round(time.time() * 1000))
+        # Execute(("mv",
+        #          format("{oozie_shared_lib}/lib"),
+        #          format("{oozie_shared_lib}/lib_{millis}")),
+        #         sudo=True)
+      except Exception, e:
+        print 'Exception occurred while preparing oozie share lib: '+ repr(e)
 
     params.HdfsResource(format("{oozie_hdfs_user_dir}/share"),
       action="create_on_execute",

Reply via email to