You are on page 1of 25

Lab Manual: Cloud Computing Department of Information Technology

ORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY,


BHOPAL

DEPARTMENT OF INFORMATION TECHNOLOGY

LAB MANUAL
Cloud Computing

Course Code : IT 704

Semester: VII

Course: Cloud Computing

Session: July-Dec 2020

Prepared By: Submitted to:


Saloni Gupta Prof. Nandni Saxena
(0105IT171089)
List of Experiments

Experime Date of Signature


Aim
nt No. Submission & Remarks

1. Study of cloud computing concepts.


2. Using Eucalyptus or Open Nebula or equivalent
to set up the cloud.

3. Find a procedure to run the virtual machine of


different configuration.

4. Check how many virtual machines can be utilized


at a particular time.
5. Install a C compiler in the virtual machine and
execute a sample program.
6. Show the virtual machine migration based on the
certain condition from one node to the other.
7. To develop web applications in cloud
Experiment - 1

Aim - Study of cloud computing concepts


Cloud computing concepts can be tough to get your head around. There are lots of acronyms and
terms relating to cloud computing that are often misunderstood. But cloud computing is so pervasive
in today’s business world that it’s essential to gain a basic understanding of the fundamental cloud
computing concepts.

Today, various computing technologies are supported by the cloud in both the business and consumer
space. Cloud computing is an umbrella term that covers a plethora of computing resources. You can
think of cloud computing as utility services that provide convenient access to computing services at
affordable rates.

After reading this article, you’ll be able to hold your own in conversations about cloud computing, the
benefits it brings to businesses and the various cloud delivery models and cloud service models.

If you’re serious about moving into cloud computing professionally, taking cloud certification courses
such as the AWS Certified Cloud Practitioner or AWS Certified Solutions Architect are good choices
to help you build a strong skill set.

Cloud Computing

Let’s start our discussion of cloud computing concepts with the most important term, “Cloud
computing” itself. Often referred to simply as ‘cloud,’ this is web-based computing that provides
on-demand access to various compute resources. These resources include things like data centers,
servers, application software and more. Most cloud computing service providers adopt a
pay-as-you-go model. This allows companies to avoid the heavy infrastructure setup costs that were
inevitable before the advent of the cloud.

XaaS (Anything-As-A-Service)

XaaS is another term you’ll often come across and it relates to what is known as cloud service models.
This is a general category of services related to remote access and cloud computing. It includes a wide
selection of technologies, tools and products that are offered to users as a service over the web.

Basically, any IT function can be changed into a service for business consumption. The service is not
paid as a license or upfront purchase, but in a flexible pay-for-what-you-use consumption model.

XaaS comes with several benefits, including speeding up business processes and application
development, improving the expense model (CAPEX vs OPEX), and streamlining operations to free
up resources for innovation.

SaaS (Software-As-A-Service)
SaaS is a software distribution model where a third-party provider hosts a variety of applications and
makes them available to customers on the internet.

In this model, the provider gives clients network-based access to one copy of an application created
for SaaS distribution. The source code of the application is similar for all customers. When an update
is rolled out, it is distributed to all customers.

Depending on the implementation, customers can store data in the cloud, locally, or both. Companies
can use application programming interfaces (APIs) to integrate SaaS applications with other software
to achieve optimal benefits.

SaaS has several benefits, including flexibility in payments thanks to its pay-as-you-go model,
scalable usage, easy accessibility and persistence and automatic updates.

PaaS (Platform-As-A-Service)

PaaS is one of the major cloud computing models where a third-party provider delivers software and
hardware tools over the web. More often than not, these tools are used for app development. The
provider hosts these tools on their own infrastructure. Therefore, PaaS allows developers to work
without investing in in-house hardware and software, which saves costs!

Something worth noting is that PaaS doesn’t replace your IT infrastructure for software development.
Rather, it provides you with a simple and convenient way to get the job done in a timely fashion. It is
provided through a cloud service and users access offerings through their web browsers. PaaS can be
offered through hybrid, private, mobile or public clouds to deliver a host of services, including java
development and application hosting.

Some examples of PaaS services include:

