Apache kafka Zookeeper错误:未设置dataDir

Apache kafka Zookeeper错误:未设置dataDir,apache-kafka,apache-zookeeper,Apache Kafka,Apache Zookeeper,我正在使用卡夫卡快速入门教程设置生产者-消费者连接。 我使用这个教程已经有一段时间了,到现在为止,它工作得非常好。 当我运行zookeeper时: bin/zookeeper-server-start.sh config/zookeeper.properties .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties 我得到以下错误: [2017-01-14 18:57:18,148] INFO Read

我正在使用卡夫卡快速入门教程设置生产者-消费者连接。

我使用这个教程已经有一段时间了,到现在为止,它工作得非常好。 当我运行zookeeper时:

bin/zookeeper-server-start.sh config/zookeeper.properties
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
我得到以下错误:

[2017-01-14 18:57:18,148] INFO Reading configuration from: config/server.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2017-01-14 18:57:18,159] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/server.properties
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:123)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.lang.IllegalArgumentException: dataDir is not set
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:243)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:119)
... 2 more
Invalid config, exiting abnormally
这是在手动终止一些尾部进程之后发生的。我怎样才能克服这个错误?我已经下载了一个新的kafka quickstart文件夹,但错误仍然存在。我的zookeeper.config文件:

...
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0

谢谢大家!

指南实际上是错的。。。要启动Zookeeper,您应该指向config/zookeper.properties文件。

您的启动命令显示了
config/zookeper.properties
,但您的错误消息引用了
config/server.properties

Zookeeper应该用
Zookeeper.properties
启动,Kafka应该用
server.properties
启动

不要混淆这些选项,否则两者都不会启动

请在windows中尝试此选项:

动物园管理员:

bin/zookeeper-server-start.sh config/zookeeper.properties
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
对于Kafka服务器:

.\bin\windows\kafka-server-start.bat .\config\server.properties

您没有在config/zookeeper.properties中设置“dataDir”。请检查该文件以确保其配置符合预期。您好!我的zookeeper.properties文件的dataDir=/tmp/zookeeper/还有clientPort=2181和maxClientCnxns=0可能与我看到的那篇文章重复,但这不是同一个错误你指的zookeeper属性文件是config/zookeeper.properties,对吗?