Răsfoiți Sursa

[zookeeper] Adding parameter for specifying zookeeper principal name

Romain Rigaux 10 ani în urmă
părinte
comite
a1afc18

+ 6 - 0
apps/zookeeper/src/zookeeper/conf.py

@@ -43,6 +43,12 @@ CLUSTERS = UnspecifiedConfigSection(
           default="http://localhost:9998",
           type=str,
       ),
+      PRINCIPAL_NAME=Config(
+          "principal_name",
+          help="Name of Kerberos principal when using security",
+          default="zookeeper",
+          type=str,
+      ),
     )
   )
 )

+ 4 - 1
desktop/conf.dist/hue.ini

@@ -1007,9 +1007,12 @@
       # e.g. localhost:2181,localhost:2182,localhost:2183
       ## host_ports=localhost:2181
 
-      # The URL of the REST contrib service (required for znode browsing)
+      # The URL of the REST contrib service (required for znode browsing).
       ## rest_url=http://localhost:9998
 
+      # Name of Kerberos principal when using security.
+      ## principal_name=zookeeper
+
 
 ###########################################################################
 # Settings to configure the Spark application.

+ 4 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -1012,9 +1012,12 @@
       # e.g. localhost:2181,localhost:2182,localhost:2183
       ## host_ports=localhost:2181
 
-      # The URL of the REST contrib service (required for znode browsing)
+      # The URL of the REST contrib service (required for znode browsing).
       ## rest_url=http://localhost:9998
 
+      # Name of Kerberos principal when using security.
+      ## principal_name=zookeeper
+
 
 ###########################################################################
 # Settings to configure the Spark application.

+ 4 - 2
desktop/libs/libsentry/src/libsentry/api.py

@@ -251,10 +251,12 @@ def _get_server_properties():
 
     try:
       if _api_cache is None:
-        zk = KazooClient(hosts=get_sentry_server_ha_zookeeper_quorum(), read_only=True) #TODO hardcoded principal name
+        zk = KazooClient(hosts=get_sentry_server_ha_zookeeper_quorum(), read_only=True)
 
         if get_sentry_server_ha_has_security():
-          pass #TODO zk.add_kerb
+          # TODO zk.add_kerb
+          # TODO get principal name PRINCIPAL_NAME.get()
+          from zookeeper.conf import PRINCIPAL_NAME
 
         zk.start()