● AWS Elastic Beanstalk (managed web application)


● Microsoft Azure Web Apps (managed web application)
● Amazon Relational Database Service (managed database service)
● OpenShift (container platform)

Normally, you will pay for this service on a pay-as-you-go model, although some providers charge a
monthly fee.

PaaS comes with several benefits, including eliminating the capital expenses companies used to incur
for in-house hardware and software. It can also speed up application deployment.

IaaS (Infrastructure-As-A-Service)

IaaS delivers virtual computing infrastructure that is delivered and managed over the web. This model
scales with demand and allows companies to only spend on what they use. It helps businesses avoid
the complexity and expense of purchasing and managing in-house data center infrastructure.
There are lots of things businesses can do with IaaS, including:

● Test and deployment – teams can swiftly dismantle development and test (dev-test)
environments and create new applications faster.
● Web apps – IaaS provides a host of resources and infrastructure needed for the
development of web apps such as networking resources, application servers and
storage.
● Big data analysis – Big data is one of the most popular terms you will come across.
IaaS provides the infrastructure and processing power needed to mine big data.
● High-performance computing – Commonly referred to as HPC, helps solve complex
problems involving millions of calculations or variables. This includes evaluating
product designs, financial modelling, climate and weather predictions, and many
more. IaaS provides the infrastructure to accomplish this.
● Web hosting – Running websites using IaaS is easier, more convenient and less
costly than doing on traditional platforms.

IaaS increases reliability, supportability, and stability. Additionally, it enables users to scale up
resources quickly and respond to shifting business conditions.

Serverless

Serverless is a cloud computing model that allows developers to build modern applications without
thinking about servers. It allows them to shift most of their operational responsibilities to the provider.
By using this model, you can concentrate on writing application code while the platform takes care of
resource allocation, run times, security, scaling and other server solutions.

Serverless eliminates a range of infrastructure management tasks like patching, operating system
maintenance, server provisioning and more. This goes a long way in saving costs in all aspects of
application development.

Examples of serverless cloud computing services include AWS Lambda and Microsoft Azure
Functions.

Public Cloud : Public cloud is a type of cloud deployment. It refers to computing services delivered by
third-party providers over the public internet in a multi-tenant model.Public cloud services are made
available to anyone who wants to buy or use them.

Private Cloud : Also known as corporate or internal cloud, private cloud refers to computing services
provided over a private network. These services are consumed by internal company departments
rather than the general public.Private cloud provides businesses with a vast array of benefits,
including scalability, elasticity and affordability.

Hybrid Cloud : Hybrid cloud refers to an environment that incorporates private cloud and public cloud
services. This kind of ecosystem allows workloads to move between public and private clouds.
Experiment - 2

Aim - Using Eucalyptus or Open Nebula or equivalent to set up the cloud.

Eucalyptus is an open source cloud platform that enables organisations to create private clouds inside
their data centres using existing virtualized infrastructure.

First released in 2008, ‘Eucalyptus’ is actually an acronym that stands for ‘Elastic Utility Computing
Architecture for Linking Your Programs to Useful Systems’.
Eucalyptus enables IT organisations to build Amazon Web Services (AWS)-compatible private clouds
that can pool together existing virtualized IT resources and provide them to its customers in a flexible,
on-demand, pay-as-you-go basis.

The Eucalyptus cloud platform primarily comprises of five main components, each briefly explained
below:

Cloud controller (CLC): The cloud controller is essentially a Web-based interface between Eucalyptus
and the outside world. It provides cloud administrators an interface with which they can configure and
manage the cloud’s underlying compute, storage and network resources. It also handles high-level
user authentication, quota management along with a few basic accounting and reporting mechanisms.
Users can also query the CLC using Eucalyptus’s command line tools called Euca2ools.

Walrus: Walrus provides persistent storage capabilities to all of the virtual machines in the Eucalyptus
cloud. It is basically a large storage container where users can upload data from any file type using
simple HTTP put-get queries.

Cluster controller (CC): A typical Eucalyptus cloud set-up can comprise multiple nodes, which are
actually hypervisors on which virtual machines are provisioned. These nodes can be collectively
grouped and managed by using the cluster controller, which primarily looks after the inter-node
communications and Service Level Agreements (SLAs) of each cluster.

