Updated Branches:
  refs/heads/branch-1.2.5 552fe42e1 -> 6c6b7f2de

AMBARI-2665. Zookeeper throws an stacktrace on Ambari secure cluster. (swagle)


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

Branch: refs/heads/branch-1.2.5
Commit: 6c6b7f2def1fd5b9e472cd326645a94400a225b8
Parents: 552fe42
Author: Siddharth Wagle <[email protected]>
Authored: Tue Jul 16 17:44:13 2013 -0700
Committer: Siddharth Wagle <[email protected]>
Committed: Tue Jul 16 18:13:33 2013 -0700

----------------------------------------------------------------------
 .../modules/hdp-zookeeper/files/zkSmoke.sh      | 21 +++++++++++++-------
 .../manifests/quorum/service_check.pp           |  5 +++--
 .../manifests/zookeeper/service_check.pp        |  5 +++--
 3 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6c6b7f2d/ambari-agent/src/main/puppet/modules/hdp-zookeeper/files/zkSmoke.sh
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/files/zkSmoke.sh 
b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/files/zkSmoke.sh
index dbfe2be..e9609c9 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/files/zkSmoke.sh
+++ b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/files/zkSmoke.sh
@@ -23,22 +23,29 @@
 smoke_script=$1
 smoke_user=$2
 conf_dir=$3
-security_enabled=$4
+client_port=$4
+security_enabled=$5
+kinit_path_local=$6
+smoke_user_keytab=$7
 export ZOOKEEPER_EXIT_CODE=0
 zkhosts=` grep "^server\.[[:digit:]]"  $conf_dir/zoo.cfg  | cut -f 2 -d '=' | 
cut -f 1 -d ':' | tr '\n' ' ' `
 zk_node1=`echo $zkhosts | tr ' ' '\n' | head -n 1`  
 echo "zk_node1=$zk_node1"
+if [[ $security_enabled == "true" ]]; then
+  kinitcmd="$kinit_path_local -kt $smoke_user_keytab $smoke_user"
+  su - $smoke_user -c "$kinitcmd"
+fi
 # Delete /zk_smoketest znode if exists
-su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ;  echo delete 
/zk_smoketest | ${smoke_script} -server $zk_node1:2181"  
+su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ;  echo delete 
/zk_smoketest | ${smoke_script} -server $zk_node1:$client_port"
 # Create /zk_smoketest znode on one zookeeper server
-su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo create 
/zk_smoketest smoke_data | ${smoke_script} -server $zk_node1:2181"
+su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo create 
/zk_smoketest smoke_data | ${smoke_script} -server $zk_node1:$client_port"
 
 for i in $zkhosts ; do
   echo "Running test on host $i"
   # Verify the data associated with znode across all the nodes in the 
zookeeper quorum
-  su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'get 
/zk_smoketest' | ${smoke_script} -server $i:2181"
-  su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'ls /' | 
${smoke_script} -server $i:2181"
-  output=$(su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'get 
/zk_smoketest' | ${smoke_script} -server $i:2181")
+  su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'get 
/zk_smoketest' | ${smoke_script} -server $i:$client_port"
+  su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'ls /' | 
${smoke_script} -server $i:$client_port"
+  output=$(su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'get 
/zk_smoketest' | ${smoke_script} -server $i:$client_port")
   echo $output | grep smoke_data
   if [[ $? -ne 0 ]] ; then
     echo "Data associated with znode /zk_smoketests is not consistent on host 
$i"
@@ -46,7 +53,7 @@ for i in $zkhosts ; do
   fi
 done
 
-su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'delete 
/zk_smoketest' | ${smoke_script} -server $zk_node1:2181"
+su - $smoke_user -c "source $conf_dir/zookeeper-env.sh ; echo 'delete 
/zk_smoketest' | ${smoke_script} -server $zk_node1:$client_port"
 if [[ "$ZOOKEEPER_EXIT_CODE" -ne "0" ]] ; then
   echo "Zookeeper Smoke Test: Failed" 
 else

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6c6b7f2d/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/quorum/service_check.pp
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/quorum/service_check.pp
 
b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/quorum/service_check.pp
index a7dce01..4fb5758 100644
--- 
a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/quorum/service_check.pp
+++ 
b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/quorum/service_check.pp
@@ -24,7 +24,8 @@ class hdp-zookeeper::quorum::service_check()
   $conf_dir = $hdp-zookeeper::params::conf_dir
   $security_enabled = $hdp::params::security_enabled
   $smoke_test_user = $hdp::params::smokeuser
-
+  $kinit_path = $hdp::params::kinit_path_local
+  $smoke_user_keytab = $hdp::params::smokeuser_keytab
   $smoke_script = $hdp::params::zk_smoke_test_script
   $quorum_smoke_shell_files = ['zkSmoke.sh']
 
@@ -44,7 +45,7 @@ define hdp-zookeeper::quorum_smoke_shell_file()
   }
 
   exec { '/tmp/zkSmoke.sh':
-    command   => "sh /tmp/zkSmoke.sh ${smoke_script} ${smoke_test_user} 
${conf_dir} ${security_enabled}",
+    command   => "sh /tmp/zkSmoke.sh ${smoke_script} ${smoke_test_user} 
${conf_dir} ${clientPort} ${security_enabled} ${kinit_path} 
${smoke_user_keytab}",
     tries     => 3,
     try_sleep => 5,
     require   => File['/tmp/zkSmoke.sh'],

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6c6b7f2d/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/zookeeper/service_check.pp
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/zookeeper/service_check.pp
 
b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/zookeeper/service_check.pp
index 25760fa..283c6ab 100644
--- 
a/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/zookeeper/service_check.pp
+++ 
b/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/zookeeper/service_check.pp
@@ -26,7 +26,8 @@ class hdp-zookeeper::zookeeper::service_check()
   $security_enabled = $hdp::params::security_enabled
   $smoke_test_user = $hdp::params::smokeuser
   $zookeeper_smoke_shell_files = ['zkService.sh']
-
+  $kinit_path = $hdp::params::kinit_path_local
+  $smoke_user_keytab = $hdp::params::smokeuser_keytab
   anchor { 'hdp-zookeeper::zookeeper::service_check::begin':}
 
   hdp-zookeeper::zookeeper_smoke_shell_file { $zookeeper_smoke_shell_files: }
@@ -43,7 +44,7 @@ define hdp-zookeeper::zookeeper_smoke_shell_file()
   }
 
   exec { '/tmp/zkService.sh':
-    command   => "sh /tmp/zkService.sh ${smoke_script} ${smoke_test_user} 
${conf_dir} ${security_enabled}",
+    command   => "sh /tmp/zkSmoke.sh ${smoke_script} ${smoke_test_user} 
${conf_dir} ${clientPort} ${security_enabled} ${kinit_path} 
${smoke_user_keytab}",
     tries     => 3,
     try_sleep => 5,
     require   => File['/tmp/zkService.sh'],

Reply via email to