Repository: metron
Updated Branches:
  refs/heads/master 38eebd59c -> 31d99f122


METRON-1145: Profiler mpack does not create kafka acl and hbase acls correctly 
in kerberized cluster closes apache/incubator-metron#726


Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/31d99f12
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/31d99f12
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/31d99f12

Branch: refs/heads/master
Commit: 31d99f122e89d81590df84f66c2dc9fb336a03b8
Parents: 38eebd5
Author: cstella <ceste...@gmail.com>
Authored: Thu Aug 31 15:48:01 2017 -0400
Committer: cstella <ceste...@gmail.com>
Committed: Thu Aug 31 15:48:01 2017 -0400

----------------------------------------------------------------------
 .../CURRENT/package/scripts/profiler_commands.py    |  4 ++++
 .../CURRENT/package/scripts/profiler_master.py      | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/31d99f12/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_commands.py
----------------------------------------------------------------------
diff --git 
a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_commands.py
 
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_commands.py
index ddd66cb..4dfa371 100644
--- 
a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_commands.py
+++ 
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_commands.py
@@ -98,6 +98,10 @@ class ProfilerCommands:
         Logger.info("Done creating HBase Tables")
         self.set_hbase_configured()
 
+    def init_kafka_acls(self):
+        Logger.info('Creating Kafka ACls for profiler')
+        metron_service.init_kafka_acls(self.__params, [self.__profiler_topic], 
['profiler'])
+
     def set_hbase_acls(self):
         Logger.info("Setting HBase ACLs")
         if self.__params.security_enabled:

http://git-wip-us.apache.org/repos/asf/metron/blob/31d99f12/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py
----------------------------------------------------------------------
diff --git 
a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py
 
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py
index 4946ab0..77c32f0 100644
--- 
a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py
+++ 
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py
@@ -27,6 +27,7 @@ from resource_management.libraries.script import Script
 
 from metron_security import storm_security_setup
 import metron_service
+import metron_security
 from profiler_commands import ProfilerCommands
 
 
@@ -59,6 +60,9 @@ class Profiler(Script):
             commands.create_hbase_tables()
         if params.security_enabled and not commands.is_hbase_acl_configured():
             commands.set_hbase_acls()
+        if params.security_enabled and not commands.is_acl_configured():
+            commands.init_kafka_acls()
+            commands.set_acl_configured()
 
         Logger.info("Calling security setup")
         storm_security_setup(params)
@@ -68,6 +72,18 @@ class Profiler(Script):
         env.set_params(params)
         self.configure(env)
         commands = ProfilerCommands(params)
+        if params.security_enabled:
+            metron_security.kinit(params.kinit_path_local,
+                                  params.metron_keytab_path,
+                                  params.metron_principal_name,
+                                  execute_user=params.metron_user)
+
+        if params.security_enabled and not commands.is_hbase_acl_configured():
+            commands.set_hbase_acls()
+        if params.security_enabled and not commands.is_acl_configured():
+            commands.init_kafka_acls()
+            commands.set_acl_configured()
+
         commands.start_profiler_topology(env)
 
     def stop(self, env, upgrade_type=None):

Reply via email to