UNIVERSITY COLLEGE OF ENGINEERING KANCHIPURAM
(Anna University Administered Affiliated Institution, Approved by AICTE)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CCS335 - CLOUD COMPUTING
NAME : .
REGISTER NO : .
YEAR/SEMESTER : .
BRANCH : .
UNIVERSITY COLLEGE OF ENGINEERING KANCHIPURAM
KANCHIPURAM - 631 502
BONAFIDE CERTIFICATE
REGESTER NO:
Certified that this is the bonafide record of work done by
Mr/Ms ……………………………………………………….. Of VI Semester B.E.
COMPUTER SCIENCE AND ENGINEERING Branch during the academic
year 2023 - 2024 in CCS335 - CLOUD COMPUTING.
Staff In-Charge Head of the Department
Submitted for the University Practical examination held on …………………
Internal Examiner External Examiner
INDEX
[Link] DATE TITLE OF THE PROGRAM PAGE SIGN
NO
1 Install Virtualbox/VMware Workstation
with different flavors of Linux or Windows
OS on top of Windows.
2 Install a C compiler in the virtual machine
created using a virtual box and execute
Simple Programs.
3 Install Google App Engine. Create Hello
World app and other simple web
applications using Python/java.
4 Use the GAE launcher to launch the web
applications.
5 Simulate a cloud scenario using CloudSim
and run a scheduling algorithm that is not
present in CloudSim
6 Find a procedure to transfer the files from
one virtual machine to another virtual
machine.
7 Install Hadoop single node cluster and run
simple applications like wordcount.
EX NO: 1 Install Virtualbox/VMware Workstation with different
flavors of Linux or Windows OS on top of Windows.
DATE :
Aim:
To Install Virtualbox / VMware Workstation with different flavors of Linux or Windows OS on top
of Windows or 8.
PROCEDURE:
Steps to install Virtual Box:
1. Download the Virtual Box exe and then click the exe file and select the next button.
2. Click the next button.
3. Click the next button.
4. Click the YES button.
5. Click the install button.
6. Then installation was completed..the show virtual box icon on the desktop screen.
Steps to import Open Nebula sandbox:
1. Open the Virtual box
2. File 🡪import Appliance
3. Browse [Link] file
4. Then go to settings, select USB, and choose USB 1.1
5. Then Start the Open Nebula
6. Login using username: root, password:opennebula .
Steps to create a Virtual Machine through open nebula :
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 the Create button.
e. Repeat steps C, and D for creating more than one VM.
APPLICATIONS:
There are various applications of cloud computing in today’s network world. Many search engines
and social media are using the concept of cloud computing like [Link], [Link],
[Link],[Link], etc. The advantages of cloud computing in context to scalability are
reduced risk, low-cost testing, the ability to segment the customer base, and auto-scaling based on
application load.
RESULT:
Thus the procedure to run the virtual machine of different configurations
EX NO: 2 Install a C compiler in the virtual machine created
using a virtual box and execute Simple Programs.
DATE :
Aim:
To Install a C compiler in the virtual machine created using the virtual box and execute Simple
Programs` PROCEDURE:
Steps to import .ova file:
1. Open Virtual box
2. File 🡪import Appliance
3. Browse ubuntu_gt6.ova file
4. Then go to settings, select USB, and choose USB 1.1
5. Then Start the ubuntu_gt6
6. Login using username: dinesh, password:99425.
Steps to run the C Program:
1. Open the terminal
2. Type cd /opt/axis2/axis2-1.7.3/bin then press enter
3. gedit hello.c
4. gcc hello.c
5. ./[Link] 1. Type cd /opt/axis2/axis2-1.7.3/bin then press enter.
2. Type gedit first.c
3. Type the c program
4. Running the C program
5. Display the output:
APPLICATIONS:
Simply running all programs in a grid environment.
RESULT:
Thus the simple C programs executed successfully.
EX NO: 3 Install Google App Engine. Create Hello World app
and other simple web applications using Python/java
DATE :
Aim:
To Install Google App Engine. Create Hello World app and other simple web applications using
Python/java.
Procedure:
1. Install Google Plugin for Eclipse
Read this guide – how to install Google Plugin for Eclipse. If you install the Google App Engine
Java SDK together with ―the Google Plugin for Eclipse―, then go to step 2, Otherwise get the
Google App Engine Java SDK and extract it.
2. Create New Web Application Project In the Eclipse toolbar,
click on the Google icon, and select ―New Web Application Project.
Click finished, and Google Plugin for Eclipse will generate a sample project automatically.
3. Hello World Review the generated project directory.
Nothing special, a standard Java web project structure.
HelloWorld/ src/
...Java source code...
META-INF/
...other configuration...
war/
...JSPs, images, data files...
WEB-INF/
...app configuration...
lib/
...JARs for libraries...
classes/
...compiled classes…
The extra is this file ―[Link]―, Google App Engine need this to run and deploy the
application.
File : [Link]
4. Run it local
Right click on the project and run as ―Web Application―.
Eclipse console :
and also the hello world servlet – [Link]
5. Deploy to Google App Engine
Register an account on [Link] and create an application ID for your web
application.
In this demonstration, I created an application ID, named ―mkyong123‖, and put it in appengine
[Link]. File : [Link]
To deploy, see following steps:
Click on GAE deploy button on the toolbar
Figure 1.3 – If everything is fine, the hello world web application will be deployed to this URL –
[Link]
Result:
Thus the simple application was created successfully.
EX NO: 4 Simulate a cloud scenario using CloudSim and run a
scheduling algorithm that is not present in CloudSim.
DATE :
Aim:
To Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not present in
CloudSim.
Steps:
How to use CloudSim in 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 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 installable files from
[Link] and unzip.
2. Open Eclipse
3. Create a new Java Project: File -> New .
4. Import an unpacked CloudSim project into the new Java Project The first step is to initialize
the CloudSim package by initializing the CloudSim library, as follows
[Link](num_user, calendar, trace_flag) .
5. Data centers are the resource providers in CloudSim; hence, the creation of data centers is a
second step. To create Datacenter, you need the DatacenterCharacteristics object that stores
the properties of a data center such as architecture, OS, list of machines, allocation policy
that covers the time or space shared, the time zone and its price: Datacenter datacenter9883
= new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList).
6. The third step is to create a broker: DatacenterBroker broker = createBroker();
7. The fourth step is to create one virtual machine unique ID 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 cloudletScheduler policy for cloudlets: Vm
vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared()).
8. Submit the VM list to the broker: [Link](vmlist).
9. Create a cloudlet with length, file size, output size, and utilization model: Cloudlet cloudlet
= new Cloudlet(id, length, pesNumber, fileSize, outputSize, utilizationModel,
utilizationMode 10. Submit the cloudlet list to the broker:
[Link](cloudletList).
Sample Output from the Existing Example:
Starting CloudSimExample1...
Initialising...
Starting CloudSim version 3.0
Datacenter_0 is starting…
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>null
Broker is starting...
Entities started. : Broker: Cloud Resource List received with 1 resource(s) 0.0:
Broker: Trying to Create VM #0 in Datacenter_0 :
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 :
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
Simulation completed.
Simulation completed.
========== OUTPUT ==========
Cloudlet ID STATUS Data center ID VM ID Time Start Time Finish Time
0 SUCCESS 2 0.1 400.1 0 0.1 400
*****Datacenter: Datacenter_0*****
User id Debt 3 35.6
CloudSimExample1 finished!
RESULT:
The simulation was successfully executed.
EX NO: 5 Use the GAE launcher to launch the web applications.
DATE :
Aim:
To Use GAE launcher to launch the web applications.
Steps:
Making Your FirstApplication
Now you need to create a simple application. We could use ―+‖ 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.
Makeafolder 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:\Documents and 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:\ Documents and Settings \csev\Desktop\apps\ae-•01-•trivial
Using a text editor such as JEdit ([Link]), create a file called [Link] in the ae-•01-•trivial
folder with the following contents:
application: ae-01-trivial version: 1
runtime: python api_version: 1
handlers:- url: /.*
script: [Link]
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 [Link] with three lines in it:
print 'Content-Type: text/plain'
print ' '
print 'Hello there Chuck'
Then start the GoogleAppEngineLauncher program that can be found under Applications.
Use the File -•> Add Existing Application command 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 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 [Link]
Paste [Link] into your browser and you should see your application as follows:
Just for fun, edit the [Link] to change the name―Chuck‖ to your name and press Refresh in the
browser to verify your updates. Watching the Log You watch the internal action that the webserver
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.
Dealing With Errors
With two files to edit, there are two general categories of errors that you may encounter. If you
make a mistake on the [Link] 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 [Link] (line 8).
If you make a syntax error in the [Link] 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: [Link]
When you make a mistake in the [Link] file – you must fix the mistake and attempt to start the
application again. If you make a mistake in a file like [Link], 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 shut down the server, use the Launcher, select your application and
press the Stop button.
Result:
Thus the GAE web applications were created.
EX NO: 6 Find a procedure to transfer the files from one virtual
machine to another virtual machine.
DATE :
Aim:
To Find a procedure to transfer the files from one virtual machine to another virtual machine.
Steps:
1. You can copy a few (or more) lines with the copy-and-paste mechanism. For this you need
to share the clipboard between the host OS and guest OS, installing Guest Addition on both
the virtual machines (probably setting bidirectional and restarting them). You copy from the
guest OS into 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
directories shared as a buffer to copy. Installing Guest Additions you can set Shared Folders
too. As you put a file in a shared folder from the host OS or guest OS, is immediately
visible to the other. (Keep in mind that can arise some problems for the 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 the usual method to copy files between 2 different computers with a
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 set (via
password or, better, via an automatic authentication method). Note: many Linux/Ubuntu
distributions install sshd by default: you can see if it is running with pgrep sshd from a
shell. You can install it 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 files and directories with Samba. You may find the article Sharing files
between guest and host without VirtualBox shared folders with detailed step-by-step
instructions.
You should remember that you are dealing with a small network of machines with different
operative systems, and in particular:
● Each virtual machine has its operative system running on and acts as a physical machine.
● Each virtual machine is an instance of a program owned by a user in the hosting operative
system and should undergo the restrictions of the user in the hosting OS. E.g Let us 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 machines 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 overcome it: it's enough to give authorization to read/write/execute to a directory or to
choose a different directory in which both users can read/write/execute.
● Windows likes mouse and Linux fingers. :-)
I mean I suggest you enable Drag & drop to be cozy with the Windows machines and the Shared
folders or to be cozy with Linux. When you need to be fast with Linux you will feel the need for
ssh-keygen and to Generate SSH Keys to copy files on/from a remote machine without writing
passwords anymore. In this way, it functions bash auto-completion remotely too!
PROCEDURE:
Steps:
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Then follow the steps to migrate VMs
A. Click on infrastructure
B. Select clusters and enter the cluster name
C. Then select host tab, and select all hosts
D. Then select Vnets tab, and select all vent
E. Then select datastores tab, and select all datastores
F. And then choose host under infrastructure tab
G. Click on + symbol to add new host, name the host then click on create.
4. on instances, select VMs to migrate then follow the steps
a. Click on 8 th icon, and the drop-down list displays
b. Select migrate on that, and the popup window displays
c. On that select the target host to migrate then click on migrate.
Before migration
Host: SACET
Host:one-sandbox
After Migration:
Host:one-sandbox
Host:SACET
APPLICATIONS:
Easily migrate your virtual machine from one PC to another.
Result:
Thus the file transfer between VMs was successfully completed…..
EX NO: 7 Install Hadoop single node cluster and run simple
applications like wordcount.
DATE :
Aim:
To Install a Hadoop single node cluster and run simple applications like wordcount.
Steps: Install Hadoop
Step 1: Click here to download the Java 8 Package. Save this file in your home directory.
Step 2: Extract the Java Tar File. Command: tar -xvf [Link]
Step 3: Download the Hadoop 2.7.3 Package.
Command: wget [Link] [Link]
Step 4: Extract the Hadoop tar File.
Command: tar -xvf [Link]
Step 5:
Add the Hadoop and Java paths in the bash file (.bashrc). Open. bashrc file.
Now, add Hadoop and Java Path as shown below.
Command: vi .bashrc
Fig: Hadoop Installation – Setting Environment Variable
Then, save the bash file and close it. To apply all these changes to the current Terminal,
execute the source command.
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: java -version
Command: hadoop version
Step 6: Edit the Hadoop Configuration files.
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 .
Step 7:
Open [Link] and edit the property mentioned below inside the configuration tag:
[Link] 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 [Link]
Fig: Hadoop Installation – Configuring [Link]
Step 8:
Edit [Link] and edit the property mentioned below inside configuration tag:
[Link] 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 [Link]
Fig: Hadoop Installation – Configuring [Link]
Step 9:
Edit the [Link] file and edit the property mentioned below inside configuration
tag: [Link] contains configuration settings of MapReduce application like number of
JVM that can run in parallel, the size of the mapper and the reducer process, CPU cores available
for a process, etc. In some cases, [Link] file is not available. So, we have to create the
mapred- [Link] file using [Link] template.
Command: cp [Link] [Link]
Command: vi [Link].
Step 10:
Edit [Link] and edit the property mentioned below inside the configuration tag:
[Link] contains configuration settings of ResourceManager and NodeManager like
application memory management size, the operation needed on program & algorithm, etc.
Command: vi [Link]
Step 11: Edit [Link] and add the Java Path as mentioned below:
Command: vi hadoop–[Link]
Step 12: Go to Hadoop home directory and format the NameNode.
Command: cd
Command: cd hadoop-2.7.3
Command: bin/hadoop namenode -format
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 [Link] variable.
Never format, up and running Hadoop filesystem. You will lose all your data stored in the HDFS.
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: ./[Link]
The above command is a combination of [Link], [Link] &
[Link] Or you can run all the services individually as below:
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 files stored across the cluster.
Command: ./[Link] start namenode
Start DataNode:
On startup, a DataNode connects to the Namenode and it responds to the requests from the
Namenode for different operations.
Command: ./[Link] start datanode
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 each application’s ApplicationMaster.
Command: ./[Link] start resourcemanager
Start NodeManager:
The NodeManager in each machine framework is the agent that is responsible for
managing containers, monitoring their resource usage and reporting the same to the
ResourceManager.
Command: ./[Link] start nodemanager
Start JobHistoryServer:
JobHistoryServer is responsible for servicing all job history-related requests from clients.
Command: ./[Link] start historyserver
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/[Link] to check the
NameNode interface
Fig: Hadoop Installation – Starting WebUI
Congratulations, you have successfully installed a single-node Hadoop cluster
Result:
Thus the Hadoop One cluster was installed and simple applications executed successfully