Storage controller (SC): The storage controller provides persistent block-level storage for virtual
machines that are launched within a Eucalyptus cloud. The SC interfaces with a wide variety of
storage systems including local file systems, NFS, SAN and even iSCSI.

Node controller (NC): Node controllers or nodes are hypervisor-based virtualised servers that host
virtual machines which are provisioned by the Eucalyptus cloud. Eucalyptus additionally provides an
optional add-in component that even supports VMware ESXi hypervisor as a node, called a VMware
broker.

Setting up Eucalyptus in your own backyard


In this guide, let’s set up a simple Eucalyptus cloud on a set of two machines, one acting as the
management server containing the cloud controller, Walrus, the cluster controller and the storage
controller, and the other as the node controller running atop a KVM hypervisor.
Figure 2 shows the set-up diagram. In this scenario, we are using two simple desktop machines, each
equipped with 4 GB RAM, a 500 GB hard drive and a VT-enabled (Virtualisation Technology)
processor on-board. These are the bare minimum requirements to set up a Eucalyptus cloud. However,
you can follow the same steps even if you have more machines with better compute capacity between
them.

Installing the node controller


There are two main ways of going about installing Eucalyptus. The first way is to download the
required RPMs onto your machine, install each of them and then manually configure the cloud as per
your needs. The second way is much faster and will get your Eucalyptus cloud up and running in a
matter of minutes. For this tutorial, let’s use the second method, i.e., Eucalyptus Faststart. This is
primarily a CentOS-based ISO with all the necessary Eucalyptus components embedded in it. All you
need to do is burn the ISO to a DVD or USB and run it on your machine. A self-explanatory wizard
guides you through the install process and sets up your Eucalyptus cloud for you.

Note: It is recommended that you install the node controllers first so that it becomes easier to add
them to the cloud controller once they are all up and ready.

Installing the node controller is a very simple process. Once your machine boots from the Eucalyptus
Faststart DVD, select the option ‘Install CentOS 6 with Eucalyptus Node Controller’ from the boot
screen.

Next, select the appropriate ‘Language’ and ‘Keyboard settings’ according to your locale.

Provide a ‘Static IP’ and a suitable ‘Host Name’ to your node controller in the ‘Network
Configuration’ wizard.

Provide a strong ‘Root Password’ for your node controller. Once done, your node controller along
with the base OS will be installed. You will have to reboot your system once the installation
completes.

Log in to the node controller using the root user’s username and password. A few scripts run
automatically at this time to set the node controller’s networking configurations. Once completed,
your node controller is ready to be added to a cloud controller.

Note: Follow the above mentioned steps for each of the node controllers that you wish to use for your
cloud.

Installing the cloud controller

Installation of the cloud controller is very similar to the nodes, with a few exceptions. Once your
machine boots from the Eucalyptus Faststart DVD, select the option ‘Install CentOS 6 with
Eucalyptus Frontend’ from the boot screen.

Again, select the appropriate ‘Language’ and ‘Keyboard settings’ according to your needs.

Provide a ‘Static IP’ and a suitable ‘Host Name’ to your cloud controller in the ‘Network
Configuration’ wizard.

Once done, you will be provided with an interface to supply a ‘Public IP Range/ List’ (see Figure 4)
for your Eucalyptus cloud. You need to enter a valid IP address range here. These public IPs will be
mapped to individual Eucalyptus instances (virtual machines) once they are launched in the cloud.
The rest of the installation process remains the same. Once the cloud controller reboots, it will start
executing a lot of configuration scripts that will set Walrus, the cluster controller and the storage
controller with a few default parameters. The scripts also create a CentOS 6 EMI (Eucalyptus
Machine Image). You can use this EMI to launch multiple CentOS 6 instances in your cloud.

To test whether the installation was successful, open a Web browser and type in the following to view
the Eucalyptus user console: http://<Cloud_Controller_IP>:8888

Launching your first instance

To launch your first instance, all you need to do is follow these simple steps:

