Ccs335-Cloud Computing Lab Record
Ccs335-Cloud Computing Lab Record
:1
Date :
Aim:
To Install VMware Workstation with different flavours of linux or windows OS on
top of windows7 or 8.
Procedure:
Step1-Download Link
Link for downloading the software is https://www.vmware.com/products/workstation-
pro/workstation-pro-evaluation.html.Download the software for windows. Good thing is
that there is no signup process. Click and download begins. Software is around 541 MB.
Step4-UserAccessControl(UAC)Warning
Now you should see User Access Control(UAC) dialog box.Click yesto continue.
Initial Splash screen will appear. Wait for the process to complete.
VMware Workstation15 Installation Splash Screen
Step5-VMware Workstation Setup wizard
Now you will see VMware Workstation setup wizard dialog box. Click next to continue.
Step6-End User License Agreement
This time you should see End User License Agreement dialog box. Check “I accept the
terms in the License Agreement” box and press next to continue.
Step8-UserExperience Settings
Next you are asked to select “Check for Updates” and “Help improve VMware Workstation
Pro”.Do as
You wish. I normally leave it to defaults that is unchecked.
assfd
Step12-License Key
If you see the dialog box asking for license key, click on trial or enter the license key.
Then what you have is the VMware Workstation15Pro running on your
windows10desktop.If don’t have the license key, you will have 30 days trial.
RESULT:
Aim:
To Install VMware Workstation with different flavours of linux or windows OS on
top of windows7 or 8.
Procedure:
Step 1: Install
1.Visithttp://www.virtualbox.org/wiki/downloads
2.Download Virtual Box platform packages for your OS
3.Open the Installation Package by double clicking
Step 2. Click continue and finish installing Virtual Box
CLI
CK
1. Run Virtual Box by double-clicking the icon
2. Click “New” button on the top left corner
3. Click“ Continue” on the pop-up window
.
4. Type VMname,select “Linux” for the OS and choose “Ubuntu” for the version
5. Choose the amount of memory to allocate(I suggest choosing between5I2MB to I024MB)
6.Click Continue or Next
7. Choose create a new virtual hard disk
8. Click Continue or Next
9.Choose VDI(Virtual Box Disk Image)
10.Click Continue or Next
11.Choose “Dynamically Allocated” click continue.
12.This way, the size of your Virtual Hard Disk will grow as you use.
I3.Click the folder icon and choose the ubuntu iso file you downloaded.
14.Select the size of the Virtual Disk (I recommend choosing 8GB) and click continue
I5.ClickCreate
Running Linux
RESULT:
Thus the Virtual box was created and Successfully installed Linux.
Ex.No.:2
Date :
Install a C compiler in the virtual machine created using virtual box and
execute Simple Programs
Aim:
To Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
Procedure:
I. Open Terminal(Applications-Accessories-Terminal
2.Open ged it by typing “gedit&” on terminal ( Yo u can also use any other Text Editor Application)
#include<stdio.h>
main()
{
printf("Hello World\n");
}
RESULT:
Thus the above simple program was successfully executed and verified in C Compiler.
Ex.No.:3
Date :
Install Google App Engine. Create hello world app and other simple web
applications using python/java.
Aim:
To Install Google App Engine. Create hello world app and other simple web
applications using python/java.
Procedure:
This document 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 run--‐time environment of the Google App Engine infrastructure.
Pre--Requisites:Python2.5.4
If you don't already have Python2.5.4 installed in your computer, download and Install
Python2.5.4 from: http://www.python.org/download/releases/2.5.4/
You can download the Google App Engine SDK by going to:
Click through the installation wizard, and it should install the App Engine. If you do
not have Python2.5, it will install Python2.5 as well.
Once the install is complete you can discard the downloaded installer
RESULT:
Thus the Google App Engine successfully installed and simple python program was
verified.
Ex.No.:4
Date :
Aim:
Procedure:
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 Desk top called “apps”–the path to this folder is:
C:\DocumentsandSettings\csev\Desktop\apps
And then make a sub--‐folder in within apps called“ae--01--trivial”–the path to this folder would
be:
C:\DocumentsandSettings\csev\Desktop\apps\ae--01--trivial
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-trivialversion:1
runtime:pythonapi_version:1
handlers:
-url:/.*
script:index.py
Note: Please do not copy and paste these lines in to your text editor–you might end up with
strange characters–simply type the min to your editor.
Then create a file in the ae--01--trivial folder called index.py with three lines in it:
print'Content-Type:text/plain'print''
print'Hellothere Chuck'
Then start the Google App Engine Launcher 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: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 up dates.
You can watch the internal log 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:
Each time you press Refresh in your browser–you can see it retrieving the
output with a GET request.
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:
In this instance–the mistake is mis--‐indenting the last line in the app.yaml(line8).
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--‐line application.
Reference: http://en.wikipedia.org/wiki/Stack_trace
When you make a mistake in the app.yaml file–you must the fix the mistake
and attempt to start the application again.
If you make a mistake 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.
Shutting Down the Server
To shutdown the server, use the Launcher, select your application and press the
Stop button.
CharlesSeveranceCommentsandquestionstocsev@u
mich.eduwww.dr--‐chuck.com
RESULT:
Thus the Use GAE launcher to launch the web applications were executed in
successfully.
Ex.No.:5
Date :
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:
How to use Cloud Simin Eclipse
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 NetBeans 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 theJava class path and it is ready to be used. Please verify whether Java is available
on your system.
To use Cloud Sim in Eclipse:
1. Download CloudSim install able files
fromhttps://code.google.com/p/cloudsim/downloads/listandunzip
2. Open Eclipse
3. Create a new Java Project: File->New
4. Import an unpacked CloudSim project in to the new Java Project
5. The first step is to initialize the Cloud Sim package by initialising
the Cloud Sim library, as follows:
CloudSim. init(num_user,calendar,trace_flag)
6. Data centres are the resource providers in CloudSim; hence, creation of data
centres is a second step. To create Datacenter, you need the Datacenter 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 its
price:
Datacenterdatacenter9883=newDatacenter(name,characteristics,newVmAllocationPolicy
Simple(hostList),s
7. The third step is to create a broker:
Datacenter Broker broker=createBroker();
8. The fourth step is to create one virtual machine uniqueID of the VM, userId 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 cloud let Scheduler policy
for cloudlets:
Vmvm=newVm(vmid,brokerId,mips,pesNumber,ram,bw,s
ize,vmm,new CloudletSchedulerTimeShared())
9. Submit the VMlist to the broker:
broker.submitVmList(vmlist)
10. Create a cloud let with length, filesize, outputsize, andutilisationmodel:
Cloud let cloud let=new Cloudlet (id,length,pesNumber,fileSize,outputSize,
utilizationModel, utilization Mode
11. Submit the cloudlet list to the broker:
broker.submitCloudletList(cloudletList)
12. Start the simulation:
CloudSim.startSimulation()
RESULT:
Find a procedure to transfer the files from one virtual machine to another
virtual machine.
Aim:
To find a procedure to transfer the files from one virtual machine to another virtual
Machine
Procedure:
1. You can copy few (or more) lines with copy & paste mechanism.
For this you need to share clipboard between host OS and guest OS, installing Guest
Addition on both the virtual machines (probably setting bidirectional and restarting them).
You copy from guest OS in the clipboard that is shared with the host OS.
Then you paste from the host OS to the second guest OS.
2. You can enable drag and drop too with the same method (Click on the machine, settings,
general, advanced, drag and drop: set to bidirectional )
3. You can have common Shared Folders on both virtual machines and use one of the
directory shared as buffer to copy.
Installing Guest Additions you have the possibility to set Shared Folders too. As you
put a file in a shared folder from host OS or from guest OS, is immediately visible to the
other.(Keep in mind that can arise some problems for date/time of the files when there are
different clock settings on the different virtual machines).
If you use the same folder shared on more machines you can exchange files directly
copying them in this folder.
4. You can use usual method to copy files between 2 different computer with client-server
application. (e.g. scp with sshd active for linux, winscp... you can get some info about SSH
servers e.g. here)
You need an active server (sshd) on the receiving machine and a client on the sending
machine. Of course you need to have the authorization setted (via password or, better, via
an automatic authentication method).
Note: many Linux/Ubuntu distribution install sshd by default: you can see if it is running
with pgrep sshd from a shell. You can install with sudo apt-get install openssh-server.
5. You can mount part of the file system of a virtual machine via NFS or SSHFS on the other,
or you can share file and directory with Samba.
You may find interesting the article Sharing files between guest and host without VirtualBox
shared folders with detailed step by step instructions.
You should remember that you are dialing with a little network of machines with different
operative systems, and in particular:
• Each virtual machine has its own operative system running on and acts as a physical
machine.
• Each virtual machine is an instance of a program owned by an user in the hosting operative
system and should undergo the restrictions of the user in the hosting OS.
E.g Let we say that Hastur and Meow are users of the hosting machine, but they did not allow
each other to see their directories (no read/write/execute authorization). When each of them
run a virtual machine, for the hosting OS those virtual machine are two normal programs
owned by Hastur and Meow and cannot see the private directory of the other user. This is a
restriction due to the hosting OS. It's easy to overcame it: it's enough to give authorization to
read/write/execute to a directory or to chose a different directory in which both users can
read/write/execute.
When you will need to be fast with Linux you will feel the need of ssh-keygen and to
Generate once SSH Keys to copy files on/from a remote machine without writing password
anymore. In this way it functions bash auto-completion remotely too!
RESULT:
Thus the find a procedure to transfer the files from one virtual machine to another
virtual Machine was verified.
Ex.No.:7
Date :
Find a procedure to launch virtual machine using trystack
(Online Openstack Demo Version)
Aim:
To Find a procedure to launch virtual machine using trystack (Online Openstack
Demo Version)
Procedure:
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 TryStack Group, you can log in TryStack.
TryStack.org Homepage
I assume that you already join to the Facebook Group and login to the dashboard. After you
log in to the TryStack, you will see the Compute Dashboard like:
OpenStack Compute Dashboard
Network topology
As you see from the image above, the instance will be connected to a local network and the
local network will be connected to internet.
1. Fill Network Address with appropriate CIDR, for example 192.168.1.0/24. Use private
network CIDR block as the best practice.
2. Select IP Version with appropriate IP version, in this case IPv4.
3. Click Next.
4. In Subnet Details tab, fill DNS Name Servers with 8.8.8.8 (Google DNS) and then
click Create.
You need the instance to connect to the network that we just created in the previous step.
1. Go to Compute > Instances and then click Launch Instance.
2. In Details tab,
1. Fill Instance Name, for example Ubuntu 1.
2. Select Flavor, for example m1.medium.
3. Fill Instance Count with 1.
4. Select Instance Boot Source with Boot from Image.
5. Select Image Name with Ubuntu 14.04 amd64 (243.7 MB) if you want install
Ubuntu
14.04 in your virtual machine.
RESULT:
Thus the find a procedure to launch virtual machine using trystack (Online Openstack
Demo Version) was verified.
Ex.No.:8
Date :
Install Hadoop single node cluster and run simple applications like word
count.
Aim:
To Install Hadoop single node cluster and run simple applications like word count
Procedure:
Install Hadoop
Step 1: Click here to download the Java 8 Package. Save this file in your
home directory.
Fig:HadoopInstallation–ExtractingJavaFiles
Step3:DownloadtheHadoop2.7.3Package.
Command: wget
https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop- 2.7.3.tar.gz
Step4:ExtracttheHadooptarFile.
Command:tar-xvfhadoop-2.7.3.tar.gz
Command:source bashrc
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.
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
All the Hadoop configuration files are located in hadoop-2.7.3/etc/hadoop directory as
you can see in the snapshot below:
Command:vicore-site.xml
Fig:Hadoop Installation–Configuring core-site.xml
1
<?xmlversion="1.0"encoding="UTF-8"?>
2 <?xml-stylesheettype="text/xsl"href="configuration.xsl"?>
3 <configuration>
4 <property>
5 <name>fs.default.name</name>
6 <value>hdfs://localhost:9000</value>
</property>
7 </configuration>
8
Step8: Edit hdfs-site.xml and edit the property mentioned below inside configuration
tag:hdfs-site.xml contains configuration settings of HDFS daemons (i.e. NameNode,
DataNode, Secondary NameNode). It also includes the replication factor and block size of
HDFS.
Command: vi hdfs-site.xml
Fig:Hadoop Installation–Configuringhdfs-site.xml
1
2 <?xmlversion="1.0"encoding="UTF-8"?>
3 <?xml-stylesheettype="text/xsl"href="configuration.xsl"?>
<configuration>
4 <property>
5 <name>dfs.replication</name>
6 <value>1</value>
7 </property>
8 <property>
<name>dfs.permission</name>
9 <value>false</value>
10 </property>
11 </configuration>
12
Step 9:Edit the mapred-site.xmlfile 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.
Command:cpmapred-site.xml.templatemapred-site.xml
Command:vimapred-site.xml.
Fig:HadoopInstallation–Configuringmapred-site.xml
1
<?xmlversion="1.0"encoding="UTF-8"?>
2 <?xml-stylesheettype="text/xsl"href="configuration.xsl"?>
3 <configuration>
4 <property>
5 <name>mapreduce.framework.name</name>
6 <value>yarn</value>
</property>
7 </configuration>
8
Step 10: Edit yarn-site.xml and edit the property mentioned below inside
configuration tag:
yarn-site.xml contains configuration settings of Resource Manager and Node Manager like
application memory management size, the operation needed on program & algorithm, etc.
Command: vi yarn-site.xml
Fig:HadoopInstallation–Configuringyarn-site.xml
1
2
<?xmlversion="1.0">
3 <configuration>
4 <property>
5 <name>yarn.nodemanager.aux-services</name>
6 <value>mapreduce_shuffle</value>
</property>
7 <property>
8 <name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</
9 name>
1 <value>org.apache.hadoop.mapred.ShuffleHandler</value>
0 </property>
</configuration>
1
1
Step 11: Edit hadoop-env.sh and add the Java Path as mentioned below: hadoop-env.sh
contains the environment variables that are used in the script to run
Hadoop like Java home path, etc.
Command: vi hadoop–env.sh
This formats the HDFS via NameNode. 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.
Start DataNode:
On startup, a Data Node connects to the Name node and it responds to the requests
from the Name node for different operations.
Command: ./hadoop-daemon.sh start data node
Start JobHistoryServer:
JobHistoryServer 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
Fig:HadoopInstallation–Checking Daemons
RESULT:
Thus a single node Hadoop cluster was successfully installed and also word count
application was verified.