O'Reilly logo

Hadoop 2.x Administration Cookbook by Gurmukh Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inserting data into HBase

In this recipe, we will insert data into HBase and see how it is stored. The syntax for import data is not similar to SQL, as there are no select or insert statements. To insert data, we use put and scan for select.

Getting ready

Before going through the recipe in this section, make sure you have completed the previous recipe, Setting up multi-node HBase cluster.

How to do it...

  1. Connect to the master1.cyrus.com master node in the cluster and switch to the user hadoop.
  2. Connect to the HBase shell using the hbase shell command. You can connect to the shell in interactive mode or script it.
  3. Create a table as shown in the following screenshot:
  4. Insert data using the commands shown in the following screenshot:
  5. You can list the tables ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required