无法写pid zookeeper安装zookeeper

时间:2015-11-25 21:53:41

标签: java apache-storm apache-zookeeper

我之前发过帖子但仍然无法解决问题。我正在尝试安装zookeeper并启动它来运行summing-bird,它运行以提供螺栓/喷口在线和批量风暴。我首先安装了zookeeper版本3.4.6,并且发现了类未找到异常。看完帖后

ClassNotFoundException for Zookeeper while building Storm

我将版本降级到3.3.6,现在我甚至无法启动zookeeper服务器。任何帮助都将非常感激。

root@cp-1:/users/username/zookeeper-3.3.6/bin# ./zkServer.sh start
JMX enabled by default
Using config: /users/username/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... ./zkServer.sh: 93: [: /tmp/zookeeper/: unexpected  operator
./zkServer.sh: 103: ./zkServer.sh: cannot create /tmp/zookeeper/
The number of snapshots to retain in dataDir/zookeeper_server.pid: Directory   nonexistent
FAILED TO WRITE PID

这是我的zoo.cfg文件的样子

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper/
dataLogDir=/tmp/logs/zookeeper/

# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

server.1=10.11.10.3:2888:3888
server.2=10.11.10.4:2888:3888

这就是访问的方式

drwxr-xr-x 2 username oppts-PG0    4096 Nov 25 14:35 zookeeper
drwxr-xr-x 3 root    root         4096 Nov 25 14:46 logs
drwxr-xr-x 2 root root 4096 Nov 25 14:46 logs/zookeeper

1 个答案:

答案 0 :(得分:0)

zoo.cfg的内容所述,最好将dataDir设置为/tmp/zookeeper

# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.

您可以尝试将dataDir设置为您创建的其他目录。然后重新启动zkServer.sh