使用confluent将Kafka中的数据入库hive失败的解决方案
应用场景:
用户想在 HD平台使用confluent开源组件将Kafka中的数据直接导入到hive中,测试环境中已经实现,但生产环境中由于平台开启了Kerberos安全认证服务,所以一直报认证失败的日志.
confluent:
confluent将数据导入hive库: 先将数据导入到hdfs上指定的目录下,然后通过外表的形式入库hive.
confluent通过metastore服务(thirft://url:9083))获取hive的元数据.
官网配置文档:
数据导入hdfs的配置:
`name=hdfs-sink`
`connector.class=io.confluent.connect.hdfs.HdfsSinkConnector`
`tasks.max=1`
`topics=test_hdfs`
`hdfs.url=hdfs://localhost:9000`
`flush.size=3`
数据直接入户hive需要增加的配置:
`hive.integration=true`
`hive.metastore.uris=thrift://localhost:9083 `
`schema.compatibility=BACKWARD`
如果平台有Kerberos安全认证需要增加的配置:
`hdfs.authentication.kerberos=true`
`connect.hdfs.principal=connect-hdfs/_HOST@YOUR-REALM.COM`
`connect.hdfs.keytab=path to the connector `
`keytab
hdfs.namenode.principal=namenode principal`