尝试在Windows中启动Zookeeper时

尝试在Windows中启动Zookeeper时

本文介绍了“ log4j.properties在这时是意外的”。尝试在Windows中启动Zookeeper时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用从Confluent下载的kafka流()。

I am using kafka stream download from Confluent (http://www.confluent.io/product/kafka-streams/).

我正在按照说明在Windows上运行Zookeeper和Kafka。但是,当我尝试使用
D命令启动ZooKeeper时:\软件wareconfluent-3.0.1\bin\windows> zookeeper-server-start.bat ./etc/ kafka / zookeeper.properties ,出现错误

I am following the instructions to run Zookeeper and Kafka on Windows. But while I try to start ZooKeeper using the commandD:\Softwares\confluent-3.0.1\bin\windows>zookeeper-server-start.bat ./etc/kafka/zookeeper.properties, I get the error

如果我检查了 zookeeper-server-start.bat文件,命令看起来不错,如下所示。confluent-3.0.1\etc\kafka目录下也存在log4j.properties文件

If I check the "zookeeper-server-start.bat" file the commands look ok and is like below.There also exists log4j.properties file under directory confluent-3.0.1\etc\kafka

IF [%1] EQU [] (
    echo USAGE: %0 zookeeper.properties
    EXIT /B 1
  )


SetLocal
IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] (
    if exists %~dp0../../etc/kafka/log4j.properties (
        set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../etc/kafka/log4j.properties
    ) else (
        set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../config/log4j.properties
    )
)

IF ["%KAFKA_HEAP_OPTS%"] EQU [""] (
    set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M
)

%~dp0kafka-run-class.bat org.apache.zookeeper.server.quorum.QuorumPeerMain %*
EndLocal






推荐答案

将kafka下载的发行版放入 C:\程序文件(x86)。将kafka下载的发行版移动到c驱动器以外的其他驱动器对我有用。

I was getting same error when I placed kafka downloaded distribution in C:\Program Files (x86). Moving kafka downloaded distribution to some other drive other then c drive worked for me.

查找以下工作命令:
D:\ kafka_2.12-2.2.0\kafka_2.12-2.2.0> bin\windows\zookeeper-server-start.bat config / zookeeper.properties

Find below working commands:D:\kafka_2.12-2.2.0\kafka_2.12-2.2.0>bin\windows\zookeeper-server-start.bat config/zookeeper.properties

Kafka是从其官方网站下载的:

Kafka was downloaded from it's official site:

https://kafka.apache.org/quickstart

这篇关于“ log4j.properties在这时是意外的”。尝试在Windows中启动Zookeeper时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 02:03