首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zookeeper错误:未设置dataDir

Zookeeper错误:未设置dataDir
EN

Stack Overflow用户
提问于 2017-01-15 06:50:24
回答 3查看 4.9K关注 0票数 4

我正在使用kafka快速入门教程来设置生产者-消费者连接。https://kafka.apache.org/quickstart

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

代码语言:javascript
复制
bin/zookeeper-server-start.sh config/zookeeper.properties

我得到以下错误:

代码语言:javascript
复制
[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快速入门文件夹,但错误仍然存在。我的zookeeper.config文件:

代码语言:javascript
复制
...
# 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

谢谢!

EN

回答 3

Stack Overflow用户

发布于 2017-08-07 23:19:50

导游实际上弄错了..。为了启动Zookeeper,您应该指向config/zookeeper.properties文件。

票数 4
EN

Stack Overflow用户

发布于 2017-08-08 10:20:17

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

Zookeeper应该以zookeeper.properties启动,Kafka应该以server.properties启动。

不要把它们弄混了,否则两者都不会启动

票数 4
EN

Stack Overflow用户

发布于 2020-07-14 13:40:05

在windows上试试这个:

对于zookeeper:

代码语言:javascript
复制
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

对于Kafka服务器:

代码语言:javascript
复制
.\bin\windows\kafka-server-start.bat .\config\server.properties
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41655869

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档