我正在尝试遵循Apache Kafka(http://kafka.apache.org/quickstart#quickstart_kafkaconnec)主页上的教程,但是当我进入使用Kafka Connect进行导入和导出的部分时,我将创建文件:
echo -e "foo\nbar" > test.txt
然后运行命令初始化连接器:
bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties
但是什么也没发生。没有消息发送。甚至文件“ test.sink.txt”也不会出现。
我检查文件:connect-file-source和connect-file-sink,它们看起来不错:
name=local-file-source
connector.class=FileStreamSource
tasks.max=1
file=test.txt
topic=connect-test
并且:
name=local-file-sink
connector.class=FileStreamSink
tasks.max=1
file=test.sink.txt
topics=connect-test
当我跑步时:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic connect-test --from-beginning
要查看消息,不仅不显示任何内容:
jonathangomez$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic connect-test --from-beginning
[2018-10-03 01:19:42,901] WARN [Consumer clientId=consumer-1, groupId=console-consumer-30141] 1 partitions have leader brokers without a matching listener, including [connect-test-0] (org.apache.kafka.clients.NetworkClient)
但是主题“ connect-test”出现在主题列表中,带有:
bin/kafka-topics.sh --list --zookeeper localhost:2181
结果如下:
jonathangomez$ bin/kafka-topics.sh --list --zookeeper localhost:2181
__consumer_offsets
connect-test
my-replicated-topic
pageviews
test
users
我正在macOS Sierra 10.12.6和Apache Kafka 2.11-2.0.0上运行此命令。