Today in the configuration ZK pseudo-cluster, found the following error:
Internet view some say because zoo.cfg configuration file "=" There are spaces before and after checking my profile and no space, so I ruled out this reason.
Finally resolved:
ZK's profile path parsing is really not smart enough, the path must be full path and start from the root directory, my path started with "~/xxxx" Such a path, it is clear that ZK does not know this "~" Home directory, change the problem solved later.
In addition, Online said "#" must have a space behind the comment, I verify that it is not true, and there is no reason ah, so the rumor.
And finally explain this zookeeper_. Server.pid is what, this is a again ZK start to create a file, inside is a PID, that is, the ZK run Pid,zk server script is the configuration file data path configuration to find this PID file, so that the server script to deal with which ZK process, so a Dan config file data directory configuration problem, then ZK service script can not find this PID file, will report the above error.
Finally, post my pseudo-cluster configuration file:
# The number of milliseconds of each tick ticktime=2000 # The number of ticks, the
initial
# Synchronizati On phase can take
initlimit=10 # The number of
ticks so can pass between
# Sending a request and getting an Acknowledgement
synclimit=5
# The directory where the snapshot is stored.
Datadir=~/zookeeper/workdir/server1/data
Datalogdir=/users/miracle/zookeeper/workdir/server1/log
# The Port at which the
"X" in the clients would connect clientport=2181
# server.x represents the identity of the zookeeper server process
server.1= 127.0.0.1:2222:2225
server.2=127.0.0.1:3333:3335
server.3=127.0.0.1:4444:4445