Lab Manual
Lab Manual
AIM:
To find procedure to Install Virtual box/ VM ware Workstation with different flavors
of Linux or windows OS on top of windows 7 or 8.
PROCEDURE:
fromhttps://www.virtualbox.org/wiki/Downloads
Step2: Install it in Windows, once the installation has done open it.
1
Step 3: Create Virtual Machine by clicking on New.
Step4: Specify RAM Size, HDD Size, and Network Configuration and Finish the wizard.
Step5: To select the media for installation Click on start and browse for iso file. In
2
Step 6: Complete the Installation and use it. Now complete the installation using standardizes
instructions to use it.
RESULT:
Thus Virtual box/VMware workstation with different flavors of Linux or windows OS
on top of windows7or 8 is successfully executed.
3
Ex No: 2 Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
AIM:
To install ‘C’ compiler inside that virtual machine and execute programs.
PROCEDURE:
The package GCC needs to be installing to use C compiler. The GNU Compiler
Collection (GCC) is a collection of compilers and libraries for C, C++, Objective-C,
FORTRAN, Ada, Go, and D programming languages. Many open-source projects, including
the GNU tools and the Linux kernel, are compiled with GCC. The steps for installing GCC
and running C programs are as follows.
4
# include<stdio.h>
int main()
{
printf ("Hello World\n");
return0;
}
$./Hello
RESULT:
5
Ex No: 3 Install Google App Engine. Create hello world app and other simple web applications
using python/java.
AIM:
Write a procedure Install Google App Engine, create hello world app, and other
simple web Applications using Python.
PROCEDURE:
The App Engine SDK allows you to run Google App Engine Applications on your
local computer. It simulates the run Gtime environment of the Google App Engine
infrastructure.
Pre-Requisites: Python2.5.4
If you don't already have Python 2.5.4installed in your computer, download and Install
Python 2.5.4 from.
Download and Install
• You can download the Google App Engine SDK by going to download the appropriate install
package.
6
Once the install is complete you can discard the downloaded installer.
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:\Documentsand Settings\csev\Desktop\apps
And then make a sub-folder in within apps called “ae-01-trivial” – the path to this folder
would be:
C:\DocumentsandSettingscsev\Desktop\apps\ae-01-trivial
Using a texted it or such as Jedit (www.jedit.org),createa file called app.yamlin the ae-01-trivial
Folder with the following contents:
Application: ae-01-
trivialversion:1
runtime: pythonapi_version:1
handlers:-
url:/.*script:index.p
y
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.
7
Then create a file in the ae-01-trivial folder called index.py with three lines in it:
Then start the GoogleAppEngineLauncher program that can be found under Applications. Use
the File->Add Existing Application command and navigate into the apps directory and select the
ae-01-trivial folder. Once you have added the application, select it so that you can control the
application using the launcher.
Once you have selected your application and press Run. After a few moments your application
will start and the launcher will show a little green icon next to your application. Then press
Browse to open a browser pointing at your application which is running at http://localhost:8080/
Paste http://localhost:8080into 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 our updates.
To get more detail on what is going wrong, take a look at the log for the application: In this
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 online one of our one G line application.
Reference: http://en.wikipedia.org/wiki/Stack_trace
When you make am I stake in the app.yamlfile–you must the fix them is take and attempt to
start the application again.
If you make is take in a file like index.py, you can simply fix the file and press refresh in your
browser–there is no need to restart the server.
8
Shutting Down the Server
To shut down the server, use the Launcher, select your application and press the Stop
button.
RESULT:
Thus the Install Google App Engine, create hello world app, and other simple web
applications using Python successfully executed.
9
Ex .No: 4 Use GAE launcher to launch the web applications.
AIM:
PROCEDURE:
To use Google's tools for your own site or app, you need to create a new project on Google Cloud
Platform. This requires shaving a Google account.
1. Go to the AppEngine dashboard on the Google Cloud Platform Console and press the Create
button.
2. If you’ve not created a project before, you'll need to select whether you want to receive email
updates or not, agree to the Terms of Service, and then you should be able to continue.
3. Enter a name for the project, edit your projected and note it down. For this tutorial, the
following values are used:
a. Project Name :GAE Sample Site Project ID:gaesamplesite
4. Click the Create button not create your project.
Step2-Creating an application
Each Cloud Platform project can contain one AppEngine application. Let's prepare an app for our
project.
We'll need a sample application to publish. If you've not got one to use, download and unzip this
sample app.
1. Have a look at the sample application's structure - the website folder contains your website
content and app.yamlis your application configuration file.
2. Your website content must go inside the website folder, and its land ing page must be called
index.html, but apart from that it can take whatever form you like.
3. The app.yaml file is a configuration file that tells App Engine how to map URLs to your
static files. You don' t need to edit it.
1. Now that we've got our project made and sample app files collected together, let's publish our
app.
2. Open Google Cloud Shell.
3. Drag and drop the sample-app folder into the left pane of the code editor.
4. Run the following in the command line to select your project: Gcloudconfig set project gae
sample site
5. Then run the following command to go to your app's directory: cdsample-app
6. You are now ready to deploy your application, i.e.upload your app to App Engine:
Gcloudappdeploy
7. Enter a number to choose their gion where you want your application located.
10
8. Enter Y to confirm.
9. Now navigate your browser to your - project- id. appspot.com to see your website online. For
example, for the projected gae samplesite, goto gaesamplesite.appspot.com.
SOURCE:
<!DOCTYPEhtml>
<html>
<head>
<title>MYPROJECT</title>
<style>ul{
list-style-type: none;padding:0;
margin: 0; overflow:hidden;
background-color:#333;
}
li{
float:left;
}
lia{
display:block;color:white; padding: 14px16px;text-align: center;text-decoration:none;
}
lia:hover{
background-color:#111;
}
.active{
background-color:#4CAF50;
}
</style>
</head>
<bodystyle="background-color:powderblue;">
<palign=center>
<h1align=centerstyle="color:darkblue;">EverGreen</h1>
</p>
<ul>
<li>
<aclass:"active"href="#home">Home</a>
</li>
<li>
<ahref="#aboutus">Aboutus</a>
</li>
<li>
<ahref="#product">Product</a>
11
</li>
<li>
<ahref="#contact">Contact</a>
</li>
</ul>
<br>
<imgsrc="https://specials-
images.forbesimg.com/imageserve/1141999659/960x0.jpg?fit=scale"width=1350pxheight=450px><
/body></html>
RESULT:
Thus the use GAE (GoogleAppEngine) launcher to launch web application has been executed
successfully.
12
Ex No: 5 Simulate a cloud scenario using CloudSim and run a scheduling algorithm
that is not present in CloudSim
AIM:
To simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not present in
CloudSim.
PROCEDURE:
Step2:Install Eclipse
13
CloudSim is written in Java. The knowledge you need to use CloudSim is basic Java
programming and some basics about cloud computing. Knowledge of programming IDEs
such as Eclipse or Net Beans is also helpful. It is a library and, hence, CloudSim 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.
From https://code.google.com/p/cloudsim/downloads/listandunzip
2. Open Eclipse
5. The first step is to initialize the Cloud Sim package by initializing the CloudSim library
,as Follows:
CloudSim.init (num_user,calendar,trace_flag)
1. Data centers are the resource providers in CloudSim; hence, creation of data centers is a
second step. To create Data center, you need the Data center Characteristic s 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 its price:
Data center data center 9883 = new Datacenter (name, characteristics, new VmAllocation Policy
Simple (hostList)
2. The third step is to create a broker : Data center Broker broker = create Broker();
14
3. The fourth step is to create one virtual machine unique ID of the VM, userId ID of theVM’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())
5. Create a cloud let with length, file size, output size, and utilization model:
15
RESULT:
Thus Simulation of a cloud scenario using CloudSim and run a scheduling algorithm
that is not present in CloudSim was successfully executed.
16
Ex No: 6 Find a procedure to transfer the files from one virtual machine to another virtual
machine
AIM:
To find a Procedure to transfer files from one VM to another VM inVirtual Box.
PROCEDURE:
A shared folder is a folder which makes its files available on both the guest machine
and the host machine at the same time. Creating a shared folder between the guest and the
host allows you to easily manage files which should be present on both machines. The course
virtual machines are ready to use shared folders right away, but if you are using the virtual
machine on your personal computer you will need to specify which folder to use as shared
storage.
• Folder Path: The folder name on the host machine. Click the drop down menu and
navigate to the folder you would like to share.
• Folder Name: This is then ame of the folder asit will appear on the guest machine.
• Read-Only: If you check read-only, the guest machine will be unable to write changes to
the folder. This is valuable when you only want to send files to the virtual machine, but do
not want to risk having the files modified by the guest.
17
• Auto-Mount: When any external storage is connected to a computer it must be mounted in
order to be used. It is recommended that you turn on auto-mounting, unless you are familiar
with the process of mounting a drive yourself.
• Mount Point: Unless you already know about mount points, leave this blank.
• Make Permanent: If you check this, the shared folder will be a permanent machine folder.
If it is not checked, the folder will not be shared after a shutdown.
• On the course virtual machines, when you load into the desktop, you should see a folder
labeled Shared Folders. In there you will see any folders that are currently mounted and being
shared.
Dragging and Dropping Files in VirtualBox:
If you only need to transfer a few files quickly, you can simply drag and drop the files
in. On the top bar of the running guest machine, click on Devices > Drag and Drop and make
sure that Bidirectional is selected. This means that you will be able to drag files from the host
to the guest and from the guest to the host. Once bidirectional drag and drop is checked, you
should be able to begin dragging and dropping files. You can also drag files from the guest
machine into the host. To do this, simply open the file browser on the host to where you
would like to drop the files and drag the files from the virtualmachine into the file browser of
the host. File transfers should be pretty quick; if the virtual machine seems stuck when
transferring, simply cancel the transfer and try again.
GUESTOS:
HOST OS:
18
RESULT:
19
Ex No: 7 Find a procedure to launch virtual machine using trystack (Online Openstack Demo
Version)
AIM:
To find a procedure to demonstrate installation and configuration of openstack private cloud.
PROCEDURE:
OpenStack is an open-source software cloud computing platform. OpenStack is primarily
used for deploying an infrastructure as a service (IaaS) solution like Amazon Web Service
(AWS). In other words, you can make your own AWS by using OpenStack.. OpenStack,
TryStack is the easiest and free way to do it. In order to try OpenStack in TryStack, you must
register yourself by joining TryStack Facebook Group. The acceptance of group needs a couple
days because it’s approved manually. After you have been accepted in the TryStackGroup, you
can login TryStack.
TryStack.orgHomepage
I assume that you already join to the FacebookGroup and login to the dashboard. After you
login to the TryStack, you will see the Compute Dashboard like:
20
21
Step1: Create Network
Network in here is our own local network. So, your instances will be not mixed up with the
others. You can imagine this as your own LAN (Local Area Network) in the cloud.
1. Go to Network> Networks and then click Create Network.
2. In Network tab, fill Network Name for example internal and then click Next.
3. In Subnet tab,
1. Fill Network Address with appropriate CIDR, for example 192.168.1.0/24.Use private network
CIDR block as the best practice.
3. Click Next.
4. In Subnet Details tab, fill DNS Name Servers with 8.8.8.8 (GoogleDNS) and then click
Create.
Now, we will create an instance. The instance is a virtual machine in the cloud, like
AWSEC2.
You need the instance to connect to the network that we just created in the previous step.
22
1. Go to Compute>Instances and then click Launch Instance.
2. In Details tab,
5. Select Image Name with Ubuntu14.04 and 64(243.7MB) if you want install Ubuntu
14.04 In your virtualmachine.
1. Click[+]button of Key Pair to import key pair. This key pair is a public and private key
that
1. Fill Key Pair Name with your machine name (for example Edward-Key).
2. Fill Public Key with your SSH public key (usually is in ~/.ssh/id_rsa.pub). See
description in Import Key Pair dialog box for more information. If you are using
4. In Networking tab,
1. In Selected Networks, select network that have been created inStep1, for example
internal.
5. Click Launch.
6. If you want to create multiple instances, you can repeat step 1-5. I created one more
instance
It doesn’t connect to the internet. To make our network has an internet connection ; we need ar
23
outer that running as the gateway to the internet.
3. Click on your router name link, for example router1, Router Details page.
2. Then OK.
1. Select Subnet with the network that you have been created in Step1.
6. Go to Network> Network Topology. You will see the network topology. In the example,
there are two networks, i.e. external and internal, and those are bridged by a router. There
are instances those are joined to internal network.
Floating IP address is public IP address. It makes your instance is accessible from the
internet.
When you launch your instance, the instance will have a private network IP, but no publicIP.
In OpenStack, the public IP s is collected in a pool and managed by admin (in our case is
TryStack).
5. Click Associate.
6. Now you will get a public IP, e.g.8.21.28.120, for your instance.
Step5: Configure Access & Security Open Stack has a feature like a firewall. It
can white list / blacklist you’re in/out connection. It is called Security Group.
24
1. Go to Compute> Access & Security and then open Security Groups tab.
3. Click Add Rule, choose ALLICMP rule to enable ping into your instance, and then click
Add.
4. Click Add Rule; choose HTTP rule to open HTTP port (port80), and then click Add.
5. Click Add Rule, choose SSH rule to open SSH port (port22), and then click Add.
to Your Instance
Now, you can SSH your instances to the floating IP address that you got in the step 4.If you are
using Ubuntu image, the SSH user will be Ubuntu.
RESULT:
Thus demonstrate installation and configuration of open stack private cloud was successfully
executed.
25
Ex No: 8 Install Hadoop single node cluster and run simple applications like wordcount.
AIM:
To install Hadoop single node cluster and simple application like word count.
PROCEDURE:
Prerequisite:
To install Hadoop, you should have Java version 1.8 in your system. Check your java version
through this command on command prompt Download the file according to your operating system.
Keep the java folder directly under the local disk directory (C:\Java\jdk1.8.0_152) rather than in
Program Files(C:\ProgramFiles\Java\jdk1.8.0_152)as it can create errors after wards.
• Create a new user variable. Put the Variable_name as HADOOP_HOME and Variable_value as
the path of the bin folder where you extracted Hadoop.
• Likewise, create a new user variable with variable name as JAVA_HOME and variable value as
the path of the bin folder in the Java directory.
• Now we need to set Hadoop bin directory and Java bin directory path in system variable
path. Edit Path in system variable
• Click on New and add the bin directory path of Hadoop and Javainit.
Configurations
Now we need to edit some files located in the Hadoop directory of the etc folder where we
installed Hadoop. The files that need to be edited have been highlighted.
1. Edit the file core-site.xml in the hadoop directory. Copy this xml property in the configuration
in the file.
/span>configuration>
/span>property>span>name>fs.defaultFS/span>/
name
span>value>hdfs://localhost:9000</value>
/span>/property>
/span>/configuration>
2. Edit map red-site.xml and copy this property in the configuration /span> configuration>
/span>property>
/span>name>mapreduce.framework.name/span>/name>
/span>value>yarn/span>/value>
26
/span>/property>
/span>/configuration>
Create a folder with the name ‘data node’ and a folder ‘name node’ in this data directory
4. Edit the file hd fs-site.xml and add below property in the configuration
Note: The path of name node and data node across value would be the path of the data node and name
node folders you just created.
/span>configuration>
/span>property>
/span>name>dfs.replication/span>/name>
/span>value>1/span>/value>
/span>/property>
/span>property>
/span>name>dfs.namenode.name.dir/span>/name
/span>value>C:\Users\hp\Downloads\hadoop-3.1.0\hadoop-
3.1.0\data\namenode/span>/value>
/span>/property>
/span>property>
/span>name>dfs.datanode.data.dir/span>/name>
/span>value>C:\Users\hp\Downloads\hadoop-3.1.0\hadoop-
3.1.0\data\datanode/span>/value>
/span>/property>
/span>/configuration>
5. Edit the file yarn-site.xml and add below property in the configuration
/span>configuration>
/span>property>
/span>name>yarn.nodemanager.aux-services/span>/name>
/span>value>mapreduce_shuffle/span>/value>
/span>/property>
/span>property>
/span>name>yarn.nodemanager.auxservices.mapreduce.shuffle.class/span>/name>
/span>value>org.apache.hadoop.mapred.ShuffleHandler/span>/value>
/span>/property>
27
/span>/configuration>
Do it hadoop-env.cmd and replace %JAVA_HOME% with the path of the java folder where your jdk
1.8is installed
Hadoop needs windows OS specific files which do not come with default download of hadoop. To
include those files, replace the bin folder in Hadoop directory with the bin folder
• Download it as zip file. Extract it and copy the bin folder in it. If you want to save the old bin
folder, rename it like bin_old and paste the copied bin folder in that directory.
• Check whether hadoop is successfully installed by running this command on cmd-Hadoop version
• Since it doesn’t throw error and successfully shows the hadoop version, that means hadoop is
successfully installed in the system.
For matting the Name Node is done once when hadoop is installed and not for running hadoop file
system, else it will delete all the data in side HDFS.
Run this command- Hdfs name node–format. It would appear something like this–
Now change the directory in cmd to s bin folder of hadoop directory with this command, (Note: Make
sure you are writing the path as per your system)
Cd C:\Users\hp\Downloads\hadoop-3.1.0\hadoop-3.1.0\sbin
Start name node and data node with this command– start-dfs.cmd
Two more cmd windows will open for Name Node and DataNode Now start yarn through this
command -start-yarn.cmd
Two more windows will open, one for yarn resource manager and one for yarn node manager.
Note: Make sure all the 4 Apache Hadoop Distribution windows are up on running. If they are
not running, you will see an error or a shutdown message. In that case, you need to debug the
error. To access information about resource manager current jobs, successful and failed jobs.
28
To check the details about the hdfs (name node and data node)
Then I will copy a text file named ‘potatoes’ from my local file system to this folder that I just
created in hdfs using copy From Local command-
29
hdfsdfs-copyFromLocalC:\Users\hp\Downloads\potatoes.txt/sample
To verify if the file is copied to the folder, I will use ‘ls’ command by specifying
the folder name which will read the list of files in that folder–
hdfsdfs–ls/sample
To view the contents of the file we copied, I will use cat command-
hdfsdfs–cat/sample/potatoes.txt
To Copy file from hdfs to local directory, I will use get command–
hdfsdfs-get/sample/potatoes.txtC:\Users\hp\Desktop\priyanka
Hadoop Map Reduce can be used to perform data processing activity. However,
it possessed limitations due to which frame works like Spark and Pig emerged
and have gained popularity. 200 lines of Map Reduce code can be written with
less than 10 lines of Pig code. Hadoop has various other components in its
ecosystem like Hive, Sqoop, Oozie, and HBase. You can down load these
software
aswellinyourwindowssystemtoperformdataprocessingoperationsusingcmd.
RESULT:
Thus installation of Hadoop single node cluster and simple application like word
count has executed successfully.
30
Ex NO: 9 Develop new OGSA-compliant Web Service
Aim:
PROCEDURE:
Writing and deploying a WSRF Web Service is easier than you might think. You just
have to follow five simple steps
To run this program, as a minimum you will be required to have installed the following
prerequisite software
a. Download the latest Axis2 runtime from the above link and extract it. Now we point
Eclipse WTP to downloaded Axis2 Runtime. Open Window -> Preferences -> Web
Services -> Axis2 Emitter
Select the Axis2 Runtime tab and point to the correct Axis2 runtime location.
Alternatively at the Axis2 Preference tab, you can set the default setting that will come
up on the Web Services Creation wizards. For the moment we will accept the default
settings.
b. Click OK.
c. Next we need to create a project with the support of Axis2 features. Open File -> New
-> Other... -> Web -> Dynamic Web Project
31
The Web service wizard would be brought up with Web service type set to Bottom up
Java bean Web Service with the service implementation automatically filled in. Move the
service scale to Start service
Click on the Web Service runtime link to select the Axis2 runtime.
32
Ensure that the correct server and service project are selected as displayed below.
33
The Web Service wizard orchestrates the end-to-end generation, assembly, deployment,
installation and execution of the Web service and Web service client. Now that your Web
service is running, there are a few interesting things you can do with this WSDL file.
Examples:
• You can choose Web Services -> Test with Web Services Explorer to test the
service.
• You can choose Web Services -> Publish WSDL file to publish the service to a
public UDDI registry.
RESULT:
Thus the development of a new OGSA-compliant web service was executed
successfully.
34
EX No: 10 Create a spread sheet which contains employee salary information and
calculate gross and total salary using formula DA=10%OF BASIC,HRA=30%OF
BASIC PF= 10% OF BASIC IF BASIC<=3000 12% OF BASIC IF BASIC>3000
TAX=10% OF BASIC IF BASIC<=1500 11% OF BASIC IF BASIC>1500 AND
BASIC<=2500 12% OF BASIC IF BASIC>2500
NET_SALARY=BASIC_SALARY+DA+H RA-PF-TAX
Aim:
To create a spread sheet for employee salary information with gross and total
salary.
PROCEDURE:
1. Sign into Google Sheets. Visit docs.google.com/spreadsheets and sign in with your
Google or Gmail account. Your Gmail account gives you free access to Google Sheets.
2. View your existing sheets. Upon logging in, you will be brought to the main directory.
If you already have existing spreadsheets, you can see and access them from here.
3. Create a new spreadsheet. Click the large red circle with a plus sign on the lower right
corner. A new window or tab will be opened with the web-based spreadsheet.
4. Name the spreadsheet. “Untitled spreadsheet” appears on the top left corner. This is
the current name of the spreadsheet. Click on it, and a small window will appear. Type in
the name of the spreadsheet here, and click the “OK” button. You will see the name
immediately change.
5. Work on the spreadsheet. You can work on Google Sheets much like how you would
work on Microsoft Excel. There’s a header menu and a toolbar with functions very
similar to those of Microsoft Excel.
• calculate gross and total sal using the formula
• DA=10% OF BASIC
• HRA=30% OF BASIC
• PF=10% OF BASIC IF BASIC<=3000
• 12% OF BASIC IF BASIC>3000
• TAX=10% OF BASIC IF BASIC<=1500
• =11% OF BASIC IF BASIC>1500 AND BASIC<=2500
• =12% OF BASIC IF BASIC>2500 9. ( use www.zoho.com and docs.google.com)
• NET_SALARY=BASIC_SALARY+DA+HRA-PF-TAX
6. There’s no need to save with Google Sheets as everything you do is automatically
saved at regular intervals.
35
7. Exit the spreadsheet when you’re finished. If you’re done with your current document,
you can just simply close the window or tab. Everything is saved automatically. You can
access your document from Google Sheets or Google Drive.
RESULT:
Thus the above program was executed successfully.
36