1) Create a security group: A security group is similar to a firewall that protects your instance
against network-related attacks. By default, all inbound traffic to the instance is blocked.

To create a security group, use the following syntax:

# euca-create-group 'd 'Description of the group' Group_Name

# euca-create-group 'd 'My First Security Group' TestSecurityGroup


Once your group is created, open the necessary ports such as SSH port 22 to obtain access to the
instance.

To open a port for your security group, use the following syntax:

# euca-authorize 'P 'Protocol' p 'Port_No' 's 'IP_Source'Group_Name

# euca-authorize 'P 'tcp' 'p '22' 's '0.0.0.0/0' TestSecurityGroup


2) Create a key pair: A key pair acts as an authentication token between the users and their
instances.

To create a key pair, use the following syntax:

# euca-create-keypair Key_Pair_Name' >> 'Key_Pair_Name'.private

# euca-create-keypair TestKeypair >> TestKeypair.private


3) Launch the instance: An instance is launched from a machine image (in this case, EMI). You
will require an EMI ID to launch your first instance. This can be obtained from the Eucalyptus cloud
user console.

To launch an instance, use the following syntax:

# euca-run-instances'EMI_ID' 'g 'Group_Name' 'k 'Key_Pair_Name'

# euca-run-instances 'EMI-E90A38DA' 'g 'TestSecurityGroup' 'k 'TestKeypair'


The instance can take a couple of seconds to launch. You need to note down the instance IP address
either from the terminal or by using the Eucalyptus cloud user console. SSH into the instance using
the earlier created key pair by using the following syntax:
# ssh -i <Key_Pair_Name> ec2-user@<Instance_IP>

# ssh -i TestKeypair ec2-user@192.168.2.100


Experiment - 3

Aim - Find a procedure to run the virtual machine of different configuration.

Installing a guest operating system inside your VMware Workstation virtual machine is essentially the
same as installing it on a physical computer. The basic steps for a typical operating system are:

1. Start VMware Workstation.


2. Insert the installation CD-ROM or floppy disk for your guest operating system.
Note: In some host configurations, the virtual machine is not able to boot from the installation
CD-ROM. You can work around that problem by creating an ISO image file from the
installation CD-ROM. Use the Virtual Machine Control Panel to connect the virtual machine's
CD drive to the ISO image file, then power on the virtual machine.
3. Power on your virtual machine by clicking the Power On button.
4. Follow the instructions provided by the operating system vendor.

The next section provides notes on installing a Windows XP guest operating system.The screen shots
illustrate the process on a Windows host. The steps are the same on a Linux host.
Experiment - 4

Aim - Check how many virtual machines can be utilized at a particular time.

There are several factors that determine how many virtual machines can be run on a specific host
machine. Because of this, it is not possible to directly specify how many virtual machines a given host
can run at once. The factors can be roughly sorted in this order of importance:
Memory

● Each virtual machine requires some overhead memory to manage it, which means each
uses a total of up to about 1.3 times the amount of memory (RAM) given in the virtual
machine settings.
● Total virtual machine memory restrictions, for different versions of VMware Workstation:

○ 4.5.1 and earlier: a maximum of 1GB total available for all running virtual
machines.
○ 4.52 - 5.5: a maximum of 4GB total available for all running virtual machines.
○ 6.x and later: No maximum limit for the total available for all virtual machines.

CPU

The number and speed of host machine CPUs determine the performance of multiple virtual
machines.
Hard drive speed

The faster the drive on the host system, the better a virtual machine performs.
Host Operating System

At this time, a Linux host operating system seems to require less memory to run, and it seems to
handle task switching better than Windows.
However, Windows host machines handle video redraw with better speed than Linux.
Experiment - 5

Aim - Install a C compiler in the virtual machine and execute a sample program
Download and install
To download, point your browser to
http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express and select Language and
click on Free Download. After you complete download, run the executable file, it will ask you to
select whether you want to install some other optional products, uncheck those options so that you can
install only the product required. The installation process will start downloading other files from the
Microsoft site and depending upon your connection speed it will take a while to complete the
installation.

