hbase thrift2 server , Bad version in readMessageBegin

hbase thrift2 server 报错, ‘Badversion in readMessageBegin’, 调查发现, 在客户端使用的是framedtransport, 结果在服务器端没有指定

使用framed transport. 导致包格式解析错误。

关闭hbase thrift2 server, 加上-f 参数,重启。 问题解决。

bash /home/hadoop/hbase/bin/hbase-daemon.sh stop thrift2

bash /home/hadoop/hbase/bin/hbase-daemon.sh start thrift2 -f -threadpool

org.apache.thrift.protocol.TProtocolException:Bad version in readMessageBegin        at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:208)
        atorg.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
        atorg.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
        atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        atjava.lang.Thread.run(Thread.java:745)
2016-11-23 17:46:30,037 ERROR [pool-2-thread-5] server.TThreadPoolServer:Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Bad version in readMessageBegin
        atorg.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:208)
        atorg.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
        atorg.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
        atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        atjava.lang.Thread.run(Thread.java:745)
2016-11-23 17:46:30,078 ERROR [pool-2-thread-5] server.TThreadPoolServer:Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Bad version in readMessageBegin
        atorg.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:208)
        atorg.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
        atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

 hadoop@hadoop-svr1:~/hbase/bin$./hbase thrift2 help

usage: Thrift [-b <arg>][-c] [-f] [-h] [-hsha | -nonblocking |

       -threadpool] [--infoport<arg>]  [-p <arg>] [-t<arg>]

 -b,--bind <arg>          Address to bind the Thrift server to.[default:

                          0.0.0.0]

 -c,--compact             Use the compact protocol

 -f,--framed              Use framed transport

 -h,--help                Print help information

 -hsha                    Use the THsHaServer. Thisimplies the framed

                          transport.

    --infoport <arg>      Port for web UI

 -nonblocking             Use the TNonblockingServer. Thisimplies the

                          framed transport.

 -p,--port <arg>          Port to bind to [default: 9090]

 -t,--readTimeout <arg>   Amount of time in milliseconds before aserver

                          thread will timeoutwaiting for client to send

                          data on a connectedsocket. Currently, only

                          applies toTBoundedThreadPoolServer

 -threadpool              Use the TThreadPoolServer. Thisis the default.

To start the Thrift server run'bin/hbase-daemon.sh start thrift2'

To shutdown the thrift server run'bin/hbase-daemon.sh stop thrift2' or

send a kill signal to the thriftserver pid

 

下面是thrift 的主要传输方式。http://blog.csdn.net/m13321169565/article/details/7835957

 传输层
    * TSocket- 使用堵塞式I/O进行传输,也是最常见的模式。
    * TFramedTransport- 使用非阻塞方式,按块的大小,进行传输,类似于Java中的NIO。
    * TFileTransport- 顾名思义按照文件的方式进程传输,虽然这种方式不提供Java的实现,但是实现起来非常简单。
    * TMemoryTransport- 使用内存I/O,就好比Java中的ByteArrayOutputStream实现。
    * TZlibTransport- 使用执行zlib压缩,不提供Java的实现。

猜你喜欢

转载自blog.csdn.net/abccheng/article/details/53433280