栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

kafka SASL认证失败原因(failed authentication due to: Authentication failed: Invalid username or password)

kafka SASL认证失败原因(failed authentication due to: Authentication failed: Invalid username or password)

  • 最近在Linux系统搭建kafka的过程中,为了安全性,使用了SASL的认证模式,遇到如下报错?
    ERROR [KafkaServer id=0] Connection to node 0 (hh.com/ip:9092) failed authentication due to: Authentication failed: Invalid username or password (org.apache.kafka.clients.NetworkClient)
    [2021-7-14 16:52:] WARN Authentication failed: Invalid username or password (kafka.utils.CoreUtils$)
    org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed: Invalid username or password

  • 解答:zookeeper 的sasl的配置文件如下:
Server {
    org.apache.kafka.common.security.plain.PlainLoginModule required
    username="cluster"
    password="admin_pwd"
    user_kafka="kafka_pwd";
};

kafka SASL配置文件如下:其中 username="admin"
 password="1234admin" 和
 user_admin="1234admin" 配置中必须保持一致,不然就会报错

KafkaServer {
 org.apache.kafka.common.security.plain.PlainLoginModule required
 username="admin"
 password="1234admin"
 user_admin="1234admin"
 user_alice="alice1213" ;
};
Client {
 org.apache.kafka.common.security.plain.PlainLoginModule required  
 username="kafka"
 password="kafka_pwd";
};

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/350660.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号