gpt4 book ai didi

java - 一旦我运行 kafka 服务器命令,Zookeeper 就会自动关闭

转载 作者:行者123 更新时间:2023-11-30 02:05:30 27 4
gpt4 key购买 nike

我正在努力解决一个非常奇怪的问题。这之前可以正常工作,没有任何问题。

我必须启动 Zookeeper 和 Kafka。为此,我执行以下操作:

  1. nohup bin/zookeeper-server-start.sh config/zookeeper.properties &

此后,当我运行 jps 命令时:我可以将 QuaorumPeerMain 视为一个进程,即 Zookeeper 的进程。

现在我运行2. nohup bin/kafka-server-start.sh config/server.properties &

此后,当我运行JPS时,zookeeper的进程也消失了,并且自动关闭。

日志:

[2018-07-25 01:31:21,832] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:os.version=3.10.0-862.3.3.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:user.name=kumar.shorav (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:user.home=/home/kumar.shorav (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,832] INFO Client environment:user.dir=/app/opt/kafka_2.10-0.10.2.1 (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,833] INFO Initiating client connection, connectString=localhost:2181 sessionTimeout=6000 watcher=org.I0Itec.zkclient.ZkClient@8dbdac1 (org.apache.zookeeper.ZooKeeper)
[2018-07-25 01:31:21,849] INFO Waiting for keeper state SyncConnected (org.I0Itec.zkclient.ZkClient)
[2018-07-25 01:31:21,852] INFO Opening socket connection to server localhost.localdomain/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2018-07-25 01:31:21,859] INFO Socket connection established to localhost.localdomain/127.0.0.1:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2018-07-25 01:31:21,862] INFO Accepted socket connection from /127.0.0.1:38370 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-07-25 01:31:21,870] INFO Client attempting to establish new session at /127.0.0.1:38370 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:31:21,871] INFO Creating new log file: log.181 (org.apache.zookeeper.server.persistence.FileTxnLog)
[2018-07-25 01:31:21,874] ERROR Severe unrecoverable error, from thread : SyncThread:0 (org.apache.zookeeper.server.ZooKeeperCriticalThread)
java.io.FileNotFoundException: /tmp/zookeeper/version-2/log.181 (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.apache.zookeeper.server.persistence.FileTxnLog.append(FileTxnLog.java:209)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.append(FileTxnSnapLog.java:314)
at org.apache.zookeeper.server.ZKDatabase.append(ZKDatabase.java:470)
at org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:140)
[2018-07-25 01:31:21,877] INFO Thread SyncThread:0 exits, error code 1 (org.apache.zookeeper.server.ZooKeeperServerListenerImpl)
[2018-07-25 01:31:21,877] INFO SyncRequestProcessor exited! (org.apache.zookeeper.server.SyncRequestProcessor)
[2018-07-25 01:31:21,878] INFO Closed socket connection for client /127.0.0.1:38370 which had sessionid 0x164d01e0a460000 (org.apache.zookeeper.server.NIOServerCnxn)
[2018-07-25 01:31:21,879] INFO Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2018-07-25 01:31:21,879] INFO NIOServerCnxn factory exited run method (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-07-25 01:31:21,880] INFO shutting down (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:31:21,880] INFO Shutting down (org.apache.zookeeper.server.SessionTrackerImpl)
[2018-07-25 01:31:21,881] INFO Shutting down (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-07-25 01:31:21,881] INFO Shutting down (org.apache.zookeeper.server.SyncRequestProcessor)
[2018-07-25 01:31:21,881] INFO PrepRequestProcessor exited loop! (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-07-25 01:31:21,881] INFO shutdown of request processor complete (org.apache.zookeeper.server.FinalRequestProcessor)
[2018-07-25 01:31:21,881] INFO Exiting normally (org.apache.zookeeper.server.ZooKeeperServerMain)
[2018-07-25 01:31:23,914] INFO Opening socket connection to server localhost.localdomain/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)

[2018-07-25 01:51:13,467] INFO Server environment:java.io.tmpdir=/tmp (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,467] INFO Server environment:java.compiler=<NA> (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,467] INFO Server environment:os.name=Linux (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,468] INFO Server environment:os.arch=amd64 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,468] INFO Server environment:os.version=3.10.0-862.3.3.el7.x86_64 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,468] INFO Server environment:user.name=kumar.shorav (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,468] INFO Server environment:user.home=/home/kumar.shorav (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,468] INFO Server environment:user.dir=/app/opt/kafka_2.10-0.10.2.1 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,477] INFO tickTime set to 3000 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,477] INFO minSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,477] INFO maxSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:13,489] INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-07-25 01:51:41,099] INFO Accepted socket connection from /127.0.0.1:40262 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-07-25 01:51:41,107] INFO Client attempting to establish new session at /127.0.0.1:40262 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:41,108] INFO Creating new log file: log.181 (org.apache.zookeeper.server.persistence.FileTxnLog)
[2018-07-25 01:51:41,111] ERROR Severe unrecoverable error, from thread : SyncThread:0 (org.apache.zookeeper.server.ZooKeeperCriticalThread)
java.io.FileNotFoundException: /tmp/zookeeper/version-2/log.181 (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.apache.zookeeper.server.persistence.FileTxnLog.append(FileTxnLog.java:209)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.append(FileTxnSnapLog.java:314)
at org.apache.zookeeper.server.ZKDatabase.append(ZKDatabase.java:470)
at org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:140)
[2018-07-25 01:51:41,113] INFO Thread SyncThread:0 exits, error code 1 (org.apache.zookeeper.server.ZooKeeperServerListenerImpl)
[2018-07-25 01:51:41,113] INFO SyncRequestProcessor exited! (org.apache.zookeeper.server.SyncRequestProcessor)
[2018-07-25 01:51:41,114] INFO Closed socket connection for client /127.0.0.1:40262 which had sessionid 0x164d034b9130000 (org.apache.zookeeper.server.NIOServerCnxn)
[2018-07-25 01:51:41,114] INFO NIOServerCnxn factory exited run method (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-07-25 01:51:41,115] INFO shutting down (org.apache.zookeeper.server.ZooKeeperServer)
[2018-07-25 01:51:41,115] INFO Shutting down (org.apache.zookeeper.server.SessionTrackerImpl)
[2018-07-25 01:51:41,115] INFO Shutting down (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-07-25 01:51:41,115] INFO Shutting down (org.apache.zookeeper.server.SyncRequestProcessor)
[2018-07-25 01:51:41,115] INFO PrepRequestProcessor exited loop! (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-07-25 01:51:41,115] INFO shutdown of request processor complete (org.apache.zookeeper.server.FinalRequestProcessor)
[2018-07-25 01:51:41,116] INFO Exiting normally (org.apache.zookeeper.server.ZooKeeperServerMain)

我不明白为什么会突然出现这个问题。请看一下并帮助我。

enter image description here

最佳答案

如果您仔细查看日志,具体来说,java.io.FileNotFoundException:/tmp/zookeeper/version-2/log.181 (Permission returned) 它会谈论 dataDir 目录权限更改。仅供引用,dataDir是您在zookeeper.properties中指定的目录快照,我想在您的情况下它是:/tmp/zookeeper/... 一些东西。

您能否在 linux/putty 上检查一下该文件夹被授予了哪些权限,看起来权限已更改,从而导致了上述问题。让我知道这是否对你有用。谢谢!

关于java - 一旦我运行 kafka 服务器命令,Zookeeper 就会自动关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51519913/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com