When zookeeper is started today, the following error occurs:
[Root @ hadoop-one zookeeper-3.4.5] # bin/zkserver. Sh start
JMX enabled by default
Using config:/root/zookeeper/zookeeper-3.4.5/bin/../CONF/zoo. cfg
Starting zookeeper... already running as process 947 ..
After reading the process 947, we found that it was a Linux system process and there should be no conflict. Check several port numbers that zookeeper will use, and they are not in use.
Later, open the bin/zkserver. Sh STARTUP script and search for the above part:
Echo-n "Starting zookeeper... "If [-F $ zoopidfile]; then if kill-0 'cat $ zoopidfile'>/dev/null 2> & 1; then ECHO $ command already running as process 'cat $ zoopidfile '. exit 0 fi
When you see $ zoopidfile, you may think that the process ID file already exists, and the file cannot be started.
Go to datadir and check that there is a zookeeper_server.pid. The last modification time is a few days ago. The last time the machine was shut down due to an abnormal power failure, This PID file may be left behind.
Delete, restart, and OK.