Skip to main content
sshimpi
Silver ⭐️⭐️⭐️
Dec 25, 2016 7:02 PM UTC

Ranger Kafka Plugin does not sync policy

  • Oct 5, 2026 9:31 AM UTC
  • 0 replies
  • 1765 views
  • Translate All

SYMPTOM: - Enabled Ranger Kafka plugin via Ambari and restarted kafka service.

- kafka logs still populating with "Ranger Plugin returned null" error - check ranger logs and could not see any info about kafka policy download - checked /etc/ranger/test_kafka/policycache/ and the json file in that is empty!

bash-4.1# cd /etc/ranger/test_kafka/
bash-4.1# cd policycache/
bash-4.1# ls -ltr
total 0
-rw-r--r-- 1 kafka hadoop 0 Mar 2 16:00 kafka_test_kafka.json_old
-rw-r--r-- 1 kafka hadoop 0 Mar 16 11:30 kafka_test_kafka.json_old1
-rw-r--r-- 1 kafka hadoop 0 Mar 16 12:27 kafka_test_kafka.json

- checked Test Connection for Kafka repo in Ranger. It was successful.

- The Ranger plugin audits, did not have info on the kafka plugin sync. - Thus the kafka plugin is not being synced in this case. Policy refresh not working. - Tried deleting the default kafka policy and created a new one however issue still exists. - Tried to use REST API to get the policy details however no output.

ERROR:

2016-03-02 16:47:34,607 ERROR [kafka-request-handler-6] apache.ranger.authorization.kafka.authorizer.RangerKafkaAuthorizer (RangerKafkaAuthorizer.java:202) - Ranger Plugin returned null. Returning false

ROOT CAUSE: Issue was the missing class path /etc/kafka/conf in the kafka-broker process

RESOLUTION: Adding below lines to the Kafka > Advanced kafka-env > kafka-env template config resolved the plugin issue

if [ -f /etc/kafka/conf/kafka-ranger-env.sh ]; then
. /etc/kafka/conf/kafka-ranger-env.sh
fi

Restart Kafka