ZooKeeper ensemble fails to start
ZooKeeper might fail to start if the ZooKeeper ensemble is not configured correctly, or there are
problems with file permissions, port conflicts, or disk corruption.
- The following command indicates that the ZooKeeper server process did not start:
ps uxww | grep zookeeper
- The streamtool getzkstate command indicates that the ZooKeeper ensemble is not running and serving.
- ZooKeeper is not configured correctly.
- External ZooKeeper: The configuration file (ZooKeeper-installation-directory/conf/zoo.cfg) is not configured correctly or is missing.
- Embedded ZooKeeper: The bootstrap properties are not configured correctly.
- File permissions are not set correctly for the dataDir and dataLogDir directories.
- If this error occurs for external
ZooKeeper, messages similar to the following example are displayed at the command
prompt:
Using config: /home/zooadmin/zookeeper-3.4.8/bin/../conf/zoo.cfg Starting zookeeper ... ./zkServer.sh: line 113: /home/zooadmin/dataDir/zookeeper_server.pid: Permission denied FAILED TO WRITE PID
- If this error occurs for external
ZooKeeper, messages similar to the following example are displayed at the command
prompt:
- There is a network port conflict.
- No quorum is formed.
- The disk is corrupted.
- Ensure that ZooKeeper is configured correctly.
- External ZooKeeper: Ensure that the configuration file (ZooKeeper-installation-directory/conf/zoo.cfg) is configured correctly. For more information, see the ZooKeeper Administrator’s Guide.
- Embedded ZooKeeper: Ensure that the bootstrap properties are configured correctly. For information about bootstrap properties, use the streamtool man bootproperties command. To check property values, use the streamtool getbootproperty -a command. To update property values, use the streamtool setbootproperty command.
- Ensure that the file permissions for the dataDir and dataLogDir directories
are set correctly.
- External ZooKeeper: If necessary, update the dataDir and dataLogDir configuration parameters in the ZooKeeper-installation-directory/conf/zoo.cfg file.
- Embedded ZooKeeper: Check the value of the streams.zookeeper.property.dataDir and streams.zookeeper.property.dataLogDir bootstrap properties by using the streamtool getbootproperty -a command. If necessary, update these properties by using the streamtool setbootproperty command.
- Ensure that the specified network ports are available.
- External ZooKeeper: To change a port number, update the ZooKeeper configuration file.
- Embedded ZooKeeper: To change a port number, see Changing the port number for embedded ZooKeeper.
- Ensure that there is a quorum that is formed for the ZooKeeper ensemble. For example, for a ZooKeeper ensemble that includes five resources, at least three
resources need to be up and running to form a quorum. For reliability
and availability, run ZooKeeper on at least three resources. Running ZooKeeper on five resources is preferred. Embedded ZooKeeper: The streams.zookeeper.quorum bootstrap property indicates the host name of the embedded ZooKeeper server. Only a local host name is supported. When streamtool is first started, this property is populated with a local host name and persisted in the home directory of the user. If the home directory is on a shared file system and the user wants to start embedded ZooKeeper on a different resource, the streams.zookeeper.quorum property must first be updated with the new host name. The following example shows how to change the value of this property:
streamtool setbootproperty streams.zookeeper.quorum=mynewhost.com
- Ensure that there is a supervisory service for each ZooKeeper server.
- Ensure that the disk device is healthy; reapply the latest archive or backup data to the ZooKeeper dataDir and dataLogDir directories; and restart ZooKeeper.