CS8711 CLOUD COMPUTING LAB
CS8711 CLOUD COMPUTING LAB
Name : ……………………….
Register No: ………………………..
Year & Sec: ………………………..
RVS
RVS EDUCATIONAL TRUST’S GROUP OF
INSTITUTION
RVS Nagar, Dindigul- 624 005.
Reg.No.
AIM
PROCEDURE TO INSTALL
Step 1- 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 signupprocess.
Click and download begins. Software is around 541MB.
Screenshot for VMware Workstation 15 pro installation begin confirmation dialog box on windows 10.
Below screenshot shows Installation in progress. Wait for this to complete.
Screenshot for VMware Workstation 15 pro installation process.
At the end you will see installation complete dialog box. Click finish and you are done with the
installation process. You may be asked to restart your computer. Click on Yes to restart.
VMware Workstation 15 Installation – Installation Complete
Step 11- Launch VMware Workstation
After the installation completes, you should see VMware Workstation icon on the desktop. Double click
on it to launch the application.
Screenshot for VMware Workstation 15 Pro icon on windows 10 desktop. Step 12-
Licence Key
If you see the dialog box asking for licence key, click on trial or enter the licence key. Then what you have is the
VMware Workstation 15 Pro running on your windows 10 desktop. If don’t have thelicence key, you will have 30
daystrial.
At some point of time if you decide to buy the Licence key, you can enter the Licence key by going toHelp-
>Enter a Licence Key You can enter the 25 character licence key in the dialog box shown below
and click OK. Now you have the licence version of the software.
RESULT
Thus the Virtualbox/VMware Workstation with different flavours of linux or windows OS on top of
windows7 or8 installed successfully and verified.
EX.NO:2 Install a C compiler in the virtual machine
AIM
Find Procedure to install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
PROCEDURE TO INSTALL
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Click on instances, select VMs then follow the steps to create Virtual machine
a. Expand the + symbol
b. Select user oneadmin
c. Then enter the VM name, no.of instance, cpu.
d. Then click on create button.
e. Repeat the steps the C,D for creating more than one VMs.
Install Linux using VirtualBox
Ch Click the folder icon and choose the ubuntu iso file you downloaded.
Select the size of the Virtual Disk (I recommend choosing 8 GB) and click
continue
choose VDI (VirtualBox DiskImage) I0. Click Continue orNext
ClickCreate
Running Linux
Click the folder icon and choose the ubuntu iso file you downloaded and
click continue andstart
Click InstallUbuntu
Check “Download updates” and clickForward
Choose “Erase disk and install Ubuntu” and click Forward (Don’t worry, it won’t
wipe yourcomputer)
Click “Install Now” and wait. Naybe grab asnack. 7.When finished, click Restart and pressEnter.
C Programming on Linux
I.OpenTerminal(Applications-Accessories-Terminal)
Open gedit by typing “gedit &” onterminal
(You can also use any other Text Editor application)
Type “gcc helloworld.c” to compile, and type “ls” to confirm that a new executable file
“a.out” iscreated
I0.Try other codes from “A Shotgun Introduction to C” on professor Edwards’s webpage.You can also
find many C programing guides online. (justgoogleit!)
RESULT
Thus the C compiler in the virtual machine installed successfully andcreated using virtual box and execute
Simple Programs successfully and verified.
EX.NO 3 Install Google App Engine
AIM
Find Procedure to Install Google App Engine and to 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.
If you don't already have Python 2.5.4 installed in your computer, download and
Install Python 2.5.4 from:
http://www.python.org/download/releases/2.5.4/
You can download the Google App Engine SDK by going to:
http://code.google.com/appengine/downloads.html
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
Making your FirstApplication
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 goingon.
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:
Andthenmakeasub--‐folderinwithinappscalled“ae--01--trivial”–thepathtothisfolder would
be:
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 ae--01--trivial folder called index.py with three lines in it:
print 'Content-Type:text/plain'
print ' '
print 'Hello there Chuck'
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 updates.
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:
Inthisinstance–themistakeismis--‐indentingthelastlineintheapp.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
ImadeaPythonsyntaxerroronlineoneofourone--‐lineapplication.
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.
To shut down the server, use the Launcher, select your application and press the
Stop button.
RESULT
Thus Google App Engine was installed sucessfully and to Create hello world app and other simple
web applications using python/java successfully and verified.
EX.NO 4 Use GAE launcher to launch the web applications.
AIM
To use GAE launcher to launch the web applications.
PROCEDURE
1. After login plug-in the USB drive
2. Right Click on the USB icon at bottom right corner(4 th Icon)
3. Select your device name like jetflash,sandisk etc
4. Explorer window open.
5. Then do read, write operations on the USB.
ubuntu_gt6 installation:
1. Open Virtual box
2. File import Appliance
3. Browse ubuntu_gt6.ova file
4. Then go to setting, select Usb and choose USB 1.1
5. Then Start the ubuntu_gt6
6. Login using username: dinesh, password:99425.
1. FUSE (Filesystem in Userspace) enables you to write a normal user application as a bridge for a traditional
filesystem interface.
2. The hadoop-hdfs-fuse package enables you to use your HDFS cluster as if it were a traditional filesystem
on Linux. It is assumed that you have a working HDFS cluster and know the hostname and port that
your NameNode exposes.
To install fuse-dfs on Ubuntu systems:
sudo apt-get install hadoop-hdfs-fuse
To set up and test your mount point:
mkdir -p <mount_point>
hadoop-fuse-dfs dfs://<name_node_hostname>:<namenode_port> <mount_point>
You can now run operations as if they are on your mount point. Press Ctrl+C to end the fuse-
dfs program, and umount the partition if it is still mounted.
-fuse-dfs may exit
immediately because ld.so can't find libjvm.so. To work around this issue, add
/usr/java/latest/jre/lib/amd64/server to the LD_LIBRARY_PATH.
To clean up your test:
$ umount <mount_point>
You can now add a permanent HDFS mount which persists through reboots. To add a system mount:
1. Open /etc/fstab and add lines to the bottom similar to these:
hadoop-fuse-dfs#dfs://<name_node_hostname>:<namenode_port> <mount_point> fuse
allow_other,usetrash,rw 2 0
For example:
hadoop-fuse-dfs#dfs://localhost:8020 /mnt/hdfs fuse allow_other,usetrash,rw 2 0
2. Test to make sure everything is working properly:
$ mount <mount_point>
Your system is now configured to allow you to use the ls command and use that mount point
as if it were a normal system disk.
RESULT
Thus the GAE launcher to launch the web applications successfully and verified.
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
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 the Java
classpath and it is ready to be used. Please verify whether Java is available on your system.
To use CloudSim in Eclipse:
1. Download CloudSim installablefiles
from https://code.google.com/p/cloudsim/downloads/list and unzip
2. OpenEclipse
3. Create a new Java Project: File ->New
4. Import an unpacked CloudSim project into the new JavaProject
5. The first step is to initialise the CloudSim package by initialising the CloudSim library,as
follows:
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared())
9. Submit the VM list to thebroker:
broker.submitVmList(vmlist)
10. Create a cloudlet with length, file size, output size, and utilisationmodel:
Cloudlet cloudlet = new Cloudlet(id, length, pesNumber, fileSize, outputSize, utilizationModel, utilizationMode
11. Submit the cloudlet list to thebroker:
broker.submitCloudletList(cloudletList)
12. Start thesimulation:
CloudSim.startSimulation()
Sample Output from the Existing Example:
Starting CloudSimExample1...
Initialising...
Starting CloudSim version 3.0
Datacenter_0 is starting...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>null
Broker is starting...
Entities started.
0.0 : Broker: Cloud Resource List received with 1resource(s)
0.0: Broker: Trying to Create VM #0 inDatacenter_0
0.1 : Broker: VM #0 has been created in Datacenter #2, Host#0
0.1: Broker: Sending cloudlet 0 to VM #0
400.1: Broker: Cloudlet 0 received
400.1 : Broker: All Cloudlets executed.Finishing...
400.1: Broker: Destroying VM#0
Broker is shutting down...
Simulation: No more future events
CloudInformationService: Notify all CloudSim entities for shutting down.
Datacenter_0 is shutting down...
Broker is shutting down...
Simulationcompleted.
Simulation completed.
========== OUTPUT ==========
Cloudlet ID STATUS Data center ID VM ID Time Start Time Finish Time
0 SUCCESS 2 0 400 0.1 400.1
*****Datacenter:Datacenter_0*****
Userid Debt
3 35.6
CloudSimExample1 finished!
RESULT
Thus Simulation using cloud scenario using CloudSim and run a scheduling algorithm that is not present in
CloudSim is successfully completed.
EX NO 6 Find a procedure to transfer the files from one virtual machine to another virtualmachine.
AIM
To Find a procedure to transfer the files from one virtual machine to another virtualmachine.
PROCEDURE
1. 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)
2. 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 settYou can copy few (or more) lines with copy & pastemechanism.
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.
3. You can enable drag and drop too with the same method (Click on the machine, settings,
general, advanced, drag and drop: set to bidirectional)
4. You can have common Shared Folders on both virtual machines and use one of the
directory shared as buffer tocopy.
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 ted (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 withSamba.
You may find interesting the article Sharing files between guest and host
withoutVirtualBox shared folders with detailed step by step instructions.
You should remember that you are dialling 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 aphysical
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 hostingOS.
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.
Windows likes mouse and Linux fingers.:-)
I mean I suggest you to enable Drag & drop to be cosy with the Windows machines and
the Shared folders or to be cosy with Linux.
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!
Host: rvs
Host:one-sandbox
After Migration
Host:one-sandbox
Host: rvs
RESULT
Thus procedure to transfer the files from one virtual machine to another virtualmachine was successfully
completed.
EX.NO 7 Find a procedure to launch virtual machine using trystack
AIM
To Find a procedure to launch virtual machine using trystack (Online Openstack DemoVersion)
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. If you want to try out
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
FacebookGroup. 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 youlog
in to the TryStack, you will see the Compute Dashboard like:
OpenStack Compute Dashboard
In this post, I will show you how to run an OpenStack instance. The instance will be accessible
through the internet (have a public IP address). The final topology will like:
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.
Network? Yes, the 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.
Now, we will create an instance. The instance is a virtual machine in the cloud, like AWS EC2.
You need the instance to connect to the network that we just created in the previous step.
I guess you already know what router is. In the step 1, we created our network, but it is isolated.
It doesn’t connect to the internet. To make our network has an internet connection, we need a
router that running as the gateway to the internet.
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 public IP. In
OpenStack, the public IPs is collected in a pool and managed by admin (in our case is TryStack).
You need to request a public (floating) IP address to be assigned to your instance.
1. Go to Compute >Instance.
2. In one of your instances, click More > Associate FloatingIP.
3. In IP Address, click Plus[+].
4. Select Pool to external and then click AllocateIP.
5. ClickAssociate.
6. Now you will get a public IP, e.g. 8.21.28.120, for yourinstance.
OpenStack has a feature like a firewall. It can whitelist/blacklist your in/out connection. It is
called Security Group.
1. Go to Compute > Access & Security and then open Security Groupstab.
2. In default row, click ManageRules.
3. Click Add Rule, choose ALL ICMP rule to enable ping into your instance, and then clickAdd.
4. Click Add Rule, choose HTTP rule to open HTTP port (port 80), and then clickAdd.
5. Click Add Rule, choose SSH rule to open SSH port (port 22), and then clickAdd.
6. You can open other ports by creating newrules.
Step 6: SSH 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
RESULT
Thus procedure to launch virtual machine using trystack (Online Openstack DemoVersion) was successfully
completed
EX.NO 8 Install Hadoop single node cluster and run simple applications like wordcount.
AIM
Find Procedure to install Hadoop single node cluster and run simple applications like wordcount
PROCEDURE TO INSTALL
Step 1: Click hereto 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
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 andhadoop 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:
Step 7: Open core-site.xml and edit the property mentioned below inside configuration tag:
core-site.xml informs Hadoop daemon where NameNode runs in the cluster. It contains
configuration settings of Hadoop core such as I/O settings that are common to HDFS &
MapReduce.
Command: vi core-site.xml
Command: vi hdfs-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
Step9: Editthe mapred-site.xml file andeditthepropertymentionedbelow
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.
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:
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
Fig: Hadoop Installation – Configuring hadoop-env.sh Step 12:
Command: cd hadoop-2.7.3
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 filesystem. You will lose all your data stored in
theHDFS.
Step 13: Once the NameNode is formatted, go to hadoop-2.7.3/sbin directory and start all the
daemons.
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
Start NameNode:
The NameNode 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.
StartDataNode:
On startup, a DataNode connects to the Namenode and it responds to the requests from the
Namenode for differentoperations.
Start ResourceManager:
ResourceManager 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 NodeManagers and the each application’s ApplicationMaster.
Start NodeManager:
The NodeManager in each machine framework is the agent which is responsible for managing
containers, monitoring their resource usage and reporting the same to the ResourceManager.
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
Step 15: Now open the Mozilla browser and go to localhost:50070/dfshealth.html to check the
NameNode interface.
RESULT