incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject svn commit: r1497635 - in /incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules: hdp-hadoop/manifests/hdfs/copyfromlocal.pp hdp-templeton/manifests/server.pp
Date Fri, 28 Jun 2013 03:13:19 GMT
Author: swagle
Date: Fri Jun 28 03:13:18 2013
New Revision: 1497635

URL: http://svn.apache.org/r1497635
Log:
AMBARI-2518. webhcat start failed. (swagle)

Modified:
    incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
    incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp

Modified: incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp?rev=1497635&r1=1497634&r2=1497635&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
Fri Jun 28 03:13:18 2013
@@ -32,10 +32,15 @@ define hdp-hadoop::hdfs::copyfromlocal(
  
   if ($service_state == 'running') {
     $copy_cmd = "fs -copyFromLocal ${name} ${dest_dir}"
+    if ($kinit_if_needed == undef) {
+      $unless_cmd = "hadoop fs -ls ${dest_dir} >/dev/null 2>&1"
+    } else {
+      $unless_cmd = "${kinit_if_needed} hadoop fs -ls ${dest_dir} >/dev/null 2>&1"
+    }
     ## exec-hadoop does a kinit based on user, but unless does not
     hdp-hadoop::exec-hadoop { $copy_cmd:
       command => $copy_cmd,
-      unless => "${kinit_if_needed} hadoop fs -ls ${dest_dir} >/dev/null 2>&1",
+      unless => $unless_cmd,
       user => $owner
     }
     if ($owner == unset) {

Modified: incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp?rev=1497635&r1=1497634&r2=1497635&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp
Fri Jun 28 03:13:18 2013
@@ -85,35 +85,36 @@ class hdp-templeton::copy-hdfs-directori
    } else {
      $kinit_if_needed = "echo 0;"
    }
-# $pig_src_tar = "$hdp::params::artifact_dir/pig.tar.gz"
 
-#  hdp-hadoop::hdfs::copyfromlocal { '/usr/share/templeton/templeton*jar':
-#    service_state => $service_state,
-#    owner => $hdp-templeton::params::templeton_user,
-#    mode  => '755',
-#    dest_dir => '/apps/templeton/ugi.jar'
-#  }
+  anchor{ "hdp::hdp-templeton::copy-hdfs-directories::begin" : }
+  anchor{ "hdp::hdp-templeton::copy-hdfs-directories::end" : }
+
+  $kinit_cmd = "su - ${webhcat_user} -c '${kinit_if_needed}'"
+  exec { $kinit_cmd:
+    command => $kinit_cmd,
+    path => ['/bin']
+  }
+
   hdp-hadoop::hdfs::copyfromlocal { '/usr/lib/hadoop/contrib/streaming/hadoop-streaming*.jar':
    service_state => $service_state,
    owner => $webhcat_user,
    mode  => '755',
    dest_dir => "$webhcat_apps_dir/hadoop-streaming.jar",
-   kinit_if_needed => $kinit_if_needed
   }
-  #TODO: Use ${hdp::params::artifact_dir}/${hdp-templeton::params::pig_tar_name} instead
   hdp-hadoop::hdfs::copyfromlocal { '/usr/share/HDP-webhcat/pig.tar.gz' :
     service_state => $service_state,
     owner => $webhcat_user,
     mode  => '755',
     dest_dir => "$webhcat_apps_dir/pig.tar.gz",
-    kinit_if_needed => $kinit_if_needed
   }
-  #TODO: Use ${hdp::params::artifact_dir}/${hdp-templeton::params::hive_tar_name} instead
   hdp-hadoop::hdfs::copyfromlocal { '/usr/share/HDP-webhcat/hive.tar.gz' :
     service_state => $service_state,
     owner => $webhcat_user,
     mode  => '755',
     dest_dir => "$webhcat_apps_dir/hive.tar.gz",
-    kinit_if_needed => $kinit_if_needed
   }
+  Anchor["hdp::hdp-templeton::copy-hdfs-directories::begin"] ->
+  Exec[$kinit_cmd] ->
+  Hdp-hadoop::Hdfs::Copyfromlocal<||>  ->
+  Anchor["hdp::hdp-templeton::copy-hdfs-directories::end"]
 }



Mime
View raw message