storm如何消费tdh kafka的数据


#1

Hi,

开源Storm如何访问开启Kerberos认证的星环平台kafka?有无storm-kafka依赖包可用?

Lucy


#2


#3

Kafka安全配置示例如下

//确保keytab文件位置正确且可访问
String jaasconfig= "com.sun.security.auth.module.Krb5LoginModule required  useKeyTab=true storeKey=true keyTab=\"/etc/kafka1/conf/kafka.keytab\" principal=\"kafka/tdh030@CNPC.TDH\";";
 
Properties properties=new Properties();
properties.put("bootstrap.servers","broker:9092");
properties.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
properties.put("value.deserializer","org.apache.kafka.common.serialization.StringDeserializer");
//安全认证配置
properties.put("security.protocol","SASL_PLAINTEXT");
properties.put("sasl.mechanism","GSSAPI");
properties.put("sasl.kerberos.service.name","kafka");
properties.put("sasl.jaas.config", jaasconfig);

#4

非常感谢,我试一下


#5

非常感谢!


在线客服
在线客服
微信客服
微信客服