Hbase Integration with PHP

I installed Hbase and now I am looking for some PHP library to integrate hbase with PHP. I tried 2 libraries. I tried to connect to a transaction, but could not do it. 2nd I tried to connect it using popHbase but couldn’t do it, can someone provide me if there is any other library or if there is any working library that uses thrift? please suggest me what to do so that PHP can communicate with hbase.

Hi,

+6
source share
3 answers

You cannot access HBase directly from PHP, but you can get around it by carefully examining the Thrift interface.

There are several parts here:

At first:

Thrift is a cross-language communication system and does not apply to HBase. The interface specification that HBase looks like this .

To use the Thrift interface, you need to compile the specification for the language you are using, in this case PHP. To do this, you need the Thrift compiler (you can get it at trift.apache.org).

Apply it:

thrift --gen php [hbase-root] /src/java/org/apache/hadoop/hbase/thrift/Hbase.thrift

This will create several PHP interface files. Put this in your project along with the Thrift library files (which came with the compiler).

An example of using Thrift and PHP can be found here: http://svn.apache.org/viewvc/thrift/trunk/tutorial/php/PhpServer.php?view=markup - the functions and methods that you name will be that you see in interface file.

The second:

You need to start the Thrift server, which will perform the actual connection to HBase. The instructions are on the HBase website , but for the most part you just need to:

[hbase-root] / bit / hbase lean start

+11
source

Try this hbase and hive thrift php client package:

http://nousefor.net/55/2011/12/php/hbase-and-hive-thrift-php-client/

+3
source

This is correct, but in Hadoop 0.90.3 the command to compile is

thrift --gen php [hbase-root]/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift 
+1
source

Source: https://habr.com/ru/post/886058/


All Articles