kafka汇合错误java.lang.IllegalArgumentException:/tmp/confluent.PVghAKRg/zookeeper/data/myid文件丢失

时间:2018-04-09 11:23:48

标签: apache-kafka confluent-kafka

我在3个节点上通过Confluent平台运行Kafka,但是当我运行confluent start时出现此错误:

[2018-04-09 10:54:25,995] INFO Reading configuration from: /tmp/confluent.SVNfiLFU/zookeeper/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2018-04-09 10:54:26,011] INFO Resolved hostname: 0.0.0.0 to address: /0.0.0.0 (org.apache.zookeeper.server.quorum.QuorumPeer)
[2018-04-09 10:54:26,011] INFO Resolved hostname: 192.168.0.36 to address: /192.168.0.36 (org.apache.zookeeper.server.quorum.QuorumPeer)
[2018-04-09 10:54:26,011] INFO Resolved hostname: 192.168.0.22 to address: /192.168.0.22 (org.apache.zookeeper.server.quorum.QuorumPeer)
[2018-04-09 10:54:26,011] INFO Defaulting to majority quorums (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2018-04-09 10:54:26,012] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /tmp/confluent.SVNfiLFU/zookeeper/zookeeper.properties
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:154)
        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: /tmp/confluent.SVNfiLFU/zookeeper/data/myid file is missing
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:406)
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:150)
        ... 2 more

这是zookeeper.properties:

dataDir=/var/lib/zookeeper/
clientPort=2181
initLimit=5
syncLimit=2
tickTime=2000

server.1=192.168.0.21:2888:3888
server.2=192.168.0.22:2888:3888
server.3=192.168.0.36:2888:3888

另外,我在myid目录

中创建了包含整数id的/var/lib/zookeeper/文件

1 个答案:

答案 0 :(得分:0)

您需要在每台服务器上运行zookeeper-server-start.sh zookeeper.properties个人。

confluent command is only for single node testing(强调补充)

  

仅用于开发目的,不适用于生产环境。产生的数据是瞬态的,并且是临时的

这解释了为什么您在/ tmp

中收到有关文件的错误