0% found this document useful (0 votes)
14 views41 pages

Cloud Computing Practical Record 2025-2026

The document outlines the practical work record for the CCS335 Cloud Computing course for the academic year 2025-2026. It includes various experiments such as installing VirtualBox/VMware, setting up a C compiler, deploying applications on Google App Engine, and simulating cloud scenarios using CloudSim. Each experiment details the aim, procedure, and results of the tasks performed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views41 pages

Cloud Computing Practical Record 2025-2026

The document outlines the practical work record for the CCS335 Cloud Computing course for the academic year 2025-2026. It includes various experiments such as installing VirtualBox/VMware, setting up a C compiler, deploying applications on Google App Engine, and simulating cloud scenarios using CloudSim. Each experiment details the aim, procedure, and results of the tasks performed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CCS335 CLOUD COMPUTING

ACADEMIC YEAR

2025-2026

ODD SEMESTER

NAME OF THE STUDENT :

REGISTER NUMBER :

COURSE :

YEAR :

SEMESTER :
BONAFIDE CERTIFICATE

Register Number :

Name of the lab : CCS335 – Cloud Computing

Department : Computer Science and Engineering

Certified that this is a Bonafide Record of Practical Work done by Mr./Ms

.................................................................... …of Computer Science and Engineering Department

FIFTH Semester in the CCS335– CLOUD COMPUTING during the year 2025-2026.

Signature of Lab-in-Charge Signature of Head of the Department

Submitted for End Semester Practical Examination held on .....................

INTERNAL EXAMINER EXTERNAL EXAMINER


INDEX

Exp Date of Page


No Experiment Experiment Title No. Marks Signature
Install VirtualBox/VMware Workstation with different flavours
Ex. No:1 of Linux or windows OS on top of windows7 or 8.

Aim:

To Install VirtualBox/VMware Workstation with different flavours of Linux

Procedure:

How to Install VMware Workstation


While you have downloaded VMware on your system then the file will be on download
folder by default, and the file name should be like this VMware-workstation-full-15.0.2-
[Link]. so now let’s start the installation, read each step carefully and follow the same
step.

#1. After clicking on the setup so click on the Yes button.

#2. Setup Wizard: then the setup wizard will install the VMware Workstation Pro on your
system so click Next to go ahead and click Exit to cancel the installation.

Setup Wizard

#3. End-User License Agreement: in this step accept the terms in the license agreement and
click on the Next button.
Accept the terms

#4. Custom Setup: select the folder in which you would like to install the VMware
application. and besides that select enhanced keyboard driver.

Custom Setup

#5. User Experience Setting: select both options but you can uncheck it, so I leave it as
default and click on the Next button.
User Experience Setting

#6. Application Shortcuts preference: here select the place you want the shortcut icons to
be placed on your system to launch the application so I recommend you select both options
and click on the Next button.

Application Shortcuts preference


#7. Install VM Workstation: in this step, the installation is ready to go, so click on the
Install button to begin the installation.
Install WMware Workstation on Windows

#8. Installing VM Workstation On Windows: The below screenshot shows the installation
is in progress, so wait for this to complete.

Installing vmware on Windows

#9. Complete the Setup Wizard: In the end, you will see the installation complete dialog
box. so, click on Finish and you are done with installation progress. while you click on
Finish then it will ask you to restart your computer so you can do it by clicking on Yes or if
you want to do it later then click on No.
Complete Setup Wizard

Step 4. Launch VMware Workstation on Windows


Ok, now you have successfully installed VM Workstation on your system, so while you want
to launch the application then it will ask you to provide the license key if you don’t have so
you have another option too. select the next option that you have 15 to 30-day trial and you
will like this page.

Result:
Thus, the Installation of VirtualBox/VMware Workstation with different flavours of
Linux or windows OS on top of windows7 successfully.
Install a C compiler in the virtual machine and execute a sample
Ex. No:2
program.

Aim:

To find procedure to attach virtual block to the virtual machine and check whether it
holds the data even after the release of the virtual machine.

Procedure:

• Install a C compiler in the virtual machine and execute a sample program.

Through Openstack portal create virtual machine. Through the portal connect to virtual
machines. Login to VMs and install c compiler using commands.

