我在使用分布式kafka连接的kerberized服务器中工作。 连接器工作良好,只是转换部分被完全忽略了。 我没有警告或错误或任何有关此问题的日志信息。
我的连接器无需转换即可正常工作:
{
"name": "hdfs-avro-sink-X",
"config": {
"connector.class": "io.confluent.connect.hdfs.HdfsSinkConnector",
"tasks.max": "1",
"topics": "Y",
"hdfs.url": "HA_name",
"topics.dir": "/data/path",
"logs.dir": "/tmp/path",
"flush.size": "8800",
"rotate.interval.ms": "6000",
"hive.integration": "true",
"hive.database": "hive_db_name",
"hive.metastore.uris": "thrift://url:9083",
"format.class": "io.confluent.connect.hdfs.avro.AvroFormat",
"schema.compatibility": "BACKWARD",
"hive.conf.dir": "/usr/hdp/current/hive/target-conf/",
"hadoop.conf.dir": "/usr/hdp/current/hadoop/target-conf/",
"hdfs.authentication.kerberos": "true",
"connect.hdfs.principal": "principal",
"connect.hdfs.keytab": "/keytab/path",
"ssl.truststore.location": "truststore.jks",
"ssl.truststore.password": "password",
"security.protocol": "SASL_SSL",
"ssl.keystore.location": "keystore.jks",
"ssl.keystore.password": "password",
"ssl.key.password": "password"
}
}
具有转换,转换将被忽略:
{
"name": "hdfs-avro-sink-X",
"config": {
"connector.class": "io.confluent.connect.hdfs.HdfsSinkConnector",
... same conf
"ssl.key.password": "password",
"transforms": "MaskField",
"transforms.MaskField.type": "org.apache.kafka.connect.transforms.MaskField$Value",
"transforms.MaskField.fields": "ano_ass"
}
}
我可以键入任何内容,无论如何它都将被忽略:
{
"name": "hdfs-avro-sink-X",
"config": {
"connector.class": "io.confluent.connect.hdfs.HdfsSinkConnector",
... same conf
"ssl.key.password": "password",
"transforms": "Masgfdgfdgfdhield",
"transforms.MaskField.type": "org.apache.kafka.connect.transforms.MaskField$Value",
"transforms.MaskField.fields": "anfshdghgh_ass"
}
}
ano_ass字段存在于我的Avro模式中 护林员审核没问题
版本:
答案 0 :(得分:1)
如果您正在运行0.10.1,那么SMT还不存在:)超过2.5年前,单消息转换已通过Loading
添加到Apache Kafka的0.10.2版本中。
您可能需要考虑运行Kafka的最新版本,其最新版本为2.3。
看起来像KIP-66,其中包括Apache Kafka 2.0。如果您想要最新版本的Kafka(2.3),则可以从latest version of HDP is 3.1中获得,也可以作为kafka.apache.org的一部分。