浏览代码

HUE-770 [beeswax] Improve secured cluster configuration experience

Romain Rigaux 13 年之前
父节点
当前提交
09b9594e79

+ 2 - 2
apps/beeswax/src/beeswax/conf.py

@@ -29,7 +29,7 @@ SERVER_INTERFACE = Config(
 
 BEESWAX_SERVER_HOST = Config(
   key="beeswax_server_host",
-  help=_("Host where Beeswax server Thrift daemon is running."),
+  help=_("Host where Beeswax server Thrift daemon is running. FQDN required when using security even if on same host."),
   private=True,
   default="localhost")
 
@@ -42,7 +42,7 @@ BEESWAX_SERVER_PORT = Config(
 
 BEESWAX_META_SERVER_HOST = Config(
   key="beeswax_meta_server_host",
-  help=_("Host where Beeswax internal metastore Thrift daemon is running."),
+  help=_("Host where internal metastore Thrift daemon is running."),
   private=True,
   default="localhost")
 

+ 3 - 2
apps/beeswax/src/beeswax/server/beeswax_lib.py

@@ -24,7 +24,7 @@ import hadoop.cluster
 
 from desktop.lib import thrift_util
 from hive_metastore import ThriftHiveMetastore
-
+from desktop.conf import KERBEROS
 from beeswaxd import BeeswaxService
 from beeswaxd.ttypes import QueryNotFoundException
 
@@ -266,12 +266,13 @@ class BeeswaxClient:
 
     cluster_conf = hadoop.cluster.get_cluster_conf_for_job_submission()
     use_sasl = cluster_conf is not None and cluster_conf.SECURITY_ENABLED.get()
+    kerberos_principal_short_name = KERBEROS.HUE_PRINCIPAL.get().split('/', 1)[0]
 
     client = thrift_util.get_client(BeeswaxService.Client,
                                     query_server['server_host'],
                                     query_server['server_port'],
                                     service_name=query_server['server_name'],
-                                    kerberos_principal="hue",
+                                    kerberos_principal=kerberos_principal_short_name,
                                     use_sasl=use_sasl,
                                     timeout_seconds=conf.BEESWAX_SERVER_CONN_TIMEOUT.get())
     return UnicodeBeeswaxClient(client)

+ 9 - 8
desktop/conf.dist/hue.ini

@@ -332,18 +332,19 @@
 
 [beeswax]
 
-  # Host where Beeswax internal metastore Thrift daemon is running
-  ## beeswax_meta_server_host=localhost
+  # Host where Beeswax Thrift server is running.
+  # Required when using security or when Beeswax is not on localhost.
+  # The FQDN should be the same as the FQDN specified in the hue_principal configuration.
+  ## beeswax_server_host=<FQDN of Beeswax Server>
 
-  # Configure the port the internal metastore daemon runs on. Used only if
-  # hive.metastore.local is true.
-  ## beeswax_meta_server_port=8003
+  # Port where Beeswax Thrift server runs on.
+  ## beeswax_server_port=8002
 
-  # Host where Beeswax internal metastore Thrift daemon is running
+  # Host where internal metastore Thrift daemon is running.
   ## beeswax_meta_server_host=localhost
 
-  # Configure the port the internal metastore daemon runs on. Used only if
-  # hive.metastore.local is true.
+  # Configure the port the internal metastore daemon runs on.
+  # Used only if hive.metastore.local is true.
   ## beeswax_meta_server_port=8003
 
   # Hive home directory

+ 9 - 8
desktop/conf/pseudo-distributed.ini.tmpl

@@ -335,18 +335,19 @@
 
 [beeswax]
 
-  # Host where Beeswax internal metastore Thrift daemon is running
-  ## beeswax_meta_server_host=localhost
+  # Host where Beeswax Thrift server is running.
+  # Required when using security or when Beeswax is not on localhost.
+  # The FQDN should be the same as the FQDN specified in the hue_principal configuration.
+  ## beeswax_server_host=<FQDN of Beeswax Server>
 
-  # Configure the port the internal metastore daemon runs on. Used only if
-  # hive.metastore.local is true.
-  ## beeswax_meta_server_port=8003
+  # Port where Beeswax Thrift server runs on.
+  ## beeswax_server_port=8002
 
-  # Host where Beeswax internal metastore Thrift daemon is running
+  # Host where internal metastore Thrift daemon is running.
   ## beeswax_meta_server_host=localhost
 
-  # Configure the port the internal metastore daemon runs on. Used only if
-  # hive.metastore.local is true.
+  # Configure the port the internal metastore daemon runs on.
+  # Used only if hive.metastore.local is true.
   ## beeswax_meta_server_port=8003
 
   # Hive home directory