因為某些誤操作,導致znode節點上的資料太大,超過長度,這時候要ls或者rmr就會報錯
大概像下圖:
Packet len4807928 is out of range
在外網有這樣的文章:
https://stackoverflow.com/questions/10249579/zookeeper-cli-failing-ioexception-packet-len12343123123-is-out-of-range
這是zookeeper的源碼:
707 void readLength() throws IOException {708 int len = incomingBuffer.getInt();709 if (len < 0 || len >= packetLen) {710 throw new IOException("Packet len" + len + " is out of range!");711 }712 incomingBuffer = ByteBuffer.allocate(len);713 }
並且在外網的文章當中有解決方案:
| 7 down vote |
I was able to work around this by increasing the max size of my listing call. I added the "-Djute.maxbuffer=50111000" to my zkCli.sh script so that it started the client using the following line: $JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ "-Djute.maxbuffer=49107800" -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \ org.apache.zookeeper.ZooKeeperMain "$@" I was then able to list & use rmr /big/node |
說的是要在你的zkCli.sh裡面添加上
"-Djute.maxbuffer=50111000" 這一行,相當於增加他的最大容量,然後再去刪除或者ls查看你的節點就可以了。
| 7 down vote |
I was able to work around this by increasing the max size of my listing call. I added the "-Djute.maxbuffer=50111000" to my zkCli.sh script so that it started the client using the following line: $JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ "-Djute.maxbuffer=49107800" -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \ org.apache.zookeeper.ZooKeeperMain "$@" I was then able to list & use rmr /big/node |