“此时log4j.properties 出乎意料";尝试在 Windows 中启动 Zookeeper 时 [英] "log4j.properties was unexpected at this time" while trying to start Zookeeper in windows

查看:34
本文介绍了“此时log4j.properties 出乎意料";尝试在 Windows 中启动 Zookeeper 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Confluent 的 kafka 流下载 (http://www.confluent.io/产品/卡夫卡流/).

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

我正在按照说明在 Windows 上运行 Zookeeper 和 Kafka.但是当我尝试使用命令启动 ZooKeeper 时D:\Softwares\confluent-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 command D:\Softwares\confluent-3.0.1\bin\windows>zookeeper-server-start.bat ./etc/kafka/zookeeper.properties, I get the error

D:\Softwares\confluent-3.0.1\bin\windows../../etc/kafka/log4j.properties 此时出乎意料.

D:\Softwares\confluent-3.0.1\bin\windows../../etc/kafka/log4j.properties was unexpected at this time.

如果我检查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:\Program Files (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 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