packetbeat发送数据到pulsar
默认情况下,packetbeat不支持将数据发送到pulsar,因此使用了streamnative开发的kop(kafka on pulsar)来解决这个问题,以下是单机版安装步骤。
一、安装pulsar与kop
1. 下载并安装
wget https://archive.apache.org/dist/pulsar/pulsar-2.9.3/apache-pulsar-2.9.3-bin.tar.gz
tar -zxf apache-pulsar-2.9.3-bin.tar.gz
cd apache-pulsar-2.9.3/
mkdir connectors
cd connectors
wget https://github.91chi.fun/https://github.com//streamnative/kop/releases/download/v2.9.3.7/pulsar-protocol-handler-kafka-2.9.3.7.nar #下载kop,并放到特定目录下。kop版本要与pulsar版本保持一致。
cd ..
2. 修改pulsar配置
vim conf/standalone.conf (集群版就修改conf/broker.conf)
# 加入以下配置
messagingProtocols=kafka
protocolHandlerDirectory=/home/apache-pulsar-2.9.3/connectors
allowAutoTopicCreationType=partitioned # 此处默认为non-partitioned,修改为partitioned
# By default, allowAutoTopicCreationType is set to non-partitioned. Since topics are partitioned by default in Kafka,
# it's better to avoid creating non-partitioned topics for Kafka clients unless Kafka clients need to interact
# with existing non-partitioned topics.
kafkaListeners=PLAINTEXT://127.0.0.1:9092
kafkaAdvertisedListeners=PLAINTEXT://127.0.0.1:9092
brokerEntryMetadataInterceptors=org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor
brokerDeleteInactiveTopicsEnabled=false #默认为true,此处修改为false
3. 启动pulsar
bin/pulsar standalone
此时,pulsar就可以接收kafka协议的数据。
二、配置packetbeat将数据发送到kafka
vim packetbeat/packetbeat.yml
# -------------------------------- Kafka Output --------------------------------
output.kafka:
# Boolean flag to enable or disable the output module.
enabled: true
hosts: ["localhost:9092"]
topic: dns_topic
version: 2.0.0 # 注意版本指定为2.0.0
codec.json:
pretty: false
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
2021-09-12 centos升级python后,要修改的文件