Hortonworks Schema Registry的自定义反序列化器中的Apache Flink Kerberos配置

时间:2019-09-30 07:31:00

标签: java apache-kafka apache-flink kerberos jaas

我正在尝试使用Apache Flink从针对Kafka主题的自定义反序列化器连接到Hortonworks Schema Registry。

通过在Kafka使用者上设置 sasl.jaas.config 属性,我可以从受保护的Kafka中读取消息。但是,当我添加一个使用Hortonworks Schema Registry获取反序列化模式的自定义反序列化器时,需要使用401 HTTP Code:Authentication进行服务响应。我已在此服务上启用Kerberos。

我尝试过的事情:

在反序列化器实现上设置java.security.auth.login.config:

System.setProperty("java.security.auth.login.config", "/path/to/jaas.conf");

使用动态Java选项启动应用程序:

flink run [...] -yD env.java.opts="-Djava.security.auth.login.config=/path/to/jaas.conf" myApplicatio.jar

flink-conf.yaml 中设置env.java.opts:

env.java.opts: -Djava.security.auth.login.config=/path/to/jaas.conf

这些选项都不适合我。

要针对HW Schema注册表进行身份验证的jaas.conf的内容为:

RegistryClient {
   com.sun.security.auth.module.Krb5LoginModule required
   principal="flink@mydomain.com"
   keytab="/etc/security/keytabs/flink.keytab"
   useKeytab=true
   useTicketCache=true
   renewTicket=true
   serviceName="flink";
};

有人可以帮忙吗?

更新:我希望服务器中缺少某些东西,因为curl请求在Spenego协商中显示内部服务器错误,服务器日志上的回溯是:

ERROR  [2019-10-10 10:49:46.099] [dw-26402 - GET /api/v1/schemaregistry/schema] c.h.r.c.GenericExceptionMapper -  Got exception: [NotFoundException] / message [HTTP 404 Not Found]
javax.ws.rs.NotFoundException: HTTP 404 Not Found
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:323)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
        at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
        at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:45)
        at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at com.hortonworks.registries.schemaregistry.webservice.RewriteUriFilter.doFilter(RewriteUriFilter.java:77)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at com.hortonworks.registries.auth.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:595)
        at com.hortonworks.registries.auth.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:553)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:311)
        at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:265)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:241)
        at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:52)
        at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:724)
        at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:69)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:531)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
        at java.lang.Thread.run(Thread.java:745)

谢谢

0 个答案:

没有答案