Docsity Cloud Computing Lab Manual
Docsity Cloud Computing Lab Manual
Computer Science
AAFT University of Media and Arts
49 pag.
AIM: Write down the basic concept of cloud computing with its history
Cloud Computing
Cloud computing is the on-demand availability of computer system resources, especially data
storage and computing power, without direct active management by the user. The term is
generally used to describe data centers available to many users over the Internet. Large clouds,
predominant today, often have functions distributed over multiple locations from central servers.
If the connection to the user is relatively close, it may be designated an edge server.
Before emerging the cloud computing, there was Client/Server computing which is basically a
centralized storage in which all the software applications, all the data and all the controls are
resided on the server side. If a single user wants to access specific data or run a program, he/she
need to connect to the server and then gain appropriate access, and then he/she can do his/her
business. Then after, distributed computing came into picture, where all the computers are
networked together and share their resources when needed.
But of course time has passed and the technology caught that idea and after few years we
mentioned that:
In 1999, Salesforce.com started delivering of applications to users using a simple website. The
applications were delivered to enterprises over the Internet, and this way the dream of computing
sold as utility were true.
In 2002, Amazon started Amazon Web Services, providing services like storage, computation
and even human intelligence. However, only starting with the launch of the Elastic Compute
Cloud in 2006 a truly commercial service open to everybody existed.
In 2009, Google Apps also started to provide cloud computing enterprise applications.
Of course, all the big players are present in the cloud computing evolution, some were earlier,
and some were later. In 2009, Microsoft launched Windows Azure, and companies like Oracle
and HP have all joined the game. This proves that today, cloud computing has become
mainstream.
It is one of the layers of the cloud computing platform. It allows customers to outsource their IT
infrastructures such as servers, networking, processing, storage, virtual machines, and other
resources. Customers access these resources on the Internet using a pay as per use model.
In traditional hosting services, IT infrastructure was rented out for a specific period of time, with
pre determined hardware configuration. The client paid for the configuration and time, regardless
of the actual use. With the help of the IaaS cloud computing platform layer, clients can
dynamically scale the configuration to meet changing requirements and are billed only for the
services actually used.
IaaS cloud computing platform layer eliminates the need for every organization to maintain the
IT infrastructure.
It is a software distribution model in which services are hosted by a cloud service provider. These
services are available to end-users over the internet so, the end-users do not need to install any
software on their devices to access these services.
Business Services - SaaS Provider provides various business services to start-up the business.
The SaaS business services include ERP (Enterprise Resource Planning), CRM (Customer
Relationship Management), billing and sales.
Social Networks - As we all know, social networking sites are used by the general public, so
social networking service providers use SaaS for their convenience and handle the general
public's information.
Mail Services - To handle the unpredictable number of users and load on e-mail services, many e-
mail providers offering their services using SaaS.
S oftware As A Service
Software as a service ( SaaS ) is a software licensing and delivery model in which software is licensed on a
subscription basis and is centrally hosted.It is sometimes referred to as "on-demand software", and was
formerly referred to as "software plus services" by Microsoft.
SaaS applications are also known as Web-based software, on-demand software and hosted software. The
term "software as a service" (SaaS) is considered to be part of the nomenclature of cloud computing,
along with infrastructure as a service (IaaS), platform as a service (PaaS), desktop as a service
(DaaS),managed software as a service (MSaaS), mobile backend as a service (MBaaS), datacenter as a
service (DCaaS), and information technology management as a service (ITMaaS).
SaaS apps are typically accessed by users using a thin client, e.g. via a web browser. SaaS has become a
common delivery model for many business applications, including office software, messaging software,
payroll processing software, DBMS software, management software, CAD software, development
software, gamification, virtualization, accounting, collaboration, customer relationship
management (CRM), management information systems (MIS), enterprise resource planning (ERP),
invoicing, human resource management (HRM), talent acquisition, learning management systems, content
management (CM), geographic information systems (GIS), and service desk management. SaaS has been
incorporated into the strategy of nearly all leading enterprise software companies.
Today, Microsoft Azure is becoming a powerful offering not only for software but also for infrastructure.
Examples of SaaS use cases are Cisco WebEx, Zendesk, and even Facebook.
AIM: Write down the basics of PaaS and discuss their use cases
P latform As A Service
Platform as a service (PaaS) is a complete development and deployment environment in the cloud, with
resources that enable you to deliver everything from simple cloud-based apps to sophisticated, cloud-enabled
enterprise applications. You purchase the resources you need from a cloud service provider on a pay-as-you-go
basis and access them over a secure Internet connection.
Like I aaS, PaaS includes infrastructure servers, storage and networking but also middleware, development
tools, business intelligence (BI) services, database management systems and more. PaaS is designed to support
the complete web application lifecycle: building, testing, deploying, managing and updating.
PaaS allows you to avoid the expense and complexity of buying and managing software licenses, the underlying
application infrastructure and middleware, container orchestrators such as Kubernetes or the development tools
and other resources. You manage the applications and services you develop and the cloud service provider
typically manages everything else.
U se Cases
HTML5
JQuery
JavaScript
Microsoft Azure
ASP.NET 4.0
Web Services
SQL
7
Saviant offers Azure PaaS Consulting Services in providing cloud solutions to the clients of varied industries like
Real Estate and Construction Industry. Our Azure developer delivered a cloud-based solution to re-engineer the
We re-platform the client's existing Flash based tool into a highly interactive cloud based solution through Raphael
JS & HTML5 canvas. With this cloud solution, we were able to build an interactive application to dynamically
customize housing floor plans to its end users. Users can dynamically zoom and change floor plans because of the
rich user interface we have provided. With this cloud solution, the client is handling more than 100 web services and
accelerating their performance rate.
C omparison
Scalability – On premises solutions are rather difficult to scale, as the type of hardware needed
depends on your application’s demands. If your app experiences heavy traffic, you might need to
significantly upgrade on-premises hardware. This problem doesn’t exist with a cloud service, which you
can quickly scale up or down with a few clicks. Cloud services are a perfect solution for handling peak
loads. With cloud-based services, businesses can use whatever computing resources they need.
vendor. There’s no need to buy, install, configure, and maintain servers, databases, and other
components of your runtime environment. Moreover, using cloud-based solutions, you pay only for
what you use, so if you don’t need extra resources you can simply scale down and not pay for them.
8
Immediate Availability - Cloud solutions are available as soon as you’ve paid for them, so you can
start using a cloud service right away. There’s no need to install and configure hardware.
Security - Cloud infrastructure is kept in safe data centers to ensure a top level of security. Data is
backed up and can easily be recovered. Moreover, cloud vendors ensure the security of your data by
using networking firewalls, encryption, and sophisticated tools for detecting cybercrime and fraud.
9
Experiment No. 4
AIM: Write down the basis of IaaS and discuss their use cases
Infrastructure As A Service
Infrastructure as a service (IaaS) is an instant computing infrastructure, provisioned and managed over the
internet. It is one of the four types of cloud services, along with software as a service (S aaS), platform as a
service (PaaS) and serverless.
10
Increased Performance
Decreased CapEx
Increased Security
U se Cases
C omparison
Scalability – On premises solutions are rather difficult to scale, as the type of hardware needed depends
on your application’s demands. If your app experiences heavy traffic, you might need to significantly
upgrade on-premises hardware. This problem doesn’t exist with a cloud service, which you can quickly
scale up or down with a few clicks. Cloud services are a perfect solution for handling peak loads. With
cloud-based services, businesses can use whatever computing resources they need.
vendor. There’s no need to buy, install, configure, and maintain servers, databases, and other
components of your runtime environment. Moreover, using cloud-based solutions, you pay only for
what you use, so if you don’t need extra resources you can simply scale down and not pay for
them.
Immediate Availability - Cloud solutions are available as soon as you’ve paid for them, so you
can start using a cloud service right away. There’s no need to install and configure hardware.
11
Performance - Cloud companies equip their data centers with high-performance computing
Security - Cloud infrastructure is kept in safe data centers to ensure a top level of security. Data is
backed up and can easily be recovered. Moreover, cloud vendors ensure the security of your data by
using networking firewalls, encryption, and sophisticated tools for detecting cybercrime and fr
E xperiment – 5
AIM: Write down the steps to create multiple VMs and configure them using Virtual Box.
These are the steps to install multiple VMs through VirtualBox. It uses
various VirtualBox Manage commands to prepare the Virtual Machine. The VirtualBox Manage
unattended install command is then used to install and configure the operating system.
2. Create a virtual hard disk and storage devices for the VM.
Create a 32768 MB virtual hard disk.
Create a SATA storage controller and attach the virtual hard disk.
Create an IDE storage controller for a virtual DVD drive and attach an ISO installation.
Note that the specified password is also used for the root user account on the VM.
We’ll go with a Typical configuration. If you’re feeling fancy and really want to tweak the parameters, you can
pick a Custom one, but we won’t be going through a full Custom setup.
18
19
Choose a name for your Virtual Machine as well as a location where it will be stored.
20
If you want to get fancy, you can customize the hardware that your VM will use. I’ll go ahead and do this to
show you some of the options you can change, but if you’re okay with the VMware defaults you can go ahead and
select “Finish”.
Selecting the Memory option, I can increase or decrease the available RAM for this VM. I’ll go for 2GB instead
of the default 1GB. 21
When you’re done tweaking the hardware you can close the windows and click “Finish” on the New VM Wizard.
22
Once you’re ready to begin installing, simply click on “Power on this virtual machine”. From here on the install
should begin.
Installing Windows as a virtual machine is no different from making a clean install of Windows.
23
24
This experiment describes the installation of the Google App Engine Software Development
Kit (SDK) on a Microsoft Windows and running a simple “hello world” application.
The App Engine SDK allows you to run Google App Engine Applications on your local
computer. It simulates the runtime environment of the Google App Engine infrastructure.
If you don't already have Python 2.5.4 installed in your computer then download and Install
Python 2.5.4 from:
https://www.python.org/download/releases/2.5.4/
You can download the Google App Engine SDK by going to:
https://code.google.com/appengine/downloads.html
Download the Windows installer. The simplest thing is to download it to your Desktop or
another folder that you remember.
25
Click through the installation wizard and it should install the App Engine. If you do not have
Python 2.5, it will install Python 2.5 as well.
Once the install is complete you can discard the downloaded installer.
26
Now you need to create a simple application. We could use the “+” option to have the launcher
make us an application but instead we will do it by hand to get a better sense of what is going
on.
Make a folder for your Google App Engine applications. I am going to make the Folder on
my Desktop called “apps” the path to this folder is:
C:\DocumentsandSettings\csev\Desktop\apps
And then make a sub folder in within apps called “ae01trivial” the path to this folder would be:
C:\DocumentsandSettings\csev\Desktop\apps\ae01trivial
Using a text editor such as JEdit (www.jedit.org), create a file called app.yaml in the
Ae 01 trivial folder with the following contents:
application: ae-01-trivial
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: index.py
Note: Please do not copy and paste these lines into your text editor, you might end up with
strange characters, simply type them into your editor.
Then create a file in the ae01trivial folder called index.py with three lines in it:
print 'Content-Type:text/plain'
print ' '
print 'Hello thereChuck'
Then start the Google App Engine Launcher program that can be found under Applications
File.
Add Existing Application command and navigate into the apps directory and select the
ae01trivial folder. Once you have added the application, select its path that you can control the
application using the launcher.
27
Paste https://localhost:8080 into your browser and you should see your application
as follows:
Just for fun, edit the index.py to change the name “Chuck” to your own name and press
Refresh in the browser to verify your updates.
You can watch the internal logo of the actions that the web server is performing when you are
interacting with your application in the browser. Select your application in the Launcher and press
the Logs button to bring up a log window:
28
With two files to edit, there are two general categories of errors that you may encounter. If you
make a mistake on the app.yaml file, the App Engine will not start and your launcher will show a
yellow icon near your application:
To get more detail on what is going wrong, take a look at the log for the application:
29
If you make a syntax error in the index.py file, a Python trace back error will appear in your
browser.
The error you need to see is likely to be the last few lines of the output, in this case I made a
Python syntax error on line one of our one line application.
Reference: https://en.wikipedia.org/wiki/Stack_trace
When you make a mistake in the app.yaml file, you must then fix the mistake and attempt to
start the application again.
30
To shut down the server, use the Launcher, select your application and press the
Stop button.
31
Cloud Sim is written in Java. The knowledge you need to use Cloud Sim is basic Java programming
and some basics about cloud computing. Knowledge of programming IDEs such as Eclipse or
NetBeans is also helpful. It is a library and, hence, Cloud Sim does not have to be installed.
Normally, you can unpack the downloaded package in any directory, add it to the Java class path and
it is ready to be used. Please verify whether Java is available on your system.
2. Open Eclipse
4. Import an unpacked Cloud Sim project into the new Java Project
5. The first step is to initialise the Cloud Sim package by initialising the CloudSim library,as
follows:
Cloud Sim.init(num_user, calendar, trace_flag)
6. Data centres are the resource providers in Cloud Sim; hence, creation of data centres is a
second step. To create Datacenter, you need the Data center Characteristics object that stores the
properties of a data centre such as architecture, OS, list of machines, allocation policy that covers
the time or space shared, the time zone and itsprice:
Datacenter datacenter9883 = new Data center (name, characteristics, new Vm Allocation Policy Simple (host
List)
8. The fourth step is to create one virtual machine unique ID of the VM, user Id ID of the
VM’s owner, mips, number Of Pes amount of CPUs, amount of RAM, amount of bandwidth,
amount of storage, virtual machine monitor, and cloudlet Scheduler policy for cloudlets:
Vmvm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new Cloudlet
Scheduler Time Shared())
32
33
Cloud Sim
Cloud Sim is a programming language based simulator and even though it does not support a
graphical user interface for simulation, it proposes the Cloud Analyst (which is an extension of
Cloud Sim) for investigators who prefers using a user friendly interface to carry out their
researches. Cloud Sim presents itself to the cloud computing researchers as a Java based
framework that supports the main characteristics of Cloud Computing (IaaS) with virtualization
support and task scheduling (PaaS and SaaS) and open up the door for emerging, integrating and
testing new algorithms for task scheduling or new characteristics development, which helped on
delivering new simulators.
Our choice for Cloud Sim stems from it openness and clear logic which is deficient on the other
simulators specifically with GUI based simulators where we were not able to tackle the Cloud
infrastructure layer to better test algorithms related to CPU allocation and introduce new
algorithms. Cloud Sim was the accurate selection for our research, which is focused on
evaluating and assessing the CPU scheduling algorithms for resources allocation in order to help
Cloud providers and users make precise decision about Cloud Computing model adoption.
Cloud Sim Architecture & Design
Cloud Sim is a Java application that was founded on Grid Sim, which is a simulator and a toolkit
for modeling and simulation of entities in parallel and distributed computing, Cloud Sim was
designed in a layered architecture. At the lowest layer, we find the “Sim Java” (Discrete Event
Simulation) which implements the core functionalities needed by the higher level of simulation
(Data Center, Host, Virtual machine). Just above the Sim Java we find the “Grid Sim” toolkit for
modeling multiple Grid infrastructures, including networks and associated traffic. At the next
layer, we find the Cloud Sim simulation layer, which provides support for modeling and
simulation of virtualized Cloud based data center environments including dedicated management
interfaces for VMs, memory, storage, and bandwidth. This layer handles the fundamental issues,
such as provisioning of hosts to VMs, managing application execution, and monitoring dynamic
system state. The top layer in the Cloud Sim simulation toolkit is the “User Code” which is the
main interface for simulation specifications and characteristics configuration (number of
machines, applications, tasks, users, scheduling policies and their basic structure).
34
A cloud provider main interest is to increase profits by achieving high levels of users’
satisfaction, which comes with providing the end user with the best experience. Hence, comes
the importance of choosing the finest scheduling algorithms for resources allocation and task
scheduling. The key purpose of scheduling algorithms is the appropriate allocation of task or a
job to the appropriate resource. Therefore, it goes back always to the period necessary to carry
out the execution of a specific task in order to evaluate the quality and performance of the
scheduling algorithms.
In reference to this critical factor, Cloud Sim proposes two levels of resources allocation policies
based on two basic scheduling policies, which are the time-shared and space-shared allocation
policies. These allocation policies are implemented during the virtual machines construction and
throughout the application execution.
36
Step 1: Download the Java 8 Package. Save this file in your home directory.
Command: wget
https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop- 2.7.3.tar.gz
37
Open. bashrcfile. Now, add Hadoop and Java Path as shown below.
Command: vi .bashrc
For applying all these changes to the current Terminal, execute the source command.
To make sure that Java and Hadoop have been properly installed on your system
and can be accessed through the Terminal, execute the java -version and hadoop
version commands.
38
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
39
Coresite.xml informs Hadoop daemon where Name Node runs in the cluster. It
contains configuration settings of Hadoop core such as I/O settings that are common
to HDFS & Map Reduce.
40
hdfs site.xml contains configuration settings of HDFS daemons i.e. Name Node,
Data Node, Secondary Name Node. It also includes the replication factor and block
size of HDFS.
Step 9: Edit the mapred site.xml file and edit the property mentioned below inside configuration
tag:
In some cases, mapred-site.xml file is not available. So, we have to create the
mapred site.xml file using mapred-site.xml template.
41
Step 10: Edit yarn site.xml and edit the property mentioned below inside
configuration tag:
42
Hadoop env.sh contains the environment variables that are used in the
script to run Hadoop like Java home path, etc.
43
Step 12: Go to Hadoop home directory and format the Name Node.
Command: cd
This formats the HDFS via Name Node. This command is only executed for the
first time. Formatting the file system means initializing the directory specified
by the dfs.name.dir variable.
Never format, up and running Hadoop file system. You will lose all your data
stored in the HDFS.
Command: cd hadoop-2.7.3/sbin
Either you can start all daemons with a single command or do it individually.
Command: ./start-all.sh
The Name Node is the centerpiece of an HDFS file system. It keeps the directory
tree of all files stored in the HDFS and tracks all the file stored across the cluster.
44
On startup, a Data Node connects to the Name node and it responds to the requests
from the Name node for different operations.
Resource Manager is the master that arbitrates all the available cluster resources
and thus helps in managing the distributed applications running on the YARN
system. Its work is to manage each Node Managers and the each application’s
Application Master.
45
The Node Manager in each machine framework is the agent which is responsible for
managing containers, monitoring their resource usage and reporting the same to the
Resource Manager.
Job History Server is responsible for servicing all job history related requests from client.
Step 14: To check that all the Hadoop services are up and running, run the
below command.
Command: jps
46
47