Amazon Elastic MapReduce
Developer Guide (API Version 2009-03-31)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

Connect to HBase Using the Command Line

After you create an HBase cluster, the next step is to connect to HBase so you can begin reading and writing data.

To open the HBase shell

  1. Use SSH to connect to the master server in the HBase cluster. For information about how to connect to the master node using SSH see, Connect to the Master Node Using SSH.

  2. Run hbase shell. The HBase shell will open with a prompt similar to the following example.

    hbase(main):001:0>
    		 		

You can issue HBase shell commands from the prompt. For a description of the shell commands and information on how to call them, type help at the HBase prompt and press Enter.

Create a Table

The following command will create a table named 't1' that has a single column family named 'f1'.

hbase(main):001:0>create 't1', 'f1'
			

Put a Value

The following command will put value 'v1' for row 'r1' in table 't1' and column 'f1'.

hbase(main):001:0>put 't1', 'r1', 'f1', 'v1'
			

Get a Value

The following command will get the values for row 'r1' in table 't1'.

hbase(main):001:0>get 't1', 'r1'