简体   繁体   English

是否有开源 Kafka Cassandra 连接器配置的示例?

[英]Is there a sample example of opensource Kafka Cassandra connector configuration?

We are feeding events (logs) from Logstash to Apache Cassandra using the PerimeterX Cassandra Logstash out plugin.我们使用PerimeterX Cassandra Logstash out 插件将事件(日志)从 Logstash 提供给 Apache Cassandra。 We have hit the max throughput of the plugin to be 8K as it opens only 2 connections to Cassandra whereas Cassandra has a much higher throughput (for consuming data) and we expecting a throughput on the actual system to be 30K or higher.我们已经将插件的最大吞吐量达到了 8K,因为它只打开了 2 个到 Cassandra 的连接,而 Cassandra 的吞吐量要高得多(用于消耗数据),我们预计实际系统的吞吐量为 30K 或更高。

Here throughput is the capacity to consume the incoming events, which is x units/sec这里的吞吐量是消耗传入事件的能力,即 x 单位/秒

Hence we planned to introduced Kafa in the middle which has a 45K throughput with Logstash output.因此我们计划在中间引入 Kafa,它具有 45K 的吞吐量和 Logstash 输出。

We are looking at an open-source alternative of Kafka to Cassandra integration.我们正在寻找 Kafka 到 Cassandra 集成的开源替代方案。

We are looking for help from this stack overflow post.我们正在从这个堆栈溢出帖子中寻求帮助。 We could configure the connector JAR as mentioned in the documentation .我们可以像文档中提到的那样配置连接器 JAR。 But there is no proper guide or current documentation is very confusing and goes in a loop with the configuration requirement.但是没有适当的指南或当前文档非常混乱并且与配置要求循环。 We don't see the plugin being called when Kafka is running with the target topic.当 Kafka 与目标主题一起运行时,我们没有看到插件被调用。

Some help what is the correct configuration or some sample to link topic to table in Cassandra keyspace will be helpful.一些帮助什么是正确的配置或一些示例将主题链接到 Cassandra 键空间中的表会有所帮助。

After placing the JAR as mentioned in the documentation We need to run Kafka connect which will show all the connectors configured.按照文档中的说明放置 JAR 后,我们需要运行 Kafka connect,它将显示所有已配置的连接器。 To turn on Kafka connect run the below command (Kafka connect in distributed mode)要打开 Kafka 连接,请运行以下命令(分布式模式下的 Kafka 连接)

bin/connect-distributed.sh config/connect-distributed.properties bin/connect-distributed.sh 配置/connect-distributed.properties

Kafka connect has a REST API service available at http://localhost:8083 using this REST API you can configure your connectors. Kafka connect 在 http://localhost:8083 有一个 REST API 服务,使用这个 REST API 你可以配置你的连接器。

To register the connector use the below API要注册连接器,请使用以下 API

POST /connectors – creates a new connector; POST /connectors – 创建一个新的连接器; the request body should be a JSON object containing a string name field and an object config field with the connector configuration parameters请求正文应该是一个 JSON 对象,其中包含一个字符串名称字段和一个带有连接器配置参数的对象配置字段

The JSON sample to register the connector is present kafka-connect-cassandra-sink-1.4.0.tar.gz file.用于注册连接器的 JSON 示例存在于 kafka-connect-cassandra-sink-1.4.0.tar.gz 文件中。

The official-documentation provides a list with all endpoints.官方文档提供了一个包含所有端点的列表。

More info available here此处提供更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM