【发布时间】:2020-06-11 23:29:55
【问题描述】:
以下是我的 kafka 连接器 json 文件:
curl -s -k -X POST http://cpnode.local.lan:8083/connectors -H "Content-Type: application/json" --data '{
"name":"jdbc-Hdfs2-Sink-Connector",
"config":{
"tasks.max":"1",
"batch.size":"1000",
"batch.max.rows":"1000",
"hdfs.poll.interval.ms":"500",
"connector.class":"io.confluent.connect.hdfs.HdfsSinkConnector",
"hdfs.url":"hdfs://hadoopnode.local.lan:9000",
"topics":"BookList2",
"flush.size":"1",
"confluent.topic.bootstrap.servers":"cpnode.local.lan:9092",
"confluent.topic.replication.factor":"1",
"value.converter":"io.confluent.connect.avro.AvroConverter",
"value.converter.schemas.enable":"true",
"value.converter.schema.registry.url":"http://cpnode.local.lan:8081",
"key.converter":"io.confluent.connect.avro.AvroConverter",
"key.converter.schemas.enable":"true",
"key.converter.schema.registry.url":"http://cpnode.local.lan:8081"
}
}' | jq '.'
当我尝试使用此连接器时,出现以下错误:
{
"name": "jdbc-Hdfs2-Sink-Connector",
"connector": {
"state": "RUNNING",
"worker_id": "192.168.1.153:8083"
},
"tasks": [
{
"id": 0,
"state": "FAILED",
"worker_id": "192.168.1.153:8083",
"trace": "org.apache.kafka.connect.errors.ConnectException: org.apache.hadoop.security.AccessControlException: Permission denied: user=cp-user, access=WRITE, inode=\"/\":hadoop:supergroup:drwxr-xr-x
我已经尝试过export HADOOP_USER_NAME=hdfs 并且还
hadoop配置hdfs-site.xml
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
但我想要一个不影响安全性的解决方案。
cp-user 是我的融合平台用户的名称... confluent 和 hdfs 都在不同的虚拟机上
提前谢谢....
【问题讨论】:
-
PS:我使用的是hadoop-2.9.2和confluent platform 5.4.0
标签: hadoop apache-kafka hdfs apache-kafka-connect