场景

某监控进程需要访问多个集群的Kafka

INFO - org.apache.kafka.common.KafkaException: Failed to construct kafka consumer
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:765)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:633)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:615)
INFO - at com.sohu.rc.factory.KafkaServiceImpl.getLogsizeByCluster(KafkaServiceImpl.java:252)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorServiceImpl.getAllTopicLogsize(KafkaHdfsMonitorServiceImpl.java:297)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorServiceImpl.getHdfsKafkaMonitor(KafkaHdfsMonitorServiceImpl.java:175)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorService.main(KafkaHdfsMonitorService.java:17)
INFO - Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is /data_b/kafka/kafka_client_jaas_usekeytab.conf
INFO - at org.apache.kafka.common.security.JaasContext.defaultContext(JaasContext.java:131)
INFO - at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:96)
INFO - at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:78)
INFO - at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:100)
INFO - at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:58)
INFO - at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:88)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:695)
INFO - ... 6 common frames omitted
INFO - org.apache.kafka.common.KafkaException: Failed to construct kafka consumer
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:765)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:633)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:615)
INFO - at com.sohu.rc.factory.KafkaServiceImpl.getLogsizeByCluster(KafkaServiceImpl.java:252)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorServiceImpl.getAllTopicLogsize(KafkaHdfsMonitorServiceImpl.java:297)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorServiceImpl.getHdfsKafkaMonitor(KafkaHdfsMonitorServiceImpl.java:175)
INFO - at com.sohu.rc.service.KafkaHdfsMonitorService.main(KafkaHdfsMonitorService.java:17)
INFO - Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is /data_b/kafka/kafka_client_jaas_usekeytab.conf
INFO - at org.apache.kafka.common.security.JaasContext.defaultContext(JaasContext.java:131)
INFO - at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:96)
INFO - at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:78)
INFO - at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:100)
INFO - at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:58)
INFO - at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:88)
INFO - at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:695)
INFO - ... 6 more

Kafka官方文档:

https://kafka.apache.org/0110/documentation.html#security_sasl

Clients may specify JAAS configuration as a producer or consumer property without creating a physical configuration file.
This mode also enables different producers and consumers within the same JVM to use different credentials by specifying different properties for each client.
If both static JAAS configuration system property java.security.auth.login.config and client property sasl.jaas.config are specified, the client property will be used.

表示要同时设置

java.security.auth.login.config and  sasl.jaas.config

处理 Could not find a 'KafkaClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is的更多相关文章

  1. Cloudera Hadoop启用Kerberos认证

    一.Kerberos 二.安装 node01服务器安装Kerberos的核心服务master KDC,node02和node03安装Kerberos client cm也安装在node01上了 1.m ...

  2. JAAS configuration for Kafka clients

    Clients may configure JAAS using the client configuration property sasl.jaas.config or using the sta ...

  3. httpcomponents-client-4.4.x

    Chapter 1. Fundamentals Prev     Next Chapter 1. Fundamentals 1.1. Request execution The most essent ...

  4. httpcomponents-client-ga(4.5)

    http://hc.apache.org/httpcomponents-client-ga/tutorial/html/   Chapter 1. Fundamentals Prev     Next ...

  5. httpcomponents-client-4.3.x DOC

    Chapter 1. Fundamentals Prev     Next Chapter 1. Fundamentals 1.1. Request execution The most essent ...

  6. 为CDH 5.7集群添加Kerberos身份验证及Sentry权限控制

    转载请注明出处:http://www.cnblogs.com/xiaodf/ 4. 为CDH 5集群添加Kerberos身份验证 4.1 安装sentry1.点击“操作”,“添加服务”:2.选择sen ...

  7. kafka-producer kerberos 原理和配置

    kerberos简单介绍 kerberos这一名词来源于希腊神话“三个头的狗---地狱之门守护者”后来沿用作为安全认证的概念,该系统设计上 采用客户端/服务器结构与DES(Data Encryptio ...

  8. 使用JAAS登录kerberos服务器

    java代码: package com.snsprj.jaas0822; import javax.security.auth.*; import javax.security.auth.callba ...

  9. centos7配置kerberos服务,并使用JAAS登录

    准备两个虚拟机:192.168.1.101.192.168.1.102,101作为kerberos的server端,102作为kerberos的client端.开启88端口. 1.安装kerberos ...

随机推荐

  1. asp.net core IdentityServer4 实现 resource owner password credentials(密码凭证)

    前言 OAuth 2.0默认四种授权模式(GrantType) 授权码模式(authorization_code) 简化模式(implicit) 密码模式(resource owner passwor ...

  2. Unity项目 - DeathtrapDungeon死亡地牢

    目录 游戏原型 项目演示 绘图资源 代码实现 注意事项 技术探讨 参考来源 游戏原型 死亡地牢是一款 2D-Roguelike 的地牢冒险游戏.手握利刃,斩杀怪物,在凶险的地牢内生存下去.但注意,敌人 ...

  3. mysql--命令行创建数据库

    MySQL 1. 连接到本机上的MYSQL. 首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root  -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格 ...

  4. 利用threading模块开线程

    一多线程的概念介绍 threading模块介绍 threading模块和multiprocessing模块在使用层面,有很大的相似性. 二.开启多线程的两种方式 1.创建线程的开销比创建进程的开销小, ...

  5. phaser学习总结之Text对象详解

    前言 在phaser学习总结之phaser入门教程中,我们已经入门了phaser,对phaser也有所了解但是我们并没有对phaser中的每个对象的属性和方法进行详解,本章将对phaser中的Text ...

  6. DevExpress GridControl导出ExportToXls 数字类型显示成货币格式

    用Dev开发很习惯直接用自带控件导出Excel,现在很少使用原生的Excel API去操作了.除非需要详细的控制. 但别人家封装好的就得按人家的规则的.在使用GridControl导出Excel时发现 ...

  7. php常用函数(第一版)

    1.array_slice 作用:数组分页函数 案例:$output  =  array_slice ( $input , - 2 ,  1 ); 2.array_column 作用:数组根据值取出一 ...

  8. 使用JavaScript·求数组的最大值和最小值

    前言  在数组中并没有提供arr.max()和arr.min()这样的方法.那么是不是可以通过别的方式实现类似这样的方法呢?那么今天我们就来整理取出数组中最大值和最小值的一些方法.   法一:其实利用 ...

  9. CSS 选择符有哪些?哪些属性可以继承?优先级算法如何计算?

    CSS 选择符有哪些? 1.id选择器(#id) 2.类选择器(.class) 3.标签选择器(div,h1,p) 4.相邻选择器(h1 + p) 5.子选择器(ul > li) 6.后代选择器 ...

  10. 02-22 决策树C4.5算法

    目录 决策树C4.5算法 一.决策树C4.5算法学习目标 二.决策树C4.5算法详解 2.1 连续特征值离散化 2.2 信息增益比 2.3 剪枝 2.4 特征值加权 三.决策树C4.5算法流程 3.1 ...