You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2013/03/14 00:14:28 UTC
svn commit: r1456261 - in /incubator/ambari/trunk: ./
ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/
ambari-agent/src/main/puppet/modules/hdp-templeton/files/
ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/
ambari-agent/s...
Author: swagle
Date: Wed Mar 13 23:14:28 2013
New Revision: 1456261
URL: http://svn.apache.org/r1456261
Log:
AMBARI-1597. Templeton smoke test fails for secure cluster. (swagle)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/files/templetonSmoke.sh
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/params.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Mar 13 23:14:28 2013
@@ -458,6 +458,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-1597. Templeton smoke test fails for secure cluster. (swagle)
+
AMBARI-1600. Make component naming consistent. (yusaku)
AMBARI-1625. Oozie start fails on secure cluster. (swagle)
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/copyfromlocal.pp Wed Mar 13 23:14:28 2013
@@ -25,15 +25,17 @@ define hdp-hadoop::hdfs::copyfromlocal(
$recursive_chown = false,
$mode = undef,
$recursive_chmod = false,
- $dest_dir = undef
+ $dest_dir = undef,
+ $kinit_if_needed = undef
)
{
if ($service_state == 'running') {
$copy_cmd = "fs -copyFromLocal ${name} ${dest_dir}"
+ ## exec-hadoop does a kinit based on user, but unless does not
hdp-hadoop::exec-hadoop { $copy_cmd:
command => $copy_cmd,
- unless => "hadoop fs -ls ${dest_dir} >/dev/null 2>&1",
+ unless => "${kinit_if_needed} hadoop fs -ls ${dest_dir} >/dev/null 2>&1",
user => $owner
}
if ($owner == unset) {
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/files/templetonSmoke.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/files/templetonSmoke.sh?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/files/templetonSmoke.sh (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/files/templetonSmoke.sh Wed Mar 13 23:14:28 2013
@@ -24,6 +24,7 @@ export ttonhost=$1
export smoke_test_user=$2
export smoke_user_keytab=$3
export security_enabled=$4
+export kinit_path_local=$5
export ttonurl="http://${ttonhost}:50111/templeton/v1"
if [[ $security_enabled == "true" ]]; then
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/params.pp?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/params.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/params.pp Wed Mar 13 23:14:28 2013
@@ -56,6 +56,6 @@ class hdp-templeton::params() inherits h
$templeton_metastore_principal = hdp_default("hadoop/templeton-site/templeton_metastore_principal")
- $keytab_path = hdp_default("hadoop/templeton-site/keytab_path")
+ $keytab_path = $hdp::params::keytab_path
}
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/server.pp Wed Mar 13 23:14:28 2013
@@ -24,6 +24,8 @@ class hdp-templeton::server(
) inherits hdp-templeton::params
{
+ $templeton_user = $hdp-templeton::params::templeton_user
+
if ($service_state == 'no_op') {
} elsif ($service_state in ['running','stopped','installed_and_configured','uninstalled']) {
$hdp::params::service_exists['hdp-templeton::server'] = true
@@ -53,6 +55,12 @@ class hdp-templeton::server(
}
}
+ if ($security_enabled == true) {
+ $kinit_if_needed = "${hdp::params::kinit_path_local} -kt ${hdp::params::keytab_path}/${templeton_user}.headless.keytab ${templeton_user};"
+ } else {
+ $kinit_if_needed = "echo 0;"
+ }
+
class{ 'hdp-templeton' :
service_state => $service_state,
server => true
@@ -86,22 +94,25 @@ class hdp-templeton::copy-hdfs-directori
# }
hdp-hadoop::hdfs::copyfromlocal { '/usr/lib/hadoop/contrib/streaming/hadoop-streaming*.jar':
service_state => $service_state,
- owner => $hdp-templeton::params::templeton_user,
+ owner => $templeton_user,
mode => '755',
- dest_dir => '/apps/webhcat/hadoop-streaming.jar'
+ dest_dir => '/apps/webhcat/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 => $hdp-templeton::params::templeton_user,
+ owner => $templeton_user,
mode => '755',
- dest_dir => '/apps/webhcat/pig.tar.gz'
+ dest_dir => '/apps/webhcat/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 => $hdp-templeton::params::templeton_user,
+ owner => $templeton_user,
mode => '755',
- dest_dir => '/apps/webhcat/hive.tar.gz'
+ dest_dir => '/apps/webhcat/hive.tar.gz',
+ kinit_if_needed => $kinit_if_needed
}
}
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp Wed Mar 13 23:14:28 2013
@@ -28,6 +28,7 @@ class hdp-templeton::templeton::service_
} else {
$security = "false"
}
+ $kinit_path_local = $hdp::param::kinit_path_local
$smoke_user_keytab = "${hdp-templeton::params::keytab_path}/${smoke_test_user}.headless.keytab"
$templeton_host = $hdp::params::webhcat_server_host
@@ -50,7 +51,7 @@ define hdp-templeton::smoke_shell_file()
}
exec { '/tmp/templetonSmoke.sh':
- command => "sh /tmp/templetonSmoke.sh ${templeton_host} ${smoke_test_user} ${smoke_user_keytab} ${security}",
+ command => "sh /tmp/templetonSmoke.sh ${templeton_host} ${smoke_test_user} ${smoke_user_keytab} ${security} ${kinit_path_local}",
tries => 3,
try_sleep => 5,
require => File['/tmp/templetonSmoke.sh'],
Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp?rev=1456261&r1=1456260&r2=1456261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp Wed Mar 13 23:14:28 2013
@@ -34,6 +34,7 @@ class hdp::params()
$smoketest_user_secure_uid = hdp_default("smoketest_user_secure_uid",1012)
## $smoketest_user_secure_uid = 1012
$kinit_path_local = hdp_default("kinit_path_local","/usr/bin/kinit")
+ $keytab_path = hdp_default("keytab_path", "/etc/security/keytabs")
###### hostnames
$namenode_host = hdp_default("namenode_host")