Once the installation is complete, in Windows 7, start the Visual Studio 2008 Command Prompt
from All Programs > Microsoft Visual C++ 2008 Express Edition > Visual Studio Tools > Visual
Studio 2008 Command Prompt.
Write, compile and execute your first program

Step 1 : type notepad demo.c (you can replace the filename with your own) and press Enter, when
asked if you want to create a new file, say yes.

Step 2 : type the following code and click File > Save . When asked where to save the file, select
the location suitable.

Step 3 : Type cl sample.c and press enter now. This will compile the program to create an
executable file (.exe).

Step 4 : Now simply type the name of the file sample and enter. That will show you the output.
Install, compile and execute C program with Turbo C++ in Windows

Obtain and install

Turbo C++ is very popular C compiler and IDE. The problem is, Borland, the creator organization
of the compiler and IDE does not provide any option to download the compiler and IDE. But if you
google with "turbo c++ download", you will get plenty of sites to download the compiler and IDE.
There are three files to download - TC.exe, tc.r00 and tc.r01. After downloading, run TC.exe file it
will create a folder TC at the end the installation process. To run turbo C++, enter bin directory
within TC and look for tc.exe. Double click the tc.exe file and turbo C++ IDE will open.

Run Turbo C++ in full screen in Windows 7

Those who are running Turbo C++ is Windows 7, when the IDE is opened, click on "Ignore" in the
popup window saying that it does not support full-screen mode. Now, click on the top left corner of
the Turbo C++ window and select "Properties" . Select "Font" tab and change the font to "Lucidia
Console" from default "Raster fonts". Also, change the font size to "28". Now select "Layout" tab
and set "width" as 80 and "Height" as 25 under "Screen Buffer Size". Under "Window Size",
change "Width" as 60 and "Height" as 25. Under "Window Position", set the value of "Left" and
"Top" both as -4. Make sure "Left System Position Window" is unchecked. Click "Ok" to close the
properties window. Now you can see the Turbo C++ IDE in full screen.
Write, Compile and Run C program

Open a new file from File > New in the Turbo C++ IDE. Write a small program in the IDE.

Now go to File > Save As and save the program with the filename of your choice (make sure
extension of the filename is .c).

Click on Options and go to Directories. Click on Directories and set Output Directory as you want
and Source Directory as where you have saved the C program file.

Now go to compile and click on Compile. And then Click on Run. You will see the output of your
C program.

Write, Compile and Run C program using wxDev-C++ in windows

wxDev-C++ is easy to use IDE which you may opt for to write C Program. You may download the
installer from wxdsgn.sourceforge.net. We found it working perfectly on Windows 7 and Windows
XP. It also installs MinGW along with and you don't need to set any environment variables. The
default compiler for this IDE is gcc.

After downloading the installer, run the exe file by double clicking on it and an installation wizard
will guide you to install. Once you finish the installation, you start it from Programs and the first
time when you run it, it takes a while for parsing header files. The IDe window looks like
following:

You may start programming by clicking on File > New > Source File in the window. Note that
while saving the file, you must select file type as C as this IDE supports C++ also.

You may use F9 or as shown below to Compile and Run program.


When compilation is done, it opens a new window to show you output.
If you have errors, it shows you in the pane below like the following.

Though slightly dated, we find wxDev-C++ an excellent IDE for programming C. You may try it if
you are using Windows.

Install, compile and execute C program in Linux


Most of the time, when you are installing Linux, the GNU Gcc compiler is already installed. If not,
run the following command (our system is Ubuntu Linux):

If the C compiler is already installed, it will show you a message like above. If not, it will install all
the necessary packages.

Now open a text editor and write a small C program like following and save it as demo.c :

#include <stdio.h> main() { printf("Welcome to C Programming"); }

Copy
Now run the command as shown below to compile and execute the file :

This is how you can install the GNU Gcc compiler, write a C program and run it in a virtual
machine.
Experiment - 6

