Lead Image © Zavalnyuk Sergey, 123RF.com

Lead Image © Zavalnyuk Sergey, 123RF.com

Building Big Iron in the Cloud with Google Compute Engine

Iron Ore

Article from ADMIN 21/2014
By
Google Compute Engine removes the technical and financial headaches of maintaining server, networking, and storage.

Cloud computing is a fundamental evolutionary step in the world of computing. Using the cloud lowers initial investment, reduces costs, and improves ROI, with the option to be elastic, scalable, and infinitely performant. It's the best of both worlds for technical people and bean counters alike. Google Compute Engine is a stellar IaaS (Infrastructure as a Service) example that is part of a larger suite of options, including the App Engine PaaS (Platform as a Service), Cloud SQL, Cloud Storage, Cloud Datastore, and many other services.

The Google cloud allows you to build anything you might need for a modern IT infrastructure via Google's Cloud Platform [1]. In this article, I focus on the initial setup and configuration of the Google Compute Engine IaaS solution. Before I dive in, though, take a look at the many Google cloud services (Table 1), which should cover just about anything you would want to build.

Table 1

Google Cloud Services

Name Service
Google Compute Engine Allows you to build hosted virtual machines in Google's cloud. As an IaaS option, it allows you to right scale and reduce your costs at the same time.
Google App Engine Allows you to focus on coding your application and not on infrastructure configuration, or administration. As a PaaS solution, it supports the Python, Java, PHP, and Go languages.
Google Cloud SQL Fully managed MySQL at your fingertips, with no headaches of administration, scaling, or replication.
Cloud Storage Highly available storage service for your data. If offers standard storage or durable reduced availability (think backup), OAuth, and granular access control.
Cloud Datastore Offers a managed NoSQL database for storing non-relational data. This is a robust, powerful solution without the headaches.
BigQuery Lets you analyze big data in the cloud with massive scalability and the fast data queries required of big data problems.
Cloud DNS Google's high-performance domain name system (DNS) in the cloud. It is manageable via the command line or scriptable with Python.
Cloud Endpoints Allows you to create RESTful services available to iOS, Android, and JavaScript clients. It features DDoS protection, OAuth support, and client key management.
Translate API Helps you translate your application to another language programatically. It supports most popular languages, but sadly lacks Klingon support. Lu'?
Prediction API Allows use of Google's machine learning algorithms to analyze data. It is a powerful way to gain insights into future trends using historical data.
Cloud Deployment Manager Provides a way to design, create, and deploy system templates. It also lets you actively monitor the status of your Google Cloud post-deployment.
Cloud SDK A powerful group of tools and libraries for orchestrating your Google Cloud deployments, with the ability to control App Engine, Compute Engine, Cloud Storage, BigQuery, and Cloud SQL.
Push-to-Deploy Lets you use Git to deploy your application automatically to App Engine. It works for applications written in Python, PHP, and Java.
Cloud Playground Lets you try out App Engine, Cloud Storage, or Cloud SQL right in your browser. It also supports importing projects directly from GitHub.
Android Studio Allows you to to develop, debug, and put your code to work in Google's Cloud Platform from this new Android development environment.
Google Plugin for Eclipse Software development tools for Java developers to aid in the design, build, and deployment of cloud-based App Engine applications.

Google Compute Engine

Google Compute Engine was opened to the public in June 2012, a bit later than most other players in the cloud marketplace. Arrival time aside, it is a powerful, scalable, and performant IaaS solution.

Compute Engine allows you quickly and easily to create anything from a simple single-node VM to a large-scale compute cluster on Google's world class infrastructure. As of this writing, it supports several stellar open source Linux distributions (and one closed-source option), including Debian and CentOS; CoreOS, FreeBSD, and SELinux [2]; and Red Hat Enterprise Linux, SUSE, and Windows [3].

Instances are available with many options and are completely customizable from a hardware perspective. You can choose the number of cores, RAM, and other machine properties, and you can scale them as you grow [4]. Virtual instances start at a micro instance (f1-micro), with one core and 0.60GB of memory, and go up to 16 cores and 104GB of RAM. For the sake of the demo here, I will be using a shared core micro instance (g1-small; Table 2). Competition from Amazon, Microsoft, Rackspace, and others in the cloud marketplace has put increasing downward pressure on the price of many cloud offerings.

Table 2

Small Instances

Instance type Virtual Cores Memory Price (US$/hour) US hosted Price (US$/hour) Europe hosted Price (US$/hour) Asia Pacific hosted
f1-micro 1 0.60GB $0.013 $0.014 $0.014
g1-small 1 1.70GB $0.035 $0.0385 $0.0385

Constructing your own server in Google Compute Engine (GCE) is easy. Your first requirement is to have a Google account. If you have any experience with any other cloud platform (e.g., Amazon AWS and its AWS management console), you will feel right at home in the Google Developer Console [5].

Like other cloud services, GCE offers both a UI (user interface) and API (application programming interface). In this article, I focus on the basics of using the UI and related utilities to get you up and running quickly.

Setting Up Your Project

To get started with the GCE, you need to set up a project name and ID. To begin, choose a project name and project ID, then click Create Compute Engine Instance , as is detailed in Figure 1. As with other cloud computing services, you have a dizzying array of options from which to choose.

Figure 1: Creating a Compute Engine instance.

On the left side of the window, select Compute Engine . To run your instance, you first will have had to set up payment. Simply click on Setup Billing , fill in the required information, and submit it.

Creating a New Instance

Once you have created a project and entered your billing information, you are finally ready to add a new Google Compute Engine instance. As shown in Figure 2, you need to fill in the name of the server and any other desired configuration. The only elements you might need to customize to your own needs include:

  • Zone: Specifies the geographic region in which your virtual instance and its data will be located. Generally choose the one closest to the clients you will serve.
  • Machine type: Lets you choose system specifications in terms of processors and RAM.
  • Image: Lets you choose an operating system from the many supported options. Currently supported OSs are Debian, CentOS, Red Hat Enterprise Linux, SUSE, and Windows [3].
  • Network: Specifies the network that traffic can access. In this example, default is correct.
  • External IP: Specifies the external address allotted when the instance is created. Here, the default Ephemeral address is bound to the instance as long as it exists.

Now that you have created a project and set up a GCE instance through the web interface, I'll explore setting up, managing, and controlling the project through Google's suite of command-line tools via the Cloud SDK.

Figure 2: Creating a new instance.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus