Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Kafka authentication configuration when submitting consumer kafka applications to spark cluster

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Submitting a consuming kafka application contains sasl.jaas.config, which usually requires a configuration file. However, after the application is typed into a jar package, the configuration file in the jar package cannot be read through classload.

Add properties when you need to initialize kafka.

kafkaParams.put("sasl.jaas.config", "xxxx required\n"+ " accessKey=\"xxxx\"\n"+ " securityKey=\"xxxxx\";");

New lines, colons, quotation marks can not be less

Note that kafka depends on:

org.apache.kafka

kafka-clients

1.0.0

Also remove the kafka dependency from spark-streaming-kafka

org.apache.spark

spark-streaming-kafka-0-10_2.11

2.3.1

org.apache.kafka

kafka-clients

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 204

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report