Eg: apt-get install gcc

• Show the virtual machine migration based on the certain condition from one node to the
other.

To demonstrate virtual machine migration, two machines must be configured in one


cloud. Take snapshot of running virtual machine and copy the snapshot file to the other
destination machine and restore the snapshot. On restoring the snapshot, VM running in
source will be migrated to destination machine.

• List the VMs you want to migrate, run:

$ nova list

• After selecting a VM from the list, run this command where VM_ID is set to the ID in
the list returned in the previous step:

$ nova show VM_ID

• Use the nova migrate command.

$ nova migrate VM_ID

• To migrate an instance and watch the status, use this example script:

#!/bin/bash
# Provide usage
usage() {
echo "Usage: $0 VM_ID"
exit 1
}
[[ $# -eq 0 ]] && usage
# Migrate the VM to an alternate hypervisor
echo -n "Migrating instance to alternate host"
VM_ID=$1
nova migrate $VM_ID
VM_OUTPUT=`nova show $VM_ID`
VM_STATUS=`echo "$VM_OUTPUT" | grep status | awk '{print $4}'`
while [[ "$VM_STATUS" != "VERIFY_RESIZE" ]]; do
echo -n "."
sleep 2
VM_OUTPUT=`nova show $VM_ID`
VM_STATUS=`echo "$VM_OUTPUT" | grep status | awk '{print $4}'`
done
nova resize-confirm $VM_ID
echo " instance migrated and resized."
echo;
# Show the details for the VM
echo "Updated instance details:"
nova show $VM_ID
# Pause to allow users to examine VM details
read -p "Pausing, press <enter> to exit."

Result:

Thus, the Install a C compiler in the virtual machine and execute a sample program
created successfully.
Install Google App Engine. Create hello world app and other
Ex. No:3 simple web applications using python

Aim:

To Install Google App Engine. Create hello world app and other simple web
applications using python

Procedure:

Enable Cloud Run in your Google Cloud project


1. Create a new project to ensure that you have the permissions you need, or select an
existing project in which you have the relevant permissions.
2. Enable APIs

Create a simple web service with Python


1. open Cloud Shell

2. When Cloud Shell is ready, click Open Editor.

3. When the Cloud Shell Editor status bar is available, click Cloud Code, and then do the
following:

a. Select New Application.

b. Select Cloud Run application.

c. Select Python (Flask): Cloud Run .

4. In the Save dialog, select your home folder, and then click Create New Application.

Build and deploy the service to Cloud Run


1. Click Cloud Code, and then select Deploy to Cloud Run.

Loading the Deploy to Cloud Run tab might take some time to complete. If the Authorize
Cloud Shell dialog appears and you agree to the terms, click Authorize.

2. When the Deploy to Cloud Run tab has loaded, do the following:

a. In the Service field, select Create a service.

b. Click Deploy.

When the deployment of your service is completed, the following message appears:

Deployment completed successfully! URL: SERVICE_URL

c. To visit the service, click the URL of your service.

You have successfully created and deployed a web service on Cloud Run.
Result:
Create hello world app was successfully completed using google cloud.
Ex. No: 4 Use GAE launcher to launch the web applications.

Aim:
To use GAE launcher to launch the web applications

Procedure:

Create a Linux VM instance


1. In the Google Cloud console navigation menu, click Compute Engine > VM instances.

To see where it is, click the following button: Compute Engine chevron_right VM instances

2. Click Create instance. Show me

3. In the Name field, enter an instance name.

4. In the Boot disk section, click Change.

5. On the Public images tab, change the following settings:

o Operating system to Ubuntu

o Version to Ubuntu 20.04 LTS

6. Click Select.

7. In the Firewall section, select Allow HTTP traffic.

8. Click Create.

Your new instance appears on the VM instances page. When a checkmark appears, you can
connect to the instance.

Connect to the VM instance


1. On the VM instances page, look in the Name column to find the VM instance you created.

2. In the Connect column of the VM instance, click SSH.

A new command prompt opens and shows that you are connected to your VM terminal.

You have successfully created and connected to a VM instance in Compute Engine.


Result:

Thus, GAE launcher is used to launch the web applications.


Simulate a cloud scenario using CloudSim and run a scheduling
Ex. No:5 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 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 class path and it is ready to be used. Please verify whether Java is available on your system.

1. Download cloudsim 3.0.3.


2. Extract the cloudsim 3.0.3 folder using WinRAR or any other software.
3. Open up your net beans.
4. Go to “File” in the menu bar. Click new project.
5. Click Java and then “java application as given below in Fig 1.

Figure 1 : Select Java Application

6. Click Next and Name your project as “cloudsimproject1” as given below:


Figure 2: Give name to project

7. Click next and then you will see “cloudsimproject1” will be created. Now expand
cloudsimproject1 and you will see two folders. Soure packages and Libraries. Hit
libraries as given below:

Figure 3: Go to Libraries

[Link] you can see above initially you will have to add jar files into the libraries folder. Now
click add JAR/FOLDER and you will see the following screen :-

Figure 4: Adding JAR files


[Link] all those jar files and click Open. These all would get added to the libraries folder. As
you can see below:

Figure 5:Added JAR Files

[Link] go to the Cloudsim 3.0.3 extracted folder into your directory. Go to the path as given
below: cloudsim3.0.3 -> examples->org . Copy the “org” sub folder which is inside examples
as its parent folder. Once you copy it, now go to netbeans and click paste into the source
packages. It is shown as below:-

Figure 6:Add org folder to source packages

[Link] in the following Fig 7, you will see the cloud sim examples get installed.
Figure 7:Installation of cloud sim into Net beans

[Link] to open any example and run it as given below: -

Figure 8:Run any example

[Link] will get the results as given below:

Figure 9: Results of exmaple1

Finally cloud sim is integrated into the netbeans.

CloudSim application (Java program)


1. The first step is to initialise the CloudSim package by initialising the CloudSim library,
as follows:
[Link](num_user, calendar, trace_flag)
2. Data centres are the resource providers in CloudSim; hence, creation of data centres is a
second step. To create Datacenter, you need the DatacenterCharacteristics object that stores
the properties of a data centre such as architecture, OS, list of machines, allocation policy that
covers the time or spaceshared, the time zone and its price:

Datacenter datacenter9883 = new Datacenter(name, characteristics, new


VmAllocationPolicySimple(hostList), storageList, 0);
3. The third step is to create a broker:

DatacenterBroker broker = createBroker();


4. 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())
5. Submit the VM list to the broker:

[Link](vmlist)
6. Create a cloudlet with length, file size, output size, and utilisation model:

Cloudlet cloudlet = new Cloudlet(id, length, pesNumber, fileSize, outputSize,


utilizationModel, utilizationModel, utilizationModel)
7. Submit the cloudlet list to the broker:

[Link](cloudletList)
8. Start the simulation:

[Link]()
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 1 resource(s)
0.0: Broker: Trying to Create VM #0 in Datacenter_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...
Simulation completed.
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*****
User id Debt
3 35.6

CloudSimExample1 finished!

Result:

Thus, the scheduling algorithm executed successfully using CloudSim.


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 the files from one virtual machine to another virtual machine.

Prerequisites
• Verify that the virtual machines use a guest operating system that supports shared
folders.
• Verify that the latest version of VMware Tools is installed in the guest operating
system.
• Verify that permission settings on the host system allow access to files in the shared
folders. For example, if you are running Workstation Player as a user named User, the
virtual machine can read and write files in the shared folder only if User has
permission to read and write them.

Procedure

• Select the virtual machine and select Player > Manage > Virtual Machine Settings.

• On the Options tab, select Shared Folders.

• Select a folder sharing option.

Option Description
Always enabled Keep folder sharing enabled, even when the virtual machine is shut
down, suspended, or powered off.
Enabled until Enable folder sharing temporarily, until you power off, suspend, or
next power off shut down the virtual machine. If you restart the virtual machine,
or suspend shared folders remain enabled. This setting is available only when
the virtual machine is powered on.

• (Optional) To map a drive to the Shared Folders directory, select Map as a network
drive in Windows guests.

This directory contains all of the shared folders that you enable. Workstation
Player selects the drive letter.

• Click Add to add a shared folder.

On Windows hosts, the Add Shared Folder wizard starts.

• Type the path on the host system to the directory to share.

If you specify a directory on a network share, such as D:\share, Workstation


Player always attempts to use that path. If the directory is later connected to the host
on a different drive letter, Workstation Player cannot locate the shared folder.
• Specify the name of the shared folder as it should appear inside the virtual machine.

Characters that the guest operating system considers illegal in a share name appear
differently when viewed inside the guest. For example, if you use an asterisk in a
share name, you see %002A instead of * in the share name on the guest. Illegal
characters are converted to their ASCII hexadecimal value.

• Select shared folder attributes.

Option Description
Enable Enable the shared folder. Deselect this option to disable a shared folder
this share without deleting it from the virtual machine configuration.
Read-only Make the shared folder read-only. When this property is selected, the
virtual machine can view and copy files from the shared folder, but it
cannot add, change, or remove files. Access to files in the shared folder is
also governed by permission settings on the host computer.

• Click Finish to add the shared folder.

The shared folder appears in the Folders list. The check box next to folder name
indicates that the folder is being shared. You can deselect this check box to disable
sharing for the folder.

• Click OK to save your changes.

View the shared folder. On Linux guests, shared folders appear under /mnt/hgfs. On Solaris
guests, shared folders appear under /hgfs.
Creating a Virtual Machine in OpenStack via OpenStack CLI
Source the credential file and then execute the nova-boot command,

# nova boot --flavor [Link] --image centos7 --nic net-id={private_network_id} --security-


group norprod_sec_grp --key-name my_key stack_testvm

Once nova boot command is executed then following are steps are executed behind the scene,

Step:1) The Horizon Dashboard or OpenStack CLI gets user credentials and authenticates
with identity service via REST API
• The identity service (Keystone) authenticates the user with the user credentials and then
generates and send back an auth-token, that auth-token which will be used for sending
the request to other components through REST-Call

