当前位置: 首页 > 知识库问答 >
问题:

启动Zookeeper和Kafka服务器文件意外

白宏义
2023-03-14

我是Kafka的初学者

1/我下载了Kafka的1.0.0版本

2/I更改了bith server.properties和zookeeper.properties中的数据目录位置属性

你能帮帮我吗?

共有1个答案

利海阳
2023-03-14

我假设每个用户自己的文件夹中的zookeeper&kafka为“Kafkaflume”

在kafkaflume文件夹中有两个文件夹:一个是zookeeper,另一个是kafka。这里还提供了配置文件:flumekafka.conf

您需要根据您的要求编辑此文件。

打开一个终端,转到zookeeper文件夹并启动它:

bin/zkServer.sh start

打开另一个终端,转到kafka文件夹并将其启动为:

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

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic  <topicname>
# Name the components on this agent
agent.sources = r1
agent.sinks =  k2
agent.channels = c1


# Describe/configure the source
agent.sources.r1.type = org.apache.flume.source.kafka.KafkaSource
agent.sources.r1.zookeeperConnect = localhost:2181
agent.sources.r1.topic = <topicname>
agent.sources.r1.groupId = group1
agent.sources.r1.channels = c1
agent.sources.r1.interceptors = i1
agent.sources.r1.interceptors.i1.type = timestamp
agent.sources.r1.kafka.consumer.timeout.ms = 10000



# Describing/Configuring the sink
 agent.sinks.k2.type = hdfs
 agent.sinks.k2.hdfs.path =  hdfs://localhost:8020/user/<username>/<foldername>/%y-%m-%d
 agent.sinks.k2.hdfs.rollInterval = 5
 agent.sinks.k2.hdfs.rollSize = 0
 agent.sinks.k2.hdfs.rollCount = 0
 agent.sinks.k2.hdfs.fileType = DataStream
 agent.sinks.k2.channel = c1


# Describing/Configuring the channel agent.channels.MemChannel.type = memory
 agent.channels.c1.type=memory
 agent.channels.c1.capacity = 10000
 agent.channels.c1.transactionCapacity = 1000
 类似资料:
  • 我使用的是一个Java应用程序,它让消费者开始阅读Kafka主题。每次我需要启动消费者应用程序时,我都必须使用cmd中的命令启动Zookeeper和Kafka服务器。是否可以用小型Java程序启动/停止它们?非常感谢。

  • 我正在亚马逊EC2和ubuntu上运行Kafka。首先,我尝试运行zookeeper服务器并创建一个测试主题。最终目的是将spark与Kafka结合起来进行情感分析。 当我尝试启动zookeeper服务器时,我收到以下警告,并且进程似乎没有结束,即键入此命令后,我没有看到shell提示:bin/zookeeper服务器启动。sh配置/zookeeper。属性 警告配置中未定义配置或未定义仲裁,以独

  • 到目前为止,在运行Spring Boot应用程序之前,我已经从命令行启动了zookeeper和kafka server,但现在我需要直接从代码启动它们。 首先,我已经尝试在main方法中使用ProcessBuilder: 但这似乎不起作用,因为控制台上没有打印任何内容,过了一段时间,应用程序抛出一个TimeoutException。 第二,我想让kafka服务器在Zookeeper启动后运行;一个

  • 我使用的是Kafka版本Kafka2.12-2.4.1 我已验证不存在防火墙问题 已验证端口可用 我只需下载tar,解压缩它并修改配置中zookeeper.properties文件中的dataDir属性,以指向自定义zookeeper文件夹 将kafka2.12-2.4.1/bin/windows添加到环境变量 使用与Kafka打包的zookeeper 使用windows 7 我知道连接还没有建立

  • 我使用Zookeeper和Kafka作为使用Java的消息传递用例。我以为当您重新启动Zookeeper和Kafka服务器时,消费者组详细信息会被删除。但他们没有。zookeeper会将消费者组详细信息保存在某种文件中吗? 如果我想重置消费者组,我应该手动删除消费者组详细信息吗? 任何人都可以向我澄清这一点吗?

  • 我在windows中启动Kafka服务器时遇到问题 命令\bin\windows\kafka服务器启动。球棒\配置\服务器。属性 错误消息: 该命令的语法不正确。错误:无法找到或加载主类文件\IBM\WebSphere 知道吗?