ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abaranc...@apache.org
Subject [2/2] ambari git commit: AMBARI-35 - Monarch: preupload oozie files not executed (Ivan Kozlov via abaranchuk)
Date Thu, 05 Feb 2015 23:20:27 GMT
AMBARI-35 - Monarch: preupload oozie files not executed (Ivan Kozlov via abaranchuk)


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

Branch: refs/heads/trunk
Commit: 50ee8e02993e3d34ea46dc81dffbbf2c02348332
Parents: de026eb
Author: Artem Baranchuk <abaranchuk@hortonworks.con>
Authored: Fri Feb 6 01:19:20 2015 +0200
Committer: Artem Baranchuk <abaranchuk@hortonworks.con>
Committed: Fri Feb 6 01:19:20 2015 +0200

----------------------------------------------------------------------
 .../src/main/resources/scripts/Ambaripreupload.py    | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/50ee8e02/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 7a6bf67..89e0742 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -63,6 +63,8 @@ class params():
   hadoop_conf_dir = "/etc/hadoop/conf"
   user_group = "hadoop"
   security_enabled = False
+  oozie_user = "oozie"
+  execute_path = "/usr/hdp/current/hadoop-client/bin"
  
 params = params()
  
@@ -255,8 +257,17 @@ with Environment() as env:
  
   oozie_cmd = format("{put_shared_lib_to_hdfs_cmd} ; hadoop --config {hadoop_conf_dir} dfs
-chmod -R 755 {oozie_hdfs_user_dir}/share")
   not_if_command = format("{kinit_if_needed} hadoop --config {hadoop_conf_dir} dfs -ls /user/oozie/share
| awk 'BEGIN {{count=0;}} /share/ {{count++}} END {{if (count > 0) {{exit 0}} else {{exit
1}}}}'")
- 
-  #Execute(format("hadoop --config {hadoop_conf_dir} dfs -mkdir {
+  HdfsDirectory(format("{oozie_hdfs_user_dir}/share"),
+                action="create",
+                owner=oozie_user,
+                mode=0555,
+                conf_dir=params.hadoop_conf_dir,
+                hdfs_user=params.hdfs_user,
+                )
+
+  Execute( oozie_cmd, user = params.oozie_user, not_if = not_if_command,
+           path = params.execute_path )
+
   copy_tarballs_to_hdfs("/usr/hdp/current/hadoop-client/mapreduce.tar.gz", "wasb:///hdp/apps/{{
hdp_stack_version }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user,
params.user_group)
   copy_tarballs_to_hdfs("/usr/hdp/current/tez-client/lib/tez.tar.gz", "wasb:///hdp/apps/{{
hdp_stack_version }}/tez/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user,
params.user_group)
   copy_tarballs_to_hdfs("/usr/hdp/current/hive-client/hive.tar.gz", "wasb:///hdp/apps/{{
hdp_stack_version }}/hive/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user,
params.user_group)


Mime
View raw message