Performing operations on Bigtable

This section will walk you through creating a BigTable instance and leveraging it for storage:

  1. Move to Bigtable in your side navigation menu and click on Create instance:
  1. The web console will as usual make things very easy for you and walk you through creating a new Bigtable instance. Give the instance a name, which is just for display purposes. The instance ID is permanent and will be used to refer to the instance.
  2. At this point, you have two choices. You can choose a production instance, which is what is recommended. We are setting up a real web app which is going to serve real traffic. This needs a minimum of three nodes and it's highly available. Once you set up this instance though, you cannot downgrade it later. You need to keep it or delete it if you no longer need it. If you are just playing around with Bigtable in order to understand it, you can choose the development instance. It has a lower cost and it is meant for development. It's not highly available, but you can upgrade it to a production instance later.

 

  1. In addition to an instance ID, you need to specify a cluster ID as well for Bigtable. This too is permanent and there are some constraints on what characters a cluster ID can accept.
  2. Specify the zone where you want your instance to be located.
  3. Next, you have a choice here as to the kind of storage your Bigtable instance should use. You can choose the high performance, low latency SSD. That's what is recommended. Or if you have huge datasets, want to lower your storage cost, and don't care about latency, you can choose an HDD to store your data:
  1. Click on Create and it will go ahead and create a Bigtable instance for you.
  2. Google Cloud Platform provides you an HBase shell where you can use HBase commands to connect and work with Bigtable. In order to use the HBase shell, you need to download the Google Cloud Bigtable quick start from this URL: https://storage.googleapis.com/cloud-bigtable/quickstart/GoogleCloudBigtable-Quickstart-1.0.0-pre4.zip.
  3. Unzip the file. This zip file has a script that can quickly set you up with the HBase shell then allow you to connect to your Bigtable instance. Of course performing all of this on cloud shell will spare you a lot of file-moving-around.
  4. Note that there is a quickstart folder that has been created in your current working directory. In that folder, we will run the script to connect to Bigtable using the HBase Shell. This script will work only if we have a Bigtable instance set up. You can run 'gcloud beta bigtable instances list' and see the list of Bigtable instances that you have.
  5. This script works under three conditions:
    • You are authenticated and logged in using Google oauth login
    • You have a default project set up
    • You have a Bigtable instance set up
  6. Simply run quickstart using the ./quickstart.sh command and it will take you to the HBase Shell. If you are familiar with the HBase Shell, what you are going to see will be very straightforward for you. You can run the list command to see what tables you have set up within Bigtable.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset