Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ZooKeeper - Set Trace mask

avatar
Contributor

I am having trouble on my system trying to use the stmk command for Zookeeper.

[hadoop@los90hdpc4m3][~]$ echo "envi" | nc localhost 2181 | grep zookeeper.version
zookeeper.version=3.4.6-37--1, built on 11/29/2016 17:59 GMT

[hadoop@los90hdpc4m3][~]$ echo "gtmk" | nc localhost 2181
306

[hadoop@los90hdpc4m3][~]$ perl -e "print 'stmk', pack('q>', 0b0011111010)" | nc localhost 2181

The stmk command, built using the Perl example shown in the ZooKeeper Administrator Guide, just hangs and never returns. Has anyone else had better luck enabling Zookeeper tracing via stmk? This is on a HDP 2.5.3 system.

1 ACCEPTED SOLUTION

avatar
Contributor

Found the error in Zookeeper log file.

2017-02-01 11:33:59,000 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@827] - Processing stmk command from /0:0:0:0:0:0:0:1:47438
2017-02-01 11:33:59,001 - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@218] - Ignoring unexpected runtime exception
java.nio.BufferUnderflowException
        at java.nio.Buffer.nextGetIndex(Buffer.java:506)
        at java.nio.HeapByteBuffer.getLong(HeapByteBuffer.java:412)
        at org.apache.zookeeper.server.NIOServerCnxn.checkFourLetterWord(NIOServerCnxn.java:865)
        at org.apache.zookeeper.server.NIOServerCnxn.readLength(NIOServerCnxn.java:924)
        at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:237)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
        at java.lang.Thread.run(Thread.java:745)

Found the related bug:

https://issues.apache.org/jira/browse/ZOOKEEPER-2227

Hopefully this will be included in the next HDP release.

View solution in original post

2 REPLIES 2

avatar
Contributor

Found the error in Zookeeper log file.

2017-02-01 11:33:59,000 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@827] - Processing stmk command from /0:0:0:0:0:0:0:1:47438
2017-02-01 11:33:59,001 - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@218] - Ignoring unexpected runtime exception
java.nio.BufferUnderflowException
        at java.nio.Buffer.nextGetIndex(Buffer.java:506)
        at java.nio.HeapByteBuffer.getLong(HeapByteBuffer.java:412)
        at org.apache.zookeeper.server.NIOServerCnxn.checkFourLetterWord(NIOServerCnxn.java:865)
        at org.apache.zookeeper.server.NIOServerCnxn.readLength(NIOServerCnxn.java:924)
        at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:237)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
        at java.lang.Thread.run(Thread.java:745)

Found the related bug:

https://issues.apache.org/jira/browse/ZOOKEEPER-2227

Hopefully this will be included in the next HDP release.

avatar
Master Guru

As the Jira says, stmk is rarely used, but the current version of Zookeeper, ver. 3.4.6 was added in HDP-2.x, so yes, 3.4.7 or higher which fixes the bug should be added soon.