Step:2) The Dashboard or OpenStack CLI converts new instance request specified in launch
instance or nova boot command to a REST API request and sent it to nova-api

Step:3) Then nova-api service gets the request and send that request to the identity service
(Keystone) for validation of auth-token and access permission,
• Keystone service validates the token and send the updated authentication headers with
roles along with the permissions
Step:4) After getting the repsonse from keystone, then nova-api checks for conflicts with
nova-database and then it creates initial database entry for new instance or VM.

Step:5) nova-api sends the [Link] request to nova-scheduler expecting to get updated
instance entry with host id specified

Step:6) Now nova-scheduler picks the request from the queue

Step:7) nova-scheduler talks to nova-database to locate an appropriate host using filtering


and weighing mechanism,
• nova-scheduler returns the updated instance entry with the appropriate host ID after
filtering and weighing
• nova-scheduler sends the [Link] request to nova compute for launching an instance on
the appropriate host

Step:8) nova-compute picks the request from the queue and it sends the [Link] request to
nova-conductor to get the VM or instance info such as host id and flavor (RAM, CPU and
Disk)

Step:9) nova-conductor takes the request from queue and communicate with nova-database,
• nova-conductor gets the instance information
• now nova-compute picks the instance information from the queue

Step:10) nova-compute connects to glance-api by making a REST Call using auth-token and
then nova-compute uses the image id to get the image URI from image service and loads the
image from image storage

