cc-LAB Updated
cc-LAB Updated
cc-LAB Updated
REGULATION 2021
NAME :
REGISTER NO :
SEMESTER : V
Bonafide Certificate
This is to certify that Record work for CCS335 CLOUD COMPUTING is done by
Mr./Ms Reg.No in V Semester of
B.Tech Artificial Intelligence and Data science during the academic year 2023 - 2024.
Average
EX :NO :01 INSTALL VIRTUALBOX / VMWARE / EQUIVALENT
OPEN SOURCE CLOUD WORKSTATION WITH
DATE :
DIFFERENT FLAVOURS OF LINUX OR WINDOWS OS
ON TOP OF WINDOWS 8 AND ABOVE
AIM:
To Install Virtual box / VMware Workstation with different flavors of linux or
windows OS on top of windows7 or 8.
PROCEDURE:
You can also install Virtual Box from Ubuntu software Center.
In Windows and other Operating Systems
For installing virtual box inside you have to download the software from virtualbox.org.
Installing Windows 8
Following are the steps to install windows 8 in virtual box
Create Virtual Machine
Pop box saying create virtual machine will appear. Select type as Microsoft Windows and version
as windows 8. You can name the Virtual Machine as per your wish.
Select RAM size for Windows 8. Recommended size of RAM for windows 8 is 2 GB.
You can create new virtual drive, use an existing virtual hard drive or do not add virtual drive. Select your
choice and click next. 25 GB is the recommended size of hard drive.
For sharing this virtual machine with other virtualization software, choose the type of file you want to
create. Here I will be choosing .vdi.
Allocate size for hard drive dynamically. However you can also go for fixed sized.
Select file location on Host operating system to install windows 8. If your host operating system is
windows, then preferably choose the hard drive other than c: drive.
Now click create button and your virtual machine for windows 8 will be created.
Mapping ISO or VDI file
Load the .iso file or .vdi file from the folder where you have stored it in host operating system. Click on
start.
Installation Process
Select installation language, time and currency format and keyboard or input method. for this vdi file, I
have chosen English as installation language and US(International) as keyboard or input method.
Select Install Now.
As we will be installing inside virtual box, so select Custom : Install windows only (Advanced)
Select drive for installation of windows and click next.
Installation procedure will start after this, which will continue for around 15 minutes.
Personalize Your Computer
Write the name that you want to give to your computer and choose color of your choice.
Choose appropriate privacy settings.
To turn off the Virtual machine, click Machine -> Close… -> Power off the virtual machine from
Virtual Box top menu bar.
RESULT:
AIM:
To Install a C compiler in the virtual machine created using virtual box and
execute Simple Programs`
PROCEDURE:
Steps to Install C Language
In this installation tutorial, we will help you to write and compile your own programs in the C
programming language using terminal for Linux Operating System.
Open terminal so that we can proceed with the further steps to install the GCC Compiler.
The main command for installing the GCC compiler using terminal on Ubuntu is:
In order to locate your files on the Desktop folder and to change the reference of the current directory to
Desktop, use this command:
cd Desktop
Inserting cd Desktop command
Key takeaway: Commands are case sensitive
The command for creating a program in C is:
touch program.c
Now, a file has been created in our Desktop folder called program.c
ad
The file is created on the desktop
Open this file and write a basic code – “Hello World!”
Here, the ‘gcc’ command is followed by the file name with .c extension and ‘-o’ and the name of the
executable file, which is, ‘program’ in this case.
Key takeaway: The executable file name can be different from the source file name
In order to run the program, use the command
./program
ad
Run the code using ./program command
Here, the period symbol ‘.’ followed by a backslash is followed by the name of the executable file, that
is, ‘program’ in this case
RESULT:
Thus the simple program to install a c compiler in the virtual machine created using virtual box
AIM:
To Install Google App Engine and create hello world app and other simple web applications using
python/java.
PROCEDURE:
Step 1:First download python using the link https://www.python.org/downloads then you can install
latest version according to the operating system used. After installing type a python program
and check whether it is working fine or not.
Step 2: Download google cloud sdk using the link “cloud.google.com” then click quickstart after that
scroll down then select download the cloud SDK installer then again select after that it will be
downloaded.Then double click the file and click run.Then click I agree after that click single user ,
then click next and install. Finally click next and finish the process.
Step 3: Then a command prompt like cloud init box will be opened.After checking the networks connection
the command prompt will ask whether to continue yes or no.After that it will ask for account sign-in and we
can sign-in.It will allow us to google cloud sdk. Click allow and we will get a web page displayed “ You are
now authenticated with the Google cloud SDK”.Now we have successfully installed google cloud SDK.
Step 4: In google cloud prompt will intimate us with the given mail id and if we require we can create the
project or not.This is the installation procedure for Google app engine.
Step 5:We have to create two files one is python file and another one is yaml file.It is commonly used as
configuration file and the application used for data transmission. In the notepad type the python version and
mention pythonfilename.py in yaml file.
Step 6: In google prompt type the command google-cloud-sdk\bin\dev_appserver.py “path of the both files
which is kept in the folder” and type enter. Few commands will be executed and finally we will get an link
https://localhost:8080 and paste this in the chrome browser and whatever we have typed in python file will
be executed in the web application.
RESULT:
Thus the simple application to Install Google App Engine and create hello world app was created
successfully.
EX NO : 04
USE GAE LAUNCHER TO LAUNCH THE WEB
DATE :
APPLICATIONS.
AIM:
To Use GAE launcher to launch the web applications.
PROCEDURE
Step 1:First download python using the link https://www.python.org/downloads then you can install
latest version according to the operating system used. After installing type a python program
and check whether it is working fine or not.
Step 2: Download google cloud sdk using the link “cloud.google.com” then click quickstart after that
scroll down then select download the cloud SDK installer then again select after that it will be
downloaded.Then double click the file and click run.Then click I agree after that click single user ,
then click next and install. Finally click next and finish the process.
Step 3: Then a command prompt like cloud init box will be opened.After checking the networks connection
the command prompt will ask whether to continue yes or no.After that it will ask for account sign-in and we
can sign-in.It will allow us to google cloud sdk. Click allow and we will get a web page displayed “ You are
now authenticated with the Google cloud SDK”.Now we have successfully installed google cloud SDK.
Step 4: In google cloud prompt will intimate us with the given mail id and if we require we can create the
project or not.This is the installation procedure for Google app engine.
Step 5: Create five files for image,html,css,python and yaml files store all the files in one folder.
Step 6: Now in google cloud command prompt run the same command google-cloud-sdk\bin\
dev_appserver.py “path of the both files which is kept in the folder” and type enter. Few commands will be
executed and finally we will get an link https://localhost:8080 and paste this in the chrome browser and
whatever we have typed in python file will be executed in the web application.
Step 7:Now we will get an output that we have given in the input files with an image along with html file
with CSS style.
Result:
Thus the program using GAE launcher to launch web applications was created and the output was
verified successfully.
EX NO : 05
SIMULATE A CLOUD SCENARIO USING CLOUDSIM
DATE :
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:
Step 1: First we need java jdk file so we have download JDK download and the file will be downloaded.
Likewise for eclipse IDE for java developers download eclipse 202003 version.Then download cloudsim
3.0.3 when scrolling down we can see zip file that we need to download.
Step 2:In eclipse select File-> new->java project and now provide a name for the project as”cloud sim
simulation” now a project will be created in the left panel.
Step 3: Now you can src folder do right click and click new then package a dialog box will be opened. Now
provide the package name as com.sjfs and click finish.Now in the left panel com.sjfs will be created.Now click the
com.sjfs do right click select show-in from there go to system explorer.Now the path will be opened.Now we need
to paste all the codings here.
Step 4: Now we are going to write the java program for SJF algorithm and going to paste in system explorer.Next
you have util folder open it and you can see three files like constant.java,datacentercreator.java and
generatemarix.java copy all these files and paste in the same folder.
Step 5:Now when you click com.sjfs file you need to get all the six files.
Step 6:Now we need to rename all the java files with package name util by com.sjfs and save it.
Step 7: We have an option called build path then select configure build path a tab will be opened.We have to choose
class path from libraries and in the right side we have add external jars click and select the jar file for cloudsim and
click open.Then apply and close button .Now open sjfscheduler.java program and in that program in forth line we
have util coding we need to hide those line and save it.Right click on the coding run as java application then the
program will be executed. You can see the output below.
RESULT:
Thus the program to simulate a cloud scenario using CloudSim and run a scheduling
algorithm that is not present in CloudSim has been done and verified successfully.
EX NO : 06
FIND A PROCEDURE TO TRANSFER THE FILES
DATE :
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:
Now select the network option and create a new NAT network
After creating a NAT network, now go to virtual machine setting by right clicking on the
preferred machine.
Now go to Network and change the attached option to “NAT network” and select the
network we created earlier.
Now repeat the same process for another machine
Now install “Net-tools” on both machine which will help to identify i/p address of the
machine. Command: sudo apt install net-tools
Now create a file in Home folder using any text editor. Here we have used “Test_file.txt” and
will transfer from Kali Linux (Right Machine) to Ubuntu (left Machine).
Now we can check i/p address of Ubuntu where we want to transfer the file using “ ifconfig ”
command. Here Ubuntu has i/p address 10.0.2.4.
Transfer the file using command- scp
Test_file.txt [email protected]:
Where Test_file.txt is our file
raghav is the username of the Ubuntu
10.0.2.4 is ip address of Ubuntu (left
machine)
Optional: if scp is not installed then install by
using the command:
sudo apt install openssh-server
Now enter the password for Ubuntu(left
machine) admin, after enter the
password, the file will be sent from
Kali Linux(Right machine) to
Ubuntu(Left machine)
Transfer the file using command- scp
Test_file.txt [email protected]:
Where Test_file.txt is our file
raghav is the username of the Ubuntu
10.0.2.4 is ip address of Ubuntu (left
machine)
Optional: if scp is not installed then install by
using the command:
sudo apt install openssh-server
Now enter the password for Ubuntu(left
machine) admin, after enter the
password, the file will be sent from
Kali Linux(Right machine) to
Ubuntu(Left machine)
Now select the network option and create a new NAT network
After creating a NAT network, now go to virtual machine setting by right clicking on the
preferred machine.
Now go to Network and change the attached option to “NAT network” and select the
network we created earlier.
Now repeat the same process for another machine.
Now install “Net-tools” on both machine which will help to identify i/p address of the
machine. Command: sudo apt install net-tools
Now create a file in Home folder using any text editor. Here we have used “Test_file.txt” and
will transfer from Kali Linux (Right Machine) to Ubuntu (left Machine).
Now we can check i/p address of Ubuntu where we want to transfer the file using “ ifconfig ”
command. Here Ubuntu has i/p address 10.0.2.4.
Now create a file in Home folder using any text editor. Here we have used “Test_file.txt” and
will transfer from Kali Linux (Right Machine) to Ubuntu (left Machine).
Now we can check i/p address of Ubuntu where we want to transfer the file using “ ifconfig ”
command. Here Ubuntu has i/p address 10.0.2.4.
Result:
Thus the program for file transfer between VM in Ubuntu was successfully done and verified.
EX NO : 07
INSTALL HADOOP SINGLE NODE
DATE :
CLUSTER AND RUN SIMPLE APPLICATIONS LIKE
WORDCOUNT.
AIM:
To Install 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.
For applying 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 systemand can be accessed
through the Terminal, execute the java -version and hadoop version commands.
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
Command: vi core-site.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?
3 >
4 <configuration>
5 <property>
6 <name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
7 </property>
</configuration>
Step 8: 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
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: vi mapred-site.xml.
Command: vi yarn-site.xml
Fig: Hadoop Installation – Configuring yarn-site.xml
Step 11: Edit hadoop-env.sh and add the Java Path as mentioned below:
1
2 <?xml version="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</ name>
9 <value>org.apache.hadoop.mapred.ShuffleHandler</value>
1 </property>
0
1
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 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: ./start-all.sh
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.
Start DataNode:
On startup, a DataNode connects to the Namenode and it responds to the requests
from the Namenode for different operations.
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.
Step 14: To check that all the Hadoop services are up and running, run the
below command.
Command: jps
Result:
Thus the Hadoop one cluster was installed and simple applications executed successfully.
EX NO : 08
CREATING AND EXECUTING YOUR FIRST CONTAINER
DATE :
USING DOCKER
For Windows and macOS, we install the Docker Desktop utility, which includes: Docker Engine, Docker
CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper.
For Linux it varies by distribution, the exact information can be found on the Docker Engine, in the
“Installation per distro” tab.
Select the system you are using and follow the instructions to run the Docker application on your
computer for the first time.
2. Containerizing an App
Okay, now you have access to the Docker environment. It could be Docker Desktop on Windows or
MacOS. It could be Play with Docker in the cloud.
2.1. Creating a Dockerfile
Okay, I assume you have your application code in a folder on your computer. So it’s time to create a
Dockerfile.
The first thing we need to do is to define what image we want to build from. Here we will use the latest
version of node available from the Docker Hub:
FROM node:latest
Next, we create a directory to hold the application code inside the image:
To bundle your app’s source code inside the Docker image, use the COPY instruction:
Next, we set a directory that will be the working directory for your application:
WORKDIR /usr/src/app
Our app binds to port 3000 so you’ll use the EXPOSE instruction to have it mapped by the docker
daemon:
#Set container listen port
EXPOSE 3000
FROM node:latest
WORKDIR /usr/src/app
#Install dependencies from packages.json
EXPOSE 3000
The -t flag allows you to tag an image to make it easier to find later.
Running your image with the -p flag redirects a public port to a private port inside the container. The -
d flag runs the container in detached mode, leaving the container running in the background. The flag –
name allows you to give a name to the container you are creating. As the last argument, we give the
name of the image from which we want to run the container.
To check if the application is actually running, you need to go to your browser and
enter http://localhost:3000.
Finally, I prepared a list of commands that may be useful in managing the docker:
Result:
Thus the steps for creating the container using docker has been done and the output has been
verified.
EX NO : 09
TO RUN A CONTAINER FROM DOCKER HUB
DATE :
Aim:
To run a container from docker hub.
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.
To create a repository:
1.Sign in 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.
You need to download Docker Desktop to build, push, and pull container images.
1.In your terminal, run docker pull hello-world to pull the image from Docker Hub. You should see output
similar to:
2.Run docker run hello-world to run the image locally. You should see output similar to:
(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.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
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:
# syntax=docker/dockerfile:1
FROM busybox
CMD echo "Hello world! This is my first Docker image."
5.Your repository in Docker Hub should now display a new latest tag under Tags:
Result:
Thus the commands to run a container from docker hub has been done and the output has been
verified.