Exception in thread "main" org.I0Itec.zkclient.exception.ZkAuthFailedException: Authentication failure is thrown while creating kafka topic

个问题,截止 Deepak Sharma  2016年11月09日 09:36 Kafkasecurity

when i try to create topic in kafka using non kafka admin user with following command:

usr/hdp/current/kafka-broker/bin/kafka-topics.sh --create --zookeeper <zk_url> --replication-factor 1 --partitions 1 --topic kafka_topic

  1. [2016-11-09 09:20:32,716] WARN Could not login: the client is being asked for a password, but the Zookeeper client code does not currently support obtaining a password from the user. Make sure that the client is configured to use a ticket cache (using the JAAS configuration setting 'useTicketCache=true)' and restart the client. If you still get this message after that, the TGT in the ticket cache has expired and must be manually refreshed. To do so, first determine if you are using a password or a keytab. If the former, run kinit in a Unix shell in the environment of the user who is running this Zookeeper client using the command 'kinit <princ>' (where <princ> is the name of the client's Kerberos principal). If the latter, do 'kinit -k -t <keytab> <princ>' (where <princ> is the name of the Kerberos principal, and <keytab> is the location of the keytab file). After manually refreshing your cache, restart this client. If you continue to see this message after manually refreshing your cache, ensure that your KDC host's clock is in sync with this host's clock. (org.apache.zookeeper.client.ZooKeeperSaslClient)[2016-11-09 09:20:32,719] WARN SASL configuration failed: javax.security.auth.login.LoginException: No password provided Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it. (org.apache.zookeeper.ClientCnxn)Exception in thread "main" org.I0Itec.zkclient.exception.ZkAuthFailedException: Authentication failureat org.I0Itec.zkclient.ZkClient.waitForKeeperState(ZkClient.java:946)at org.I0Itec.zkclient.ZkClient.waitUntilConnected(ZkClient.java:923)at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1230)at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:156)at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:130)at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:75)at kafka.utils.ZkUtils$.apply(ZkUtils.scala:57)at kafka.admin.TopicCommand$.main(TopicCommand.scala:54)at kafka.admin.TopicCommand.main(TopicCommand.scala)

but when i run same command as kafka user then it works, any clue on this ?

Note: this is a secure cluster

 
 
 0
最佳解答

个解答,截止Balint Molnar  · 2016年11月11日 09:55

If the cluster is kerberized only one user can create new topic with command:

  1. bin/kafka-topics.sh --create --zookeeper <you zk node> --replication-factor 1 --partitions 1 --topic kafka_topic

This user is the user who runs the kafka broker, this is a zookeeper security limitation but there is a property in kafka auto.create.topics.enable, if this one is set to true the required topic will be created if the user produce/consume message.

  1. bin/kafka-console-producer.sh --broker-list broker address --topic kafka_topic --security-protocol SASL_PLAINTEXT

This command will create the kafka_topic, with different users.

https://community.hortonworks.com/questions/65575/exception-in-thread-main-orgi0iteczkclientexceptio.html

Exception in thread "main" org.I0Itec.zkclient.exception.ZkAuthFailedException: Authentication failure is thrown while creating kafka topic的更多相关文章

  1. springboot 和 mongdb连接问题 Exception in thread "main" com.mongodb.MongoSecurityException:

    1 Exception in thread "main" com.mongodb.MongoSecurityException: Exception authenticating ...

  2. 【原创】大叔问题定位分享(8)提交spark任务报错 Caused by: java.lang.ClassNotFoundException: org.I0Itec.zkclient.exception.ZkNoNodeException

    spark 2.1.1 一 问题重现 spark-submit --master local[*] --class app.package.AppClass --jars /jarpath/zkcli ...

  3. zookeeper报错: org.I0Itec.zkclient.exception.ZkMarshallingError: java.io.EOFException

    zookeeper报错: org.I0Itec.zkclient.exception.ZkMarshallingError: java.io.EOFException 主要因为是没有序列化. 可以使用 ...

  4. java.lang.ClassNotFoundException: org.I0Itec.zkclient.exception.ZkNoNodeException 异常 如何处理

    严重: Context initialization failed java.lang.NoClassDefFoundError: org/I0Itec/zkclient/exception/ZkNo ...

  5. Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brandControl ...

  6. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    学习架构探险,从零开始写Java Web框架时,在学习到springAOP时遇到一个异常: "C:\Program Files\Java\jdk1.7.0_40\bin\java" ...

  7. Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V

    在学习CGlib动态代理时,遇到如下错误: Exception in thread "main" java.lang.NoSuchMethodError: org.objectwe ...

  8. GUI学习中错误Exception in thread "main" java.lang.NullPointerException

    运行时出现错误:Exception in thread "main" java.lang.NullPointerException 该问题多半是由于用到的某个对象只进行了声明,而没 ...

  9. zookeeper_service 出错 java.lang.NoClassDefFoundError: org/I0Itec/zkclient/exception/ZkNoNodeException

    2016-12-18 08:28:07 ContextLoader:358 ERROR - Context initialization failed java.lang.NoClassDefFoun ...

随机推荐

  1. spring mvc多个请求的影响 和使用全局变量

    对于那些会以多线程运行的单例类(比如spring mvc中的controller,dao,service): 局部变量不会受多线程影响 成员变量会受到多线程影响 如果方法里有成员变量,只有读操作,不受 ...

  2. PHP全栈学习笔记8

    面向对象的基本概念,面向对象编程,oop,面向对象,面向对象的分析,面向对象的设计,面向对象的编程,什么是类. 类,属性和方法,类,对象,面向对象编程的三大特点.特点,封装性,继承性,多态性. 封装性 ...

  3. 由浅入深讲述MVVM

    相信首次听说MVVM的人,内心都是充满疑惑的!这是个嘛???能干嘛??? MVVM是Model-View-ViewModel的简写.它本质上就是MVC (Model-View- Controller) ...

  4. springboot结合maven打包发布

    本篇分享如何使用maven便利我们打springboot的发布包:我这里使用的是idea开发工具,首先创建了多个module的项目结构,如图: 要对多个module的项目做打包,一般情况都是在父级po ...

  5. IdentityServer4 中文文档与实战

    写在前面 写于2018.9.12 我研究 IdentityServer4 是从.net core 1.1的时候开始的,那时候国内的中文资料比较少,我都是按照官方文档来研究的,整理成了笔记.这个系列文档 ...

  6. Activity、Fragment、Dialog基类简单整理

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 这里简单记录下Activity.Fragment.Dialog基类中的常规写法,后续根据项目需求进行相应的扩展. BaseActiv ...

  7. 强化学习(十)Double DQN (DDQN)

    在强化学习(九)Deep Q-Learning进阶之Nature DQN中,我们讨论了Nature DQN的算法流程,它通过使用两个相同的神经网络,以解决数据样本和网络训练之前的相关性.但是还是有其他 ...

  8. 使用Atlas进行元数据管理之Glossary(术语)

    背景:笔者和团队的小伙伴近期在进行数据治理/元数据管理方向的探索, 在接下来的系列文章中, 会陆续与读者们进行分享在此过程中踩过的坑和收获. 元数据管理系列文章: [0] - 使用Atlas进行元数据 ...

  9. go并发调度原理学习

    aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQAAkACQAAD/4QB0RXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAA

  10. 图片与Base64的转换

    图片转为Base64 // 图片转化成base64字符串 public static String GetImageStr() {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 ...