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

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


The following commit(s) were added to refs/heads/master by this push:
     new 569f38e9b IMPALA-14206: Add option to start Impala with Ranger authz 
enabled
569f38e9b is described below

commit 569f38e9bfdb250fed6d0866f829bca5b05f08a3
Author: stiga-huang <[email protected]>
AuthorDate: Mon Jul 7 20:50:18 2025 +0800

    IMPALA-14206: Add option to start Impala with Ranger authz enabled
    
    This patch adds an option in bin/start-impala-cluster.py to start the
    Impala cluster with Ranger authorization enabled.
    
    Tests
     - Manually tested the script and verified Ranger authz is enabled.
    
    Change-Id: I62d6f75fdfcf6e0c3807958e2aae4405054eef8a
    Reviewed-on: http://gerrit.cloudera.org:8080/23138
    Reviewed-by: Riza Suminto <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 bin/start-impala-cluster.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bin/start-impala-cluster.py b/bin/start-impala-cluster.py
index 414c40910..6dad0c923 100755
--- a/bin/start-impala-cluster.py
+++ b/bin/start-impala-cluster.py
@@ -205,6 +205,9 @@ parser.add_option("--use_calcite_planner", default="False", 
type="choice",
                   choices=["true", "True", "false", "False"],
                   help="If true, use the Calcite planner for query 
optimization "
                   "instead of the Impala planner")
+parser.add_option("--enable_ranger_authz", dest="enable_ranger_authz",
+                  action="store_true", default=False,
+                  help="If true, enable Ranger authorization in Impala 
cluster.")
 
 # For testing: list of comma-separated delays, in milliseconds, that delay 
impalad catalog
 # replica initialization. The ith delay is applied to the ith impalad.
@@ -468,6 +471,9 @@ def build_catalogd_arg_list(num_catalogd, remap_ports):
           ["-state_store_port={0}".format(state_store_port)])
       args.extend(
           ["-state_store_2_port={0}".format(state_store_port + 1)])
+    if options.enable_ranger_authz:
+      args.extend(["--server-name=server1", "--ranger_service_type=hive",
+                   "--ranger_app_id=impala", 
"--authorization_provider=ranger"])
     catalogd_arg_list.append(args)
   return catalogd_arg_list
 
@@ -702,6 +708,10 @@ def build_impalad_arg_lists(cluster_size, 
num_coordinators, use_exclusive_coordi
           args=args)
       os.environ["USE_CALCITE_PLANNER"] = "true"
 
+    if options.enable_ranger_authz:
+      args = ("--server-name=server1 --ranger_service_type=hive 
--ranger_app_id=impala "
+              "--authorization_provider=ranger {args}").format(args=args)
+
     # Appended at the end so they can override previous args.
     if i < len(per_impalad_args):
       args = "{args} {per_impalad_args}".format(

Reply via email to