我有一个奇怪的问题卡夫卡-> elasticsearch连接器。当我第一次开始这一切的时候,我收到了elasticsearch中的一个新数据,并通过kibana仪表板检查了它,但是当我使用同一个生产者应用程序向kafka生成了新的数据,并试图再次启动连接器时,我没有在elasticsearch中获得任何新数据。现在我收到了这样的错误:
[2018-02-04 21:38:04,987] ERROR WorkerSinkTask{id=log-platform-elastic-0} Commit of offsets threw an unexpected exception for sequence number 14: null (org.apache.kafka.connect.runtime.WorkerSinkTask:233)
org.apache.kafka.connect.errors.ConnectException: Flush timeout expired with unflushed records: 15805我使用next命令运行连接器:
/usr/bin/connect-standalone /etc/schema-registry/connect-avro-standalone.properties log-platform-elastic.propertiesconnect-avro-standalone.properties
bootstrap.servers=kafka-0.kafka-hs:9093,kafka-1.kafka-hs:9093,kafka-2.kafka-hs:9093
key.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://localhost:8081
value.converter=io.confluent.connect.avro.AvroConverter
value.converter.schema.registry.url=http://localhost:8081
internal.key.converter=org.apache.kafka.connect.json.JsonConverter
internal.value.converter=org.apache.kafka.connect.json.JsonConverter
internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false
offset.storage.file.filename=/tmp/connect.offsets
# producer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor
# consumer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor
#rest.host.name=
rest.port=8084
#rest.advertised.host.name=
#rest.advertised.port=
plugin.path=/usr/share/java和log-platform-elastic.properties
name=log-platform-elastic
key.converter=org.apache.kafka.connect.storage.StringConverter
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=1
topics=member_sync_log, order_history_sync_log # ... and many others
key.ignore=true
connection.url=http://elasticsearch:9200
type.name=log我检查了到kafka代理、elasticsearch和schema-注册表(模式-注册表和连接器在同一主机上)的连接,一切都很好。Kafka经纪人在端口9093上运行,我可以使用kafka-avro-控制台-使用者从主题中读取数据。我很感激你在这方面的任何帮助!
发布于 2019-07-22 16:29:40
只需更新flush.timeout.ms到大于10000 (10秒,这是默认的)
根据文件:
flush.timeout.ms用于定期刷新的超时(毫秒),以及在等待已完成的请求在添加记录时可用的缓冲区空间时使用的超时。如果超过此超时,则任务将失败。 类型:长默认值: 10000重要性:低
https://stackoverflow.com/questions/48613433
复制相似问题