目录
- 背景
- 第一部分
- 参考文献及资料
背景
https://docs.spring.io/spring-kafka/api/org/springframework/kafka/core/KafkaTemplate.html
https://blog.csdn.net/justry_deng/article/details/88387898
Spark Kafka Consumer in secure( Kerberos) enviornment
Sample Application
using direct stream
1 | import kafka.serializer.StringDecoder; |
using createStream
1 | import kafka.serializer.StringDecoder |
kafka_jaas.conf (for spark local mode)
1 | KafkaServer { |
kafka_jaas.conf (for spark yarn client mode)
1 | KafkaClient { |
Spark Submit command
kinit from kafka user..
1 | spark-submit --files /etc/kafka/conf/kafka_jaas.conf,/etc/security/keytabs/kafka.service.keytab --conf "spark.executor.extraJavaOptions=-Djava.security.auth.login.config=/etc/kafka/conf/kafka_jaas.conf" --driver-java-options "-Djava.security.auth.login.config=/etc/kafka/conf/kafka_jaas.conf" --class SparkKafkaConsumer2 --master local[2] |
参考文献及资料
1、