Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Connect implementation errors

I was running through the tutorial here: http://kafka.apache.org/documentation.html#introduction

When I get to "Step 7: Use Kafka Connect to import/export data" and attempt to start two connectors I am getting the following errors:

ERROR Failed to flush WorkerSourceTask{id=local-file-source-0}, timed out while waiting for producer to flush outstanding messages, 1 left

ERROR Failed to commit offsets for WorkerSourceTask

Here is the portion of the tutorial:

Next, we'll start two connectors running in standalone mode, which means they run in a single, local, dedicated process. We provide three configuration files as parameters. The first is always the configuration for the Kafka Connect process, containing common configuration such as the Kafka brokers to connect to and the serialization format for data. The remaining configuration files each specify a connector to create. These files include a unique connector name, the connector class to instantiate, and any other configuration required by the connector. bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties

I have spent some time looking for a solution, but was unable to find anything useful. Any help is appreciated.

Thanks!

like image 925
M. Carlson Avatar asked Feb 18 '16 03:02

M. Carlson


People also ask

Is Kafka connect mandatory?

No, it is not required, but it is recommended if you plan to use Avro for a data format. This is because it can help you with serialization and schema evolution as described here.

How do you handle failed messages in Kafka?

The source code for a Dead Letter Queue implementation contains a try-cath block to handle expected or unexpected exceptions. The message is processed if no error occurs. Send the message to a dedicated DLQ Kafka topic if any exception occurs. The failure cause should be added to the header of the Kafka message.


2 Answers

The reason I was getting this error was because the first server I created using the config/server.properties was not running. I am assuming that because it is the lead of the topic, the messages could not be flushed and the offsets could not be committed.

Once I started the kafka server using the server propertes (config/server.properties) This issue was resolved.

like image 58
M. Carlson Avatar answered Sep 21 '22 20:09

M. Carlson


You need to start Kafka server and Zookeeper before running Kafka Connect. You need to exec the cmds in "Step 2: Start the server" below first:

bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties

from here:https://mail-archives.apache.org/mod_mbox/kafka-users/201601.mbox/%3CCAK0BMEpgWmL93wgm2jVCKbUT5rAZiawzOroTFc_A6Q=GaXQgfQ@mail.gmail.com%3E

like image 26
Will.Fu Avatar answered Sep 21 '22 20:09

Will.Fu