You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/11/19 01:27:43 UTC

[impala] 03/04: IMPALA-10340: Cannot set up KDC from scratch

This is an automated email from the ASF dual-hosted git repository.

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 63da9ccf0c64188a6cdd01ef8d88cfbd0c81fc9a
Author: Doroszlai, Attila <ad...@apache.org>
AuthorDate: Wed Nov 18 15:23:54 2020 +0100

    IMPALA-10340: Cannot set up KDC from scratch
    
    IMPALA-9361 added experimental support for setting up a KDC for the mini
    cluster.  However, the experimental-kerberos-setup.sh script fails with
    the error:
    
      KRB5_CONFIG: unbound variable
    
    The problem is that impala-config.sh unsets KDC-related variables if the
    cluster is not kerberized or does not exist.  However, kerberized
    cluster cannot be created without installing KDC first.
    
    This change updates impala-config.sh to allow setting the KDC-related
    variables if IMPALA_KERBERIZE is set to 'true' and the cluster does not
    exist yet.
    
    Testing:
     * successfully set up KDC via experimental-kerberos-setup.sh after
       building Impala locally
     * verified that impala-config.sh sets/unsets KDC-related variables
       depending on cluster existence and config
     * started Kerberized and non-Kerberized mini clusters (after
       regenerating configs)
    
    Change-Id: Icaed2ad2fb1e1b60951a5a4138a9386588bc6972
    Reviewed-on: http://gerrit.cloudera.org:8080/16744
    Reviewed-by: Tim Armstrong <ta...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 bin/impala-config.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index d855b33..e7adfdc 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -738,7 +738,9 @@ echo "IMPALA_ICEBERG_VERSION  = $IMPALA_ICEBERG_VERSION"
 # kerberized cluster is created, it will have to be sourced again
 # *after* the cluster is created in order to pick up these settings.
 export MINIKDC_ENV="${IMPALA_HOME}/testdata/bin/minikdc_env.sh"
-if "${CLUSTER_DIR}/admin" is_kerberized; then
+if "${CLUSTER_DIR}/admin" is_kerberized ||
+  ( ! "${CLUSTER_DIR}/admin" cluster_exists && [[ "$IMPALA_KERBERIZE" == "true" ]] ); then
+
   . "${MINIKDC_ENV}"
   echo " *** This cluster is kerberized ***"
   echo "KRB5_KTNAME            = $KRB5_KTNAME"