Rate This Document
Findability
Accuracy
Completeness
Readability

Oversized ZNode Buffer

Symptom

The ZooKeeper node (ZNode) cannot be deleted when ZooKeeper is cleared, and the message "Packet len XXX is out of range!" is displayed.

Cause Analysis

After a connection to ZooKeeper is created, read and write operations are performed on a ZNode. To improve the throughput, ZooKeeper checks whether the data volume of the node exceeds the value of jute.maxbuffer. If yes, ZooKeeper raises an exception.

Solution

  • Reduce the data volume of the node to be operated to a value less than the default 4 MB.
  • Increase the value of jute.maxbuffer in the /opt/apache-zookeeper-3.6.3-bin/bin/zkCli.sh file.

    "$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" "-Dzookeeper.log.file=${ZOO_LOG_FILE}" \
         "-Djute.maxbuffer=41943040" \
         -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \
         org.apache.zookeeper.ZooKeeperMain "$@"