Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change hbase.regionserver.thrift.framed and hbase.regionserver.thrift.compact to True? #27

Open
ghost opened this issue Apr 24, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2019

Thanks for providing the container! After pulling the image we notice that hbase.regionserver.thrift.framed is set to False in the configuration file.

However, the HBase official document and Cloudera troubleshooting page recommends to set hbase.regionserver.thrift.framed and hbase.regionserver.thrift.compact to True :

  • This is the recommended transport for thrift servers and requires a similar setting on the client side. Changing this to false will select the default transport, vulnerable to DoS when malformed requests are issued due to THRIFT-601.

  • To prevent the possibility of crashes due to buffer overruns, use the framed and compact transport protocols by setting hbase.regionserver.thrift.framed and hbase.regionserver.thrift.compact to true in hbase-site.xml.

Maybe it's better to enable these two parameters? Thank you!

@dajobe
Copy link
Owner

dajobe commented Apr 27, 2019

I could do this but would this make any other clients fail to connect to the dockerized hbase?

@ghost
Copy link
Author

ghost commented Aug 15, 2019

Thank you for your response!
Yes. As the Cloudera troubleshooting page says, it may require changes to your client code.
This answer gives an example:

  1. If framed transport is enabled
    We need to modify FROM:
    from thrift.transport import TTransport transport = TTransport.TBufferedTransport(TSocket.TSocket(host, port))
    TO:
    from thrift.transport.TTransport import TFramedTransport transport = TFramedTransport(TSocket.TSocket(host, port))
  2. If compact protocol is enabled
    We need to modify FROM:
    from thrift.protocol import TBinaryProtocol protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
    TO:
    from thrift.protocol import TCompactProtocol protocol = TCompactProtocol.TCompactProtocol(transport)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@dajobe and others