|
1 |
| -# WARNING: |
2 |
| -## These examples are temporarily broken |
3 |
| -Bigtable REST/Thrift Gateway support is reliant on a few patches being merged |
4 |
| -into the open-source HBase client. We are currently working on getting |
5 |
| -these patches merged into the HBase release. Check back shortly for updates. |
| 1 | +# Cloud Bigtable Python Thrift Examples |
6 | 2 |
|
7 |
| -## Cloud Bigtable Python Thrift Examples |
| 3 | +This example demonstrates how to use the HBase client to serve as a |
| 4 | +Thrift Gateway to Cloud Bigtable. They involve two steps: first installing |
| 5 | +and configuring an HBase client to serve as the [Apache Thrift] |
| 6 | +(https://thrift.apache.org/) gateway, and second installing and configuring a |
| 7 | +Thrift client. In this example, we use a Python Thrift client configured on a |
| 8 | +GCE instance. Thrift supports many other languages besides Python, such as |
| 9 | +NodeJS, Ruby, and C#, and can be installed on many other platforms besides a |
| 10 | +GCE Debian instance, but the installation instructions vary by platform. |
8 | 11 |
|
9 |
| -This project demonstrates how to start with a fresh GCE instance, and install |
10 |
| -the correct system libraries to build a Thrift client for the Google Cloud |
11 |
| -Bigtable HBase Thrift Gateway. These assume you already have the Thrift |
12 |
| -Gateway setup and running, following the linked instructions. |
13 | 12 |
|
14 |
| -While the examples here use Thrift to generate Python, Thrift can generate |
15 |
| -code for many languages such as NodeJS, Ruby, and C#. |
| 13 | +## Installing an HBase Thrift Gateway |
16 | 14 |
|
17 |
| -## Instructions |
| 15 | +You can download our temporary HBase client fork here: |
18 | 16 |
|
19 |
| -First, follow the instructions to get a Thrift HBase server setup using bdutil. |
| 17 | +[Google HBase Release](https://github.com/GoogleCloudPlatform/cloud-bigtable-examples/releases/tag/v0.1.5) |
20 | 18 |
|
21 |
| -https://docs.google.com/document/d/1NqjtdLiY5T2bZADanbWktUQ1-qP2bDgFnOf_3lX_PbA/edit |
22 | 19 |
|
23 |
| -Then provision a new instance to serve as the client: |
| 20 | +**************************************************************************************************** |
| 21 | +IMPORTANT -- The HBase temporary fork is a SNAPSHOT of hbase-1.0.1 that allows users to use |
| 22 | +HBase with Bigtable on Google Cloud Platform. These changes [1] |
| 23 | +(https://issues.apache.org/jira/browse/HBASE-12993) |
| 24 | +[2](https://issues.apache.org/jira/browse/HBASE-13664) have been submitted and accepted by the Apache |
| 25 | +HBase project and once they are released we will no longer offer this TEMPORARY fork of HBase. |
| 26 | +*************************************************************************************************** |
| 27 | + |
| 28 | +************************************************************************************************ |
| 29 | +If you prefer, you can download the HBase src releases, and apply our patches. |
| 30 | + |
| 31 | + |
| 32 | +`curl -f -O http://mirror.reverse.net/pub/apache/hbase/hbase-1.0.1/hbase-1.0.1-src.tar.gz` |
| 33 | + |
| 34 | +`tar -xzf hbase-1.0.1-src.tar.gz` |
| 35 | + |
| 36 | +`cd hbase-1.0.1` |
| 37 | + |
| 38 | +`patch -p1 < fix-bigtable-rest-thrift.patch` |
| 39 | + |
| 40 | +`MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=2g" mvn install -DskipTests |
| 41 | +assembly:single` |
| 42 | + |
| 43 | +The release is built in hbase-assembly/target/hbase-1.0.1-bin.tar.gz |
| 44 | +************************************************************************************************ |
| 45 | + |
| 46 | + |
| 47 | +Once you have the HBase client, instructions for installing an HBase client for |
| 48 | +Cloud Bigtable can be found here: |
| 49 | + |
| 50 | +https://cloud-dot-devsite.googleplex.com/bigtable/docs/installing-hbase-client |
| 51 | + |
| 52 | +Instead of the official HBase release in the section "Downloading required |
| 53 | +files", you use the forked HBase binaries instead. |
| 54 | + |
| 55 | +Then, to start the Thrift gateway, from the HBase release directory |
| 56 | + |
| 57 | +`./bin/hbase thrift start` |
| 58 | + |
| 59 | +If you would like to connect to your Thrift gateway using your external IP on a |
| 60 | + GCE instance, you will have to open up a firewall port. |
| 61 | + |
| 62 | +`gcloud compute firewall-rules create <instance_name> --allow=tcp:9090` |
| 63 | + |
| 64 | +Note the security risk of an open firewall port, and also note that you can |
| 65 | +connect to the HBase gateway from a different GCE instance without opening up |
| 66 | + a firewall port using the private internal IP instead of the external IP. |
| 67 | + |
| 68 | +The internal IP can be found in the [Google Cloud Console](console.developer |
| 69 | +.google.com) by going to Compute Engine > VM Instances and then clicking |
| 70 | +on your instance. |
| 71 | + |
| 72 | +## Installing an HBase Thrift Client |
| 73 | + |
| 74 | +For this example, we will install Thrift on a separate machine from our |
| 75 | +gateway interface |
| 76 | + |
| 77 | +First provision a new instance to serve as the client: |
24 | 78 |
|
25 | 79 | `$ gcloud compute instances create thrift-client`
|
26 | 80 |
|
|
0 commit comments