Cloud Lab Fin
Cloud Lab Fin
AIM:
PROCEDURE:
fromhttps://www.virtualbox.org/wiki/Downloads
Step2: Install it in Windows, once the installation has done open it.
Step4: Specify RAM Size, HDD Size, and Network Configuration and Finish the wizard.
1
Step5: To select the media for installation Click on start and browse for iso file. In this
example we are selecting Ubuntu Linux iso.
Step 6: Complete the Installation and use it. Now complete the installation using standardizes
instructions to use it.
2
RESULT:
Thus Virtual box/VMware workstation with different flavors of Linux or windows OS
on top of windows7or 8 is successfully executed.
3
Ex No: 2 Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
AIM:
To install ‘C’ compiler inside that virtual machine and execute programs.
PROCEDURE:
The package GCC needs to be installing to use C compiler. The GNU Compiler
Collection (GCC) is a collection of compilers and libraries for C, C++, Objective-C,
FORTRAN, Ada, Go, and D programming languages. Many open-source projects, including
the GNU tools and the Linux kernel, are compiled with GCC. The steps for installing GCC
and running C programs are as follows.
4
Inside the gedit editor, write a simple calculator program as shown below.
# include<stdio.h>
int main()
{
printf ("Hello World\n");
return0;
}
RESULT:
5
Ex No: 3 Install Google App Engine. Create hello world app and other simple web
applications using python/java.
AIM:
Write a procedure Install Google App Engine, create hello world app, and other
simple web Applications using Python.
PROCEDURE:
The App Engine SDK allows you to run Google App Engine Applications on your local
computer. It simulates the run Gtime environment of the Google App Engine infrastructure.
Pre-Requisites: Python2.5.4
If you don't already have Python 2.5.4installed in your computer, download and Install
Python 2.5.4 from.
∙ You can download the Google App Engine SDK by going to download the appropriate install
package.
Python 2.5, it will install Python 2.5 as well. Once the install is complete you can discard the
downloaded installer.
6
Making your First Application
Now you need to create a simple application. We could use the “+” option to have the launcher make
us an application –but instead we will do it by hand to get a better sense of what is going on. Make a
folder for your Google App Engine applications. I am going to make the Folder on my Desktop
called “apps”–the path to this folder is:
C:\Documentsand Settings\cse\Desktop\apps
And then make a sub-folder in within apps called “ae-01-trivial” – the path to this folder
would be:
C:\DocumentsandSettingscsev\Desktop\apps\ae-01-trivial
Using a texted it or such as Jedit (www.jedit.org),createa file called app.yamlin the ae-01-
trivial Folder with the following contents:
Application: ae-01-
trivialversion:1
runtime: pythonapi_version:1
handlers:-
url:/.*script:index.py
Note: Please do not copy and paste these lines 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 'Hello world!'
7
Then start the GoogleAppEngineLauncher program that can be found under Applications. Use
the File->Add Existing Application command and navigate into the apps directory and select the
ae-01-trivial folder. Once you have added the application, select it so that you can control the
application using the launcher.
Once you have selected your application and press Run. After a few moments your application will
start and the launcher will show a little green icon next to your application. Then press Browse to
open a browser pointing at your application which is running at http://localhost:8080/
Paste http://localhost:8080into 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 our updates.
To get more detail on what is going wrong, take a look at the log for the application: In this
If you make a syntax error in the index.py file, a Python trace back error will appear in
your browser. The error you need to see is likely to be the last few lines of the output – in this
case I made a Python syntax error online one of our one G line application.
Reference: http://en.wikipedia.org/wiki/Stack_trace
When you make am I stake in the app.yamlfile–you must the fix them is take and attempt to
start the application again.
If you make is take 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.
8
Shutting Down the Server
To shut down the server, use the Launcher, select your application and press the
Stop button.
RESULT:
Thus the Install Google App Engine, create hello world app, and other simple web
applications using Python successfully executed.
9
Ex .No: 4 USE GAE LAUNCHER TO LAUNCH THE WEB APPLICATIONS.
AIM:
PROCEDURE:
To use Google's tools for your own site or app, you need to create a new project on Google Cloud
Platform. This requires shaving a Google account.
1. Go to the AppEngine dashboard on the Google Cloud Platform Console and press the Create
button.
2. If you’ve not created a project before, you'll need to select whether you want to receive email
updates or not, agree to the Terms of Service, and then you should be able to continue. 3. Enter a
name for the project, edit your projected and note it down. For this tutorial, the following values
are used:
a. Project Name :GAE Sample Site Project ID:gaesamplesite
4. Click the Create button not create your project.
Step2-Creating an application
Each Cloud Platform project can contain one AppEngine application. Let's prepare an app for
our project.
We'll need a sample application to publish. If you've not got one to use, download and unzip this
sample app.
1. Have a look at the sample application's structure - the website folder contains your website
content and app.yamlis your application configuration file.
2. Your website content must go inside the website folder, and its land ing page must be called
index.html, but apart from that it can take whatever form you like.
3. The app.yaml file is a configuration file that tells App Engine how to map URLs to your
static files. You don' t need to edit it.
1. Now that we've got our project made and sample app files collected together, let's publish our app.
2. Open Google Cloud Shell.
3. Drag and drop the sample-app folder into the left pane of the code editor. 4. Run the
following in the command line to select your project: Gcloudconfig set project gae sample site
5. Then run the following command to go to your app's directory: cdsample-app 6.
You are now ready to deploy your application, i.e.upload your app to App Engine:
Gcloudappdeploy
7. Enter a number to choose their gion where you want your application located.
8. Enter Y to confirm.
9. Now navigate your browser to your - project- id. appspot.com to see your website online.
10
For example, for the projected gae samplesite, goto gaesamplesite.appspot.com.
SOURCE:
<!DOCTYPEhtml>
<html>
<head>
<title>MYPROJECT</title>
<style>ul{
list-style-type: none;padding:0;
margin: 0; overflow:hidden;
background-color:#333;
}
li{
float:left;
}
lia{
display:block;color:white; padding: 14px16px;text-align: center;text-
decoration:none; }
lia:hover{
background-color:#111;
}
.active{
background-color:#4CAF50;
}
</style>
</head>
<bodystyle="background-color:powderblue;">
<palign=center>
<h1align=centerstyle="color:darkblue;">EverGreen</h1>
</p>
<ul>
<li>
<aclass:"active"href="#home">Home</a>
</li>
<li>
<ahref="#aboutus">Aboutus</a>
</li>
<li>
<ahref="#product">Product</a>
</li>
<li>
<ahref="#contact">Contact</a>
</li>
</ul>
<br>
11
<imgsrc="https://specials
images.forbesimg.com/imageserve/1141999659/960x0.jpg?fit=scale"width=1350pxheight=450px>
< /body></html>
RESULT:
Thus the use GAE (GoogleAppEngine) launcher to launch web application has been executed
successfully.
12
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:
Step2:Install 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 Net Beans 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
13
system.
From https://code.google.com/p/cloudsim/downloads/listandunzip
2. Open Eclipse
3. Create a new Java Project: File->New
5. The first step is to initialize the Cloud Sim package by initializing the CloudSim library
,as Follows:
CloudSim.init (num_user,calendar,trace_flag)
1. Data centers are the resource providers in CloudSim; hence, creation of data centers is a
second step. To create Data center, you need the Data center Characteristic s object that
stores the properties of a data centre such as architecture, OS, list of machines, allocation
policy that covers the time or space shared, the time zone and its price:
Data center data center 9883 = new Datacenter (name, characteristics, new VmAllocation
Policy Simple (hostList)
2. The third step is to create a broker : Data center Broker broker = create Broker();
3. The fourth step is to create one virtual machine unique ID of the VM, userId ID of
theVM’s owner, mips, number Of Pes amount of CPUs, amount of RAM, amount of
bandwidth, amount of storage, virtual machine monitor, and cloudlet Scheduler policy for
cloudlets : Vmvm = new
Vm (vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new Cloudlet Scheduler Time
Shared())
14
4. Submit the VMlist to the broker : broker . submit Vm List (vmlist)
5. Create a cloud let with length, file size, output size, and utilization model:
simulation: CloudSim.StartSimulation()
15
RESULT:
Thus Simulation of a cloud scenario using CloudSim and run a scheduling algorithm
that is not present in CloudSim was successfully executed.
16
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 files from one VM to another VM inVirtual Box.
PROCEDURE:
A shared folder is a folder which makes its files available on both the guest machine
and the host machine at the same time. Creating a shared folder between the guest and the host
allows you to easily manage files which should be present on both machines. The course virtual
machines are ready to use shared folders right away, but if you are using the virtual machine
on your personal computer you will need to specify which folder to use as shared storage.
17
∙Mount Point: Unless you already know about mount points, leave this blank.
∙Make Permanent: If you check this, the shared folder will be a permanent machine folder.
If it is not checked, the folder will not be shared after a shutdown.
∙ On the course virtual machines, when you load into the desktop, you should see a folder
labeled Shared Folders. In there you will see any folders that are currently mounted and being
shared.
Dragging and Dropping Files in VirtualBox:
If you only need to transfer a few files quickly, you can simply drag and drop the files
in. On the top bar of the running guest machine, click on Devices > Drag and Drop and make
sure that Bidirectional is selected. This means that you will be able to drag files from the host
to the guest and from the guest to the host. Once bidirectional drag and drop is checked, you
should be able to begin dragging and dropping files. You can also drag files from the guest
machine into the host. To do this, simply open the file browser on the host to where you would
like to drop the files and drag the files from the virtualmachine into the file browser of the host.
File transfers should be pretty quick; if the virtual machine seems stuck when transferring,
simply cancel the transfer and try again.
GUESTOS:
HOST OS:
RESULT:
AIM:
To install Hadoop single node cluster and simple application like word count.
PROCEDURE:
Prerequisite:
To install Hadoop, you should have Java version 1.8 in your system. Check your java version
through this command on command prompt Download the file according to your operating system.
Keep the java folder directly under the local disk directory (C:\Java\jdk1.8.0_152) rather than in
Program Files(C:\ProgramFiles\Java\jdk1.8.0_152)as it can create errors after wards.
∙ Create a new user variable. Put the Variable_name as HADOOP_HOME and Variable_value as
the path of the bin folder where you extracted Hadoop.
∙ Likewise, create a new user variable with variable name as JAVA_HOME and variable value as
the path of the bin folder in the Java directory.
∙ Now we need to set Hadoop bin directory and Java bin directory path in system variable
path. Edit Path in system variable
∙ Click on New and add the bin directory path of Hadoop and Javainit.
Configurations
Now we need to edit some files located in the Hadoop directory of the etc folder where
we installed Hadoop. The files that need to be edited have been highlighted.
1. Edit the file core-site.xml in the hadoop directory. Copy this xml property in the
configuration in the file.
/span>configuration>
/span>property>span>name>fs.defaultFS/span>/
name
span>value>hdfs://localhost:9000</value>
/span>/property>
/span>/configuration>
2. Edit map red-site.xml and copy this property in the configuration /span>
configuration> /span>property>
/span>name>mapreduce.framework.name/span>/name>
/span>value>yarn/span>/value>
19
/span>/property>
/span>/configuration>
Note: The path of name node and data node across value would be the path of the data node and name
node folders you just created.
/span>configuration>
/span>property>
/span>name>dfs.replication/span>/name>
/span>value>1/span>/value>
/span>/property>
/span>property>
/span>name>dfs.namenode.name.dir/span>/name
/span>value>C:\Users\hp\Downloads\hadoop-3.1.0\hadoop
3.1.0\data\namenode/span>/value>
/span>/property>
/span>property>
/span>name>dfs.datanode.data.dir/span>/name>
/span>value>C:\Users\hp\Downloads\hadoop-3.1.0\hadoop
3.1.0\data\datanode/span>/value>
/span>/property>
/span>/configuration>
5. Edit the file yarn-site.xml and add below property in the configuration
/span>configuration>
/span>property>
/span>name>yarn.nodemanager.aux-services/span>/name>
/span>value>mapreduce_shuffle/span>/value>
/span>/property>
/span>property>
/span>name>yarn.nodemanager.auxservices.mapreduce.shuffle.class/span>/name
> /span>value>org.apache.hadoop.mapred.ShuffleHandler/span>/value>
/span>/property>
/span>/configuration>
Do it hadoop-env.cmd and replace %JAVA_HOME% with the path of the java folder where your
jdk 1.8is installed
Hadoop needs windows OS specific files which do not come with default download of hadoop. To
include those files, replace the bin folder in Hadoop directory with the bin folder
∙ Download it as zip file. Extract it and copy the bin folder in it. If you want to save the old bin folder,
20
rename it like bin_old and paste the copied bin folder in that directory.
∙ Check whether hadoop is successfully installed by running this command on cmd-Hadoop version
∙ Since it doesn’t throw error and successfully shows the hadoop version, that means hadoop is
successfully installed in the system.
For matting the Name Node is done once when hadoop is installed and not for running hadoop file
system, else it will delete all the data in side HDFS.
Run this command- Hdfs name node–format. It would appear something like this–
Now change the directory in cmd to s bin folder of hadoop directory with this command, (Note: Make
sure you are writing the path as per your system)
Cd C:\Users\hp\Downloads\hadoop-3.1.0\hadoop-3.1.0\sbin
Start name node and data node with this command– start-dfs.cmd
Two more cmd windows will open for Name Node and DataNode Now start yarn through
this command -start-yarn.cmd
Two more windows will open, one for yarn resource manager and one for yarn node manager.
Note: Make sure all the 4 Apache Hadoop Distribution windows are up on running. If they are
not running, you will see an error or a shutdown message. In that case, you need to debug the
error. To access information about resource manager current jobs, successful and failed jobs.
21
To check the details about the hdfs (name node and data node)
Then I will copy a text file named ‘potatoes’ from my local file system to this folder that I
just created in hdfs using copy From Local command-
hdfsdfs-copyFromLocalC:\Users\hp\Downloads\potatoes.txt/sample
To verify if the file is copied to the folder, I will use ‘ls’ command by
specifying the folder name which will read the list of files in that folder–
hdfsdfs–ls/sample
To view the contents of the file we copied, I will use cat command
hdfsdfs–cat/sample/potatoes.txt
To Copy file from hdfs to local directory, I will use get command–
hdfsdfs-get/sample/potatoes.txtC:\Users\hp\Desktop\priyanka
Hadoop Map Reduce can be used to perform data processing activity. However,
it possessed limitations due to which frame works like Spark and Pig emerged and
have gained popularity. 200 lines of Map Reduce code can be written with less
than 10 lines of Pig code. Hadoop has various other components in its ecosystem
like Hive, Sqoop, Oozie, and HBase. You can down load these software
22
RESULT:
Thus installation of Hadoop single node cluster and simple application like
word count has executed successfully.
23
Ex No: 8 Creating and Executing your first container using Docker
Aim:
To create and execute first container using docker.
Procedure:
Digest:
sha256:d13c897516e497e898c229e2467f4953314b63e48d4990d3215d876ef9d1fc
Status: Downloaded newer image for mongo:4.4
d8f614a4969fb1229f538e171850512f10f490cb1a96fca27e4aa89ac082eba
6. Access localhost:8081 to see some output from mongo.
25
curl localhost:8081
which will return a warning from MongoDB,
It looks like you are trying to access MongoDB over HTTP on the native driver
port. 7. If you are using play-with-docker, look for the 8080 link near the top of the page.
8. Check your running containers with docker container ls
Step 3: Clean Up
1. First get a list of the containers running using docker container ls.
2. Next, run docker container stop [container id] for each container in the list. You can
also use the names of the containers that you specified before.
3. Remove the stopped containers
Result:
Thus the container created and executed with docker
26
Ex No: 9 Run a container from Docker hub
Aim:
To run a container from docker hub
Procedure:
Step 1: Sign up for a Docker account
Start by creating a Docker ID
Step 2: Create your first repository
To create a repository:
3. Name it <your-username>/my-private-repo.
1. You need to download Docker Desktop to build, push, and pull container
images.
3. 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
docker.io/library/hello-world:latest
27
docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
Step 5: Build and push a container image to Docker Hub from your
computer
Result:
28
29