Aim - Show the virtual machine migration based on the certain condition from
one node to the other.
You can move virtual machines from one compute resource or storage location to another by using
cold or hot migration. For example, with vSphere vMotion you can move powered on virtual
machines away from a host to perform maintenance, to balance loads, to collocate virtual machines
that communicate with each other, to move virtual machines apart to minimize fault domain, to
migrate to new server hardware, and so on. Moving a virtual machine from one inventory folder to
another folder or resource pool in the same data center is not a form of migration. Unlike migration,
cloning a virtual machine or copying its virtual disks and configuration file are procedures that create
a new virtual machine. Cloning and copying a virtual machine are also not forms of migration.

By using migration, you can change the computer resource that the virtual machine runs on. For
example, you can move a virtual machine from one host to another host or cluster.

To migrate virtual machines with disks larger than 2 TB, the source and destination ESXi hosts must
be version 6.0 and later.Depending on the power state of the virtual machine that you migrate,
migration can be cold or hot.

To migrate a VM to another node:

1. On the Compute view Virtual Machine widget, locate the required VM and select it.

The selected VM details appear on the bottom of the window:


2. To move the Virtual Machine to another node, click the Migrate button on the selected VM's
Action icon menu.

The Migrate VM dialog box appears.

3. From the Select Node drop-down list, select the node to which you want to migrate the VM, and
click OK.

The status of the VM changes to Migrating during the migration process.


Experiment - 7

Aim - To develop web applications in cloud .

Cloud computing enables companies and customer to compute resources as a utility to maintain and build
computing infrastructures in-house. Cloud computing promises several attractive benefits for businesses and
users. The main benefits of cloud computing include:
1. Elasticity: Companies can scale up and down of the recourses.
2. Self-service provisioning: users can spin up computing resources for almost any type of workload on-demand.
3. Pay per use: Computing resources are measured at a particular level, allowing customers to pay only for the
resources and workloads they use.
Cloud computing is a technology which uses one remote server and the internet to maintain various data and
applications. Cloud computing provides important cost effective IT resources as a cost on demand IT based on
the actual usage of the customer. Because of rapid growth, many companies are unable to handle their IT
requirement even after having an in-house data center. Cloud services are used to improve IT capabilities
without investing large amounts in new datacenters. This technology helps companies with much more efficient
computing by centralizing processing, storage, memory and bandwidth. Cloud computing segments :
Applications, Storage, and Connectivity.

II. Proposed Application


The traditional web application uses three layers: presentation, application, and database. When dealing with robust
and modular web applications, however, you typically see the presentation layer split into two different layers: client
and representation.
The three –tier web pattern
Presentation
Application
Database

A. The- tier web pattern


The three-tier web pattern is designed to help developer extrapolate the major parts of developer application and
enable it to be more modular and scalable .This architecture is designed to provide a public_ facing interface to it
as a whole. By splitting an application into multiple tiers, he can add middleware, secure each individual layer
and even offer up layers to untrusted third –party applications. The developer will also have the ability to replace
a layer to adapt to his need.In this pattern, the presentation layer defines what the clients show on their system.
The application has both the model and the control bits, where all logic actually happens in this layer. Figure(3)
show an alternative version of the tiered web pattern that splits the presentation layer into two layers. By splitting
the presentation layer into client and representation layer, the developer can offload the client layer to the actual
client and simply provide one single representation for multiple different clients. This becomes increasingly
important in today's world with mobile smartphones and devices that have less screen real estate and various
interfaces, such as touch instead of a typical mouse.
Client
Representation
Application
Database

B. Reasons for Usage


The developer wants to use this pattern if any of following applies:
He needs to build a modular cloud application .To provide multiple interfaces to his application. And integrate
multiple applications with each other (using Amazon cloud services).

C. Implementation
A typical implementation of n-tier architecture is built on of four –tier architecture. Most important is where
each layer goes. Figure (4) shows how a developer can distribute the layers across provided by his cloud services.

In this method of n-tier architecture, three different client layers are provided: one for basic HTML and JavaScript,
another for IPhone and Ipad Clients, and a third for standard desktop clients .These three layers each can present
the information to the user and set directly on the client's machine. A developer cannot trust anything coming
from any of these clients, so a developer must perform all authentication and authorization below this layer.
Directly under these client layers is the filter layer that enables a developer to abstract the authentication and
authorization from the representation and application layers. It sits directly on top of representation layer,
modifying any input and output that flows through it. These two layers must both speak the same communication
Protocol.

