Skip to content

Commit e98f200

Browse files
committed
Merge pull request #37 from GoogleCloudPlatform/warning3
Add README To Use Temporary Hbase Fork
2 parents fe4e42a + 2906de5 commit e98f200

File tree

3 files changed

+135
-37
lines changed

3 files changed

+135
-37
lines changed

python/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Python REST/Thrift Examples
22

3-
# WARNING:
4-
## These examples are temporarily broken
5-
Bigtable REST/Thrift Gateway support is reliant on patches being merged
6-
into the open-source HBase client. We are currently working on getting
7-
these patches merged into the HBase release. Check back shortly for updates.
3+
4+
These examples demonstrate how to use the HBase client to serve as a REST or
5+
Thrift gateway to Google Cloud Bigtable.

python/rest/README.md

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Python REST/Thrift Examples
1+
# Python REST Examples
22

3-
# WARNING:
4-
## These examples are temporarily broken
5-
Bigtable REST/Thrift Gateway support is reliant on patches being merged
6-
into the open-source HBase client. We are currently working on getting
7-
these patches merged into the HBase release. Check back shortly for updates.
3+
This example demonstrates how to use the HBase client to serve as a
4+
REST Gateway to Cloud Bigtable. They involve two steps: first installing
5+
and configuring an HBase client to serve as the REST gateway, and second
6+
installing and configuring a REST client. In this example we use a
7+
Python REST client using the [requests](http://docs.python-requests.org/en/latest/) library.
88

99
## Cloud Bigtable Python REST Examples
1010

@@ -13,21 +13,67 @@ calls to interact with an HBase REST gateway to Google Cloud Bigtable. It is
1313
not an extensive library, but rather a simple demonstration of some common
1414
operations.
1515

16-
## Project setup, installation, deployment, and configuration
16+
## HBase REST Gateway setup and configuration
1717

18-
First follow the instructions to create a Google Cloud project, enable Cloud
19-
Bigtable, and then the instructions on using bdutil to setup an HBase gateway.
18+
You can download our temporary HBase client fork here:
2019

21-
https://docs.google.com/document/d/1k_NwGTYvInFZ_a0AVQ2LXBsdGV53bbqf_uD6586uoTc/edit
20+
[Google HBase Release](https://github.com/GoogleCloudPlatform/cloud-bigtable-examples/releases/tag/v0.1.5)
2221

23-
Start the REST server in the background
22+
****************************************************************************************************
23+
IMPORTANT -- The HBase temporary fork is a SNAPSHOT of hbase-1.0.1 that allows users to use
24+
HBase with Bigtable on Google Cloud Platform. These changes [1]
25+
(https://issues.apache.org/jira/browse/HBASE-12993)
26+
[2](https://issues.apache.org/jira/browse/HBASE-13664) have been submitted and accepted by the Apache
27+
HBase project and once they are released we will no longer offer this TEMPORARY fork of HBase.
28+
***************************************************************************************************
2429

25-
`hbase rest start`
2630

27-
Unless you run these scripts on the HBase instance itself, you will have to
28-
open up the appropriate port:
31+
************************************************************************************************
32+
If you prefer, you can download the HBase src releases, and apply our patches.
2933

30-
`gcloud compute firewall-rules create hbase-rest --allow=tcp:8080`
34+
35+
`curl -f -O http://mirror.reverse.net/pub/apache/hbase/hbase-1.0.1/hbase-1.0.1-src.tar.gz`
36+
37+
`tar -xzf hbase-1.0.1-src.tar.gz`
38+
39+
`cd hbase-1.0.1`
40+
41+
`patch -p1 < fix-bigtable-rest-thrift.patch`
42+
43+
`MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=2g" mvn install -DskipTests
44+
assembly:single`
45+
46+
The release is built in hbase-assembly/target/hbase-1.0.1-bin.tar.gz
47+
************************************************************************************************
48+
49+
50+
Once you have the HBase client, instructions for installing an HBase client for
51+
Cloud Bigtable can be found here:
52+
53+
https://cloud-dot-devsite.googleplex.com/bigtable/docs/installing-hbase-client
54+
55+
Instead of the official HBase release in the section. "Downloading required
56+
files", you use the forked HBase binaries instead.
57+
58+
Then, to start the REST gateway, from the HBase release directory
59+
60+
`./bin/hbase rest start`
61+
62+
If you would like to connect to your REST gateway using your external IP on a
63+
GCE instance, you will have to open up a firewall port.
64+
65+
`gcloud compute firewall-rules create <instance_name> --allow=tcp:8080`
66+
67+
Note the security risk of an open firewall port, and also note that you can
68+
connect to the HBase gateway from a different GCE instance without opening up
69+
a firewall port using the private internal IP instead of the external IP.
70+
71+
The internal IP can be found in the [Google Cloud Console](console.developer
72+
.google.com) by going to Compute Engine > VM Instances and then clicking
73+
on your instance.
74+
75+
76+
## REST client setup and configuration
3177

3278
On a client machine of your choice, change `baseurl` to match the external IP of
3379
the rest server.
@@ -55,4 +101,4 @@ or
55101

56102
`python put_get_with_client.py`
57103

58-
should both print "Done!" if all the operations succeed.
104+
should both print "Done!" if all the operations succeed.

python/thrift/README.md

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,80 @@
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
62

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.
811

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.
1312

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
1614

17-
## Instructions
15+
You can download our temporary HBase client fork here:
1816

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)
2018

21-
https://docs.google.com/document/d/1NqjtdLiY5T2bZADanbWktUQ1-qP2bDgFnOf_3lX_PbA/edit
2219

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:
2478

2579
`$ gcloud compute instances create thrift-client`
2680

0 commit comments

Comments
 (0)