Step:11) glance-api validates the auth-token with keystone and after that nova-compute gets
the image metadata

Step:12) Nova-compute make the REST-call by passing the auth-token to Network API
(Neutron) to allocate and configure network so that vm gets the IP address

Step:13) Neutron-server validates the auth-token with keystone and after that nova-compute
retrieves the network information.

Step:14) Nova-Compute makes the REST-call by passing the auth-token to Volume API to
attach the volume to the instance or VM.

Step:15) cinder-api validates the auth-token with keystone and then nova-compute gets the
block storage information.

Step:16) nova-compute generates data for the hypervisor driver and executes the request on
the hypervisor using libvirt or API and then finally a VM is created on the hypervior. We can
see that VM in Dashboard and also using “nova list” command.
Result:

Thus, the procedure to transfer the files from one virtual machine to another virtual
machine completed successfully.
Ex. No:7 Install Hadoop single node cluster and run simple applications like
wordcount.

Aim:

Install Hadoop single node cluster and run simple applications like wordcount.

Prerequisites
• VIRTUAL BOX: it is used for installing the operating system on it.
• OPERATING SYSTEM: You can install Hadoop on Linux based operating systems.
Ubuntu and CentOS are very commonly used. In this tutorial, we are using CentOS.
• JAVA: You need to install the Java 8 package on your system.
• HADOOP: You require Hadoop 2.7.3 package.
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]

