MAPREDUCE服务 MRS-Producer发送数据失败,报错“TOPIC_AUTHORIZATION_FAILED”:解决办法

时间:2024-08-27 10:23:51

解决办法

  1. 配置自定义配置“allow.everyone.if.no.acl.found”参数为“true”,重启Kafka服务。
  2. 采用具有权限用户登录。

    例如:

    kinit test_user

    或者赋予用户相关权限。

    需要使用Kafka管理员用户(属于kafkaadmin组)操作。

    例如:

    kafka-acls.sh --authorizer-properties zookeeper.connect=10.5.144.2:2181/kafka --topic topic_acl --producer --add --allow-principal User:test

    [root@10-10-144-2 client]# kafka-acls.sh --authorizer-properties zookeeper.connect=8.5.144.2:2181/kafka --list --topic topic_acl
    Current ACLs for resource `Topic:topic_acl`: 
     User:test_user has Allow permission for operations: Describe from hosts: *
     User:test_user has Allow permission for operations: Write from hosts: *
      User:test has Allow permission for operations: Describe from hosts: *
      User:test has Allow permission for operations: Write from hosts: *

  3. 用户加入Kafka组或者Kafkaadmin组。
support.huaweicloud.com/trouble-mrs/mrs_03_0061.html