Following these steps should get you to the hbase shell in 3 minutes.
- Java 8
- Apache Maven
- Cloud SDK
gcloud components update
gcloud components install alpha beta
- Bash or cygwin
- A copy of this project installed on your computer
-
Go to the Cloud Console and create or select your project.
-
Enable Billing (if not all ready).
-
Create a new Bigtable Instance
-
Select APIs & Auth > APIs
Verify that both the Cloud Bigtable API and the Cloud Bigtable Admin API are enabled.
-
Initialize gcloud via
gcloud init
. This will initialize your credentials, your default cloud zone and project id. -
chmod +x quickstart.sh
-
./quickstart.sh
will write a valid hbase-site.xml for you.
Alternatively you can just use maven directly.
mvn clean package exec:java -Dbigtable.projectID=... -Dbigtable.instanceID=...
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.1, rd0a115a7267f54e01c72c603ec53e91ec418292f, Tue Jun 23 14:56:34 PDT 2015
hbase(main):001:0>
-
Create a table (tableName, Column Family)
>
create 'test', 'cf'
-
List Tables
>
list
-
Add some data
>
put 'test', 'row1', 'cf:a', 'value1'
>
put 'test', 'row2', 'cf:b', 'value2'
>
put 'test', 'row3', 'cf:c', 'value3'
-
Scan the table for data
>
scan 'test'
-
Get a single row of data
>
get 'test', 'row1'
-
Disable a table
>
disable 'test'
-
Drop the table
>
drop 'test'
-
Finished
>
exit
- See LICENSE