Fig: Hadoop Installation – Extracting Java Files


Step 3: Download the Hadoop 2.7.3 Package.
Command: wget [Link]
[Link]

Fig: Hadoop Installation – Downloading Hadoop


Step 4: Extract the Hadoop tar File.
Command: tar -xvf [Link]

Fig: Hadoop Installation – Extracting Hadoop Files


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.
For applying all these changes to the current Terminal, execute the source command.
Command: source .bashrc

Fig: Hadoop Installation – Refreshing environment variables


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

Fig: Hadoop Installation – Checking Java Version


Command: hadoop version

Fig: Hadoop Installation – Checking 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 as you
can see in the snapshot below:

Fig: Hadoop Installation – Hadoop Configuration Files


Step 7: Open [Link] and edit the property mentioned below inside 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]


1 <?xml version="1.0" encoding="UTF-8"?>

2 <?xml-stylesheet type="text/xsl" href="[Link]"?>

3 <configuration>

4 <property>

5 <name>[Link]</name>

6 <value>hdfs://localhost:9000</value>

7 </property>

8 </configuration>
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]

1 <?xml version="1.0" encoding="UTF-8"?>

2 <?xml-stylesheet type="text/xsl" href="[Link]"?>

3 <configuration>

4 <property>

5 <name>[Link]</name>

6 <value>1</value>

7 </property>

8 <property>

9 <name>[Link]</name>

10 <value>false</value>

11 </property>

12 </configuration>

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 [Link]
file using [Link] template.
Command: cp [Link] [Link]
Command: vi [Link].

Fig: Hadoop Installation – Configuring [Link]

1 <?xml version="1.0" encoding="UTF-8"?>

2 <?xml-stylesheet type="text/xsl" href="[Link]"?>

3 <configuration>

4 <property>

5 <name>[Link]</name>

6 <value>yarn</value>

7 </property>

8 </configuration>

Step 10: Edit [Link] and edit the property mentioned below inside 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]
Fig: Hadoop Installation – Configuring [Link]

1 <?xml version="1.0">

2 <configuration>

3 <property>

4 <name>[Link]-services</name>

5 <value>mapreduce_shuffle</value>

6 </property>

7 <property>

8 <name>[Link]</name>

9 <value>[Link]</value>

10 </property>

11 </configuration>

Step 11: Edit [Link] and add the Java Path as mentioned below:
[Link] contains the environment variables that are used in the script to run Hadoop like
Java home path, etc.
Command: vi hadoop–[Link]