The representation layer sits directly below the filter layer and typically is on the same system as the application
layer. This layer modifies any output from the application layer into a usable format for the filter and client
layers.This typically transforms your internal representation , usually a raw object, into a standard such XML
(a markup language that defines a group of rules for encoding documents in a format that is both machine-readable
and human-readable).
The application layer resets directly below the representation layer and often actually merged with the
representation layer. This layer contains all business logic and communicates directly with the database layer, in
this layer developer can use boto package from Amazon cloud, all programming perform on a virtual server (EC2)
that is taken from Amazon cloud service.
The database layer rests outside of primary servers. In some cloud platforms, this will actually be provided for
developer automatically and developer not needs to control it.
Database layers come in two main flavors: relational and nonrelational. Typical relational database layers include
MySQL and Oracle, in this work S3 is used as a relational DB is taken from Amazon cloud services .some newer
databases, including SimpleDB, are nonrelational and do not support complex queries or joining to provide better
scalability.

III. Methodology:

A.Signing Up for Amazon Web Services


In the beginning, developer needs to sign up one for the services according to what developer needs in his web
application; this work is needed the following:
 Elastic Compute Cloud (EC2)
 Simple Queue Service (SQS)
 Simple Storage Service (S3)
B.Installing Boto Package
A developer can install boto in many different ways, but the best way to make sure a developer is using the latest
code is to download the source from GitHub at http://github.com/boto/boto. There are several various ways to
download code, but the easiest is just to click the Downloads button and choose an appropriate version to
download boto is an interface for AWS, boto library works with python library.A developer can use these
instructions.
tar xzf http://boto.googlecode.com/files/boto-1.9b.tar.gz
cd boto-1.9b
Python setup.Py install
to install boto writes instruction: pip install -U boto

C. Choosing of The Environment


Although there are several ways to choose your environment for boto, use the one that’s also compatible with
using the downloaded Amazon Tools.

D. Connecting with Amazon S3


To connect with S3 ,write these instructions .
import boto
s3 = boto.connect_s3()
bucket = s3.create_bucket('media.yourdomain.com') # bucket names must be unique
key = bucket.new_key('examples/first_file.csv')
key.set_contents_from_filename('/home/patrick/first_file.csv')
key.set_acl('public-read')

E. Working with Amazon SQS


SQS is a message-queuing service from Amazon that consider important part for building cloud applications.
SQS allows developer to read and write messages. In addition, he can get an count of existing messages and
deleted messages from this queue. so developer can store his message data on Amazon S3 and pass into the
message the bucket and key to the actual message data, like so:
import boto
sqs = boto.connect_sqs()
q = sqs.create_queue('my_message_pump')
data1 = simplejson.dumps(<some data structure>)
s3 = boto.connect_s3()
bucket = s3.get_bucket('message_pump.yourdomain.com')
key1 = bucket.new_key1('2016-03-19/%s.json' % str(uuid.uuid4())
key1.set_contents_from_string(data)
message = q.new_message(body=simplejson.dumps({'bucket': bucket.name, 'key': key1.name}))
q.write(message)

F. Processing with Amazon EC2


EC2 is the virtual server in cloud , When developer boot EC2 instance, he'll has it install what he wants
installed easily, saving his time as well as getting services ready to run a script to process the queue without he
having to log on:
reservation = ec2.run_instances(
image_id = "ami-bb709dd2",
key1_name = "ec2-sample-key",
user1_data = """#!/bin/bash
apt-get update
apt-get install -y imagemagick
""").

IV. Results

When developer gathers all this services and package boto, a simple application can be built, demonstrate how to
gathered this software in a real application, take a look at this proposed application to perform Portable Document
Format (PDF) documents into preview images to a possibility of displaying it on a Web site. This application that
allows users to upload a PDF and a short time later have PNG previews of every page in that document.

D. Conclusion
This paper is considered a guide if developer wants to use Amazon cloud services, and he can easily build
application using cloud , also the cost of cloud computing is little because all software and hardware that are
needed are rent for use time as well as high performance that application acquired it from cloud services.

You might also like