Articles
Google Cloud Platform Logo - Nataraj

Getting started with Google Cloud – Part 1

Started with Google Cloud a week back, well my first opinion is WOW, it’s so simplified and it’s so easy to get things done not that it’s not easier on other platforms but it’s easier and a lot simplified, be it the command line or the web interface or access to information is easily available instantaneously.

In this article let’s look some basics about google compute and google storage and command line utilities for the same. Let’s me keep it simple and let me look at the user prospective.

  • User wants to setup an instance
  • Copy data from local to the instances (google command line tools)
  • And how to use an bucket for the same

Some prerequisites:

Install and configure gsutil (could use gcould) / & gcloud

Summary:

  • gcloud auth login
  • gcloud config set project project name
  • gcloud components list
  • gcloud components update (if you have not updated)
  • gcloud compute ssh instance-1
  • gcloud compute ssh instance-1 –zone asia-east1-a
  • gsutil cp data/* gs://something-bucket1 (copy data from your host to bucket)
  • gsutil rsync -d -r gs://something-bucket1/data data ( have not tried this yet)
  • gsutil ls gs://something-bucket1 (list the buckets)
  • gsutil cp gs://something-bucket1 <space> .  <dot>
  • gsutil acl ch -u asdf@gmail.com:READER gs://something-bucket1

 

Detailed Steps:

1) Create an instance and login to the instance (1 – 6)

2) Create a storage bucket

3) Enable to the Storage and JSON API in the api’s console

Google Storage JSON API

4) Install gsutil in the instance and on the host, check if the components are updated if not you could update using (gcloud components update)

5) From the host you can copy data to the bucket with ( gsutil cp data/* gs://something-bucket1 )

6) From the guest/instance you can copy the data to the instance with (gsutil cp gs://something-bucket1 <space> .  <dot>)

7) If you want to give permission to an another use for the bucket then you could use ( gsutil acl ch -u asdf@gmail.com:READER gs://something-bucket1 )

Part 2 Continued…..

 

 
2 Comments
  1. Nagarjuna R

    Super Ann, need more info will get in touch inperson

     

Leave a comment