Fig: Hadoop Installation – Configuring [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

Fig: Hadoop Installation – Formatting NameNode


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] & mr-jobhistory-
[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 file stored across the cluster.
Command: ./[Link] start namenode

Fig: Hadoop Installation – Starting 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
Fig: Hadoop Installation – Starting 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 the each application’s ApplicationMaster.
Command: ./[Link] start resourcemanager

Fig: Hadoop Installation – Starting ResourceManager


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.
Command: ./[Link] start nodemanager

Fig: Hadoop Installation – Starting NodeManager

Start JobHistoryServer:
JobHistoryServer is responsible for servicing all job history related requests from client.
Command: ./[Link] start historyserver
Step 14: To check that all the Hadoop services are up and running, run the below command.
Command: jps

Fig: Hadoop Installation – Checking Daemons


Step 15: Now open the Mozilla browser and go to localhost:50070/[Link] to check
the NameNode interface.

Fig: Hadoop Installation – Starting WebUI

Tools and Technologies used in this article

• Apache Hadoop 2.2.0


• Windows 7 OS
• JDK 1.6
1. Install Apache Hadoop 2.2.0 in Microsoft Windows OS

If Apache Hadoop 2.2.0 is not already installed then follow the post Build, Install,
Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS.
2. Start HDFS (Namenode and Datanode) and YARN (Resource Manager and Node
Manager)

Run following commands.


Command Prompt
C:\Users\abhijitg>cd c:\hadoop
c:\hadoop>sbin\start-dfs
c:\hadoop>sbin\start-yarn
starting yarn daemons

Namenode, Datanode, Resource Manager and Node Manager will be started in few
minutes and ready to execute Hadoop MapReduce job in the Single Node (pseudo-
distributed mode) cluster.
Namenode & Datanode :

Resource Manager & Node Manager :

3. Run wordcount MapReduce job

Now we'll run wordcount MapReduce job available


in %HADOOP_HOME%\share\hadoop\mapreduce\hadoop-mapreduce-examples-
[Link]
• Create a text file with some content. We'll pass this file as input to
the wordcount MapReduce job for counting words.
C:\[Link]
• Install Hadoop
• Run Hadoop Wordcount Mapreduce Example
• Create a directory (say 'input') in HDFS to keep all the text files (say '[Link]') to
be used for counting words.
• C:\Users\abhijitg>cd c:\hadoop
C:\hadoop>bin\hdfs dfs -mkdir input
Copy

• Copy the text file(say '[Link]') from local disk to the newly created 'input'
directory in HDFS.
C:\hadoop>bin\hdfs dfs -copyFromLocal c:/[Link] input
Copy

• Check content of the copied file.


• C:\hadoop>hdfs dfs -ls input
• Found 1 items
• -rw-r--r-- 1 ABHIJITG supergroup 55 2014-02-03 13:19 input/[Link]

• C:\hadoop>bin\hdfs dfs -cat input/[Link]
• Install Hadoop
Run Hadoop Wordcount Mapreduce Example
Copy

• Run the wordcount MapReduce job provided


in %HADOOP_HOME%\share\hadoop\mapreduce\hadoop-mapreduce-
[Link]
• C:\hadoop>bin\yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-
[Link] wordcount input output
• 14/02/03 [Link] INFO [Link]: Connecting to ResourceManager at
/[Link]:8032
• 14/02/03 [Link] INFO [Link]: Total input paths to process : 1
• 14/02/03 [Link] INFO [Link]: number of splits:1
• :
• :
• 14/02/03 [Link] INFO [Link]: Submitting tokens for job:
job_1391412385921_0002
• 14/02/03 [Link] INFO [Link]: Submitted application
application_1391412385921_0002 to ResourceManager at /[Link]:8032
• 14/02/03 [Link] INFO [Link]: The url to track the job:
[Link]
• 14/02/03 [Link] INFO [Link]: Running job: job_1391412385921_0002
• 14/02/03 [Link] INFO [Link]: Job job_1391412385921_0002 running
in uber mode : false
• 14/02/03 [Link] INFO [Link]: map 0% reduce 0%
• 14/02/03 [Link] INFO [Link]: map 100% reduce 0%
• 14/02/03 [Link] INFO [Link]: map 100% reduce 100%
• 14/02/03 [Link] INFO [Link]: Job job_1391412385921_0002
completed successfully
• 14/02/03 [Link] INFO [Link]: Counters: 43
• File System Counters
• FILE: Number of bytes read=89
• FILE: Number of bytes written=160142
• FILE: Number of read operations=0
• FILE: Number of large read operations=0
• FILE: Number of write operations=0
• HDFS: Number of bytes read=171
• HDFS: Number of bytes written=59
• HDFS: Number of read operations=6
• HDFS: Number of large read operations=0
• HDFS: Number of write operations=2
• Job Counters
• Launched map tasks=1
• Launched reduce tasks=1
• Data-local map tasks=1
• Total time spent by all maps in occupied slots (ms)=5657
• Total time spent by all reduces in occupied slots (ms)=6128
• Map-Reduce Framework
• Map input records=2
• Map output records=7
• Map output bytes=82
• Map output materialized bytes=89
• Input split bytes=116
• Combine input records=7
• Combine output records=6
• Reduce input groups=6
• Reduce shuffle bytes=89
• Reduce input records=6
• Reduce output records=6
• Spilled Records=12
• Shuffled Maps =1
• Failed Shuffles=0
• Merged Map outputs=1
• GC time elapsed (ms)=145
• CPU time spent (ms)=1418
• Physical memory (bytes) snapshot=368246784
• Virtual memory (bytes) snapshot=513716224
• Total committed heap usage (bytes)=307757056
• Shuffle Errors
• BAD_ID=0
• CONNECTION=0
• IO_ERROR=0
• WRONG_LENGTH=0
• WRONG_MAP=0
• WRONG_REDUCE=0
• File Input Format Counters
• Bytes Read=55
• File Output Format Counters
Bytes Written=59
Copy

• Check output.
• C:\hadoop>bin\hdfs dfs -cat output/*
• Example 1
• Hadoop 2
• Install 1
• Mapreduce 1
• Run 1
Wordcount 1
Copy

[Link] HYPERLINK "[Link] HYPERLINK


"[Link]

Result:
Thus, the Installation of Hadoop single node cluster and wordcount program executed
successfully.
Ex. No:8 Creating and Executing Your First Container Using Docker.

Aim:

To create and execute first container using docker


Procedure:
● Open windows powershell
● Run the command

wsl -install
● The above command will install ubuntu terminal on your [Link] installed Type
“ubuntu” on powershell .This opens the Ubuntu terminal.
● Install Docker on your computer.

● Create a Dockerfile. This is a text file that contains the instructions for creating a Docker
container.
nano dockerfile
● The following is an example of a Dockerfile that creates a container that runs the nginx web
server:

FROM nginx:latest
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]

● Build the Docker image from the Dockerfile. You can do this by running the following
command:

docker build -t my-nginx .

This will create a Docker image called my-nginx.


● Run the Docker container. You can do this by running the following command:

docker run -it my-nginx

This will start a Docker container running the nginx web server.
● To verify that the container is running, you can open a web browser and navigate to the IP
address of your Docker host.

Result:
Creating and Executing Your First Container Using Docker was successful.
Creating and Executing Container Using Docker was completed
Ex. No:9
successful

AIM: To run a container from docker hub


Procedure:

Step 1: Sign up for a Docker account

Start by creating a Docker IDopen in new.

A Docker ID grants you access to Docker Hub repositories and lets you explore available
images from the community and verified publishers. You also need a Docker ID to share
images on Docker Hub.

Step 2: Create your first repository


To create a repository:
1. Sign in to Docker Hub
2. Select Create a Repository on the Docker Hub welcome page.
3. Name it <your-username>/my-private-repo.
4. Set the visibility to Private.
5. Select Create.
You've created your first repository.

Step 3: Download and install Docker Desktop


You need to download Docker Desktop to build, push, and pull container images.
1. Download and install Docker Desktop.
2. Sign in to Docker Desktop using the Docker ID you created in step one.

Step 4: Pull and run a container image from Docker Hub


1. In your terminal, run docker pull hello-world to pull the image from Docker Hub. You
should see output similar to:
2. $ docker pull hello-world
3. Using default tag: latest
4. latest: Pulling from library/hello-world
5. 2db29710123e: Pull complete
6. Digest:
sha256:7d246653d0511db2a6b2e0436cfd0e52ac8c066000264b3ce63331ac66dca625
7. Status: Downloaded newer image for hello-world:latest
8. [Link]/library/hello-world:latest
9. Run docker run hello-world to run the image locally. You should see output similar
to:
10. $ docker run hello-world Hello from Docker!
11. This message shows that your installation appears to be working correctly.
12. To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs
the executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

13. To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
14. Share images, automate workflows, and more with a free Docker ID:
[Link]
15. For more examples and ideas, visit:
[Link]

Step 5: Build and push a container image to Docker Hub from your computer
1. Start by creating a Dockerfile to specify your application as shown below:
2. # syntax=docker/dockerfile:1
3. 1. FROM busybox
4. CMD echo "Hello world! This is my first Docker image."
5. Run docker build -t <your_username>/my-private-repo. To build your Docker image.
6. Run docker run <your_username>/my-private-repo to test your Docker image locally.
7. Run docker push <your_username>/my-private-repo to push your Docker image to
Docker Hub. You should see output similar to:

Result:
Running a Container from Docker Hub was completed successfully.

You might also like