Cloud Computing Record
Cloud Computing Record
C3 02
3
COURSE OBJECTIVES:
Course Outcomes:
CO1: Understand the design challenges in the cloud.
CO2: Apply the concept of virtualization and its types.
CO3: Experiment with virtualization of hardware resources and Docker.
CO4: Develop and deploy services on the cloud and set up a cloud environment.
CO5: Explain security challenges in the cloud environment.
Aim:
To Install Virtual Box/ VM ware Workstation with different flavours of Linux or Windows OS on top of
windows 7 or 8.
Procedure:
Steps to install Virtual Box:
1. Download the Virtual box exe and click the exe file…and select next button.
6. Then installation was completed. The show virtual box icon on desktop screen.
Steps to import Open nebula sandbox:
1. Open Virtual box
2. File import Appliance
3. Browse OpenNebula-Sandbox-5.0.ova file
4. Then go to setting, select USB and choose USB 1.1
5. Then Start the Open Nebula
6. Login using username: root, password: open nebula
Steps to create Virtual Machine through open nebula
1. Open Browser, type localhost:9869
2. Login using username: one admin, password: open nebula
3. Click on instances, select VMs then follow the steps to create Virtual machine
a. Expand the + symbol
b. Select user one admin
c. Then enter the VM name, no. of instance, CPU.
d. Then click on create button.
e. Repeat the steps the C, D for creating more than one VMs.
APPLICATIONS:
There are various applications of cloud computing in today’s network world. Many search
enginesand social websites are using the concept of cloud computing like
www.amazon.com, hotmail.com, facebook.com, linkedln.com etc. the advantages of cloud
computing in context to scalability is like reduced risk, low-cost testing, ability to segment
the customer base and
auto-scaling based on application load.
Performance 50
Viva-voce 10
Record 15
Total 75
RESULT:
Thus the procedure to run the virtual machine of different configuration.
Ex. No: 2 To Install a C compiler in the virtual machine created using virtual box and execute
Date: simple programs
Aim:
To Install a C compiler in the virtual machine created using 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 setting, select Usb and choose USB 1.1
5. Then Start the ubuntu_gt6
6. Login using username: dinesh, password:99425.
Performance 50
Viva-voce 10
Record 15
Total 75
Result:
Thus the simple C programs executed successfully.
Ex. No: 3 To Install Google App Engine. Create hello world app and other simple web
Date: applications using python/ java
Aim:
java. To Install Google App Engine. Create hello world app and other simple web applications using python/
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 SDKtogether with “Google Plugin for Eclipse “, then go to step 2, Otherwise, get the Google
app Engine Java SDK and extract it.
In Eclipse toolbar, click on the Google icon, and select “New Web Application Project…”
Figure – Deselect the “Google Web Toolkit“, and link your GAE Java SDK via the “configure
SDK”link.
Click finished; Google Plugin for Eclipse will generate a sample project automatically.
1. 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...
Copy
The extra is this file “appengine-web.xml “, Google App Engine need this to run and deploy theapplication.
File: appengine-web.xml
</appengine-web-
app>Copy
2. Run it local
Right click on the project and run as “Web Application “.
Eclipse console:
//...
INFO: The server is running at http://localhost:8888/
30 Mac 2012 11:13:01 PM com.google.appengine.tools.development.DevAppServerImpl startINFO:
The admin console is running at http://localhost:8888/_ah/admin
Copy
Access URL http://localhost:8888/, see output
and also the hello world servlet – http://localhost:8888/helloworld
In this demonstration, I created an application ID, named “mkyong123”, and put it in appengine-web.xml.
File : appengine-web.xml
</appengine-web-
app>Copy
To deploy, see following steps:
Figure 1.3 – If everything is fine, the hello world web application will be deployed to
this URL –http://mkyong123.appspot.com/
Performance 50
Viva-voce 10
Record 15
Total 75
Result:
Aim:
To Use GAE launcher to launch the web applications.
Procedure:
Making your First Application
Now you need to create a simple application. We could use the “+” option to
have the launcher make usan application– but instead we will do it by hand to
get a better sense ofwhat is going on.
Make a folder for your Google App Engine applications. I am going to make
the Folderon my Desktop called “apps” – the path to this folder is:
Once you have selected your application and press Run. After a few moments your
applicationwill 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:8080 into your browser and you should see your
application asfollows:
Just for fun, edit the index.py to change the name “Chuck” to your own name and
pressRefresh in the browser to verify your updates.
You can watch the internal log of the actions that the webserver is performing when
you areinteracting 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 he
output with aGET request.
With two files to edit, there are two general categories of errors that you may encounter.
If you make a mistake on the app.yaml file, the App Engine will not start and your
launcher will show ayellow 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 app.yaml (line 8).
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 on line one of our one-•‐line application.
Reference: http://en.wikipedia.org/wiki/Stack_trace
When you make a mistake in the app.yaml file – you must the fix the mistake and
attempt tostart the application again.
If you make a mistake in a file like index.py, you can simply fix the file and press
refresh inyour browser – there is no need to restart the server.
Performance 50
Viva-voce 10
Record 15
Total 75
Result:
Thus the GAE web applications was created.
Ex. No: 5 To Simulate a cloud scenario using Cloud Sim and run a scheduling algorithm that is
Date: notpresent in Cloud Sim
Aim:
To Simulate a cloud scenario using Cloud Sim and run a scheduling algorithm that is notpresent in Cloud
Sim.
Steps:
How to use Cloud Sim in Eclipse
Cloud Sim is written in Java. The knowledge you need to use Cloud Sim is basic Java programming
and somebasics about cloud computing. Knowledge of programming IDEs such as Eclipse or
NetBeans is also helpful. It is a library and, hence, Cloud Sim 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
beused. Please verify whether Java is available on your system.
Result:
The simulation was successfully executed.
Ex. No: 6 To find a procedure to transfer the files from one virtual machine to another virtual
Date: machine
Aim:
To find a procedure to transfer the files from one virtual machine to another virtual machine.
Steps:
1. You can copy few (or more) lines with copy &paste mechanism.
For this you need to share clipboard between host OS and guest OS,
installingGuest Addition on both the virtual machines (probably setting
bidirectional and restarting them).You copy from guest OS in the clipboard that is
shared with the host OS. Then you paste fromthe 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
anduse one ofthe directory shared as buffer to copy.
Installing Guest Additions you have the possibility to set Shared Folders too.As
you put afile in a shared folder from host OS or from guest OS, is immediately
visible to the other.(Keep in mind that can arise some problemsfor 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
filesdirectly copyingthem in this folder.
4. You can use usual method to copy files between 2 different computer with
client- serverapplication. (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 onthe
sending machine. Of course you need to have the authorization setted(via
password or, better,via an automatic authentication method).
Note: many Linux/Ubuntu distribution install sshd by default: you can see ifit is
runningwith pgrep sshd from a shell. You can install with sudo apt-get install
openssh-server.
5. You can mount part of the file system of a virtual machine via NFS
orSSHFS onthe other, or you can share file and directory with Samba. You
may find interesting the article Sharing files between guest and host
without VirtualBox shared folders with detailed step by step instructions.
You should remember that you are dialling with a little network of machineswith
differentoperative systems, and in particular:
Each virtual machine has its own operative system running on
and actsas aphysical machine.
Each virtual machine is an instance of a program owned by an user in
the hostingoperative system and should undergo the restrictions of the
user in thehosting OS.
E.g Let we say that Hastur and Meow are users of the hosting machine, but they did
not allow each other to see their directories (no read/write/execute authorization).
When each ofthem run a virtual machine, for the hosting OS those virtual machine are
two normal
programs owned by Hastur and Meow and cannot see the private directory of the
other user.This is a restriction due to the hosting OS. It's easy to overcame it: it's
enough to give authorization to read/write/execute to a directory or to chose a
different directory in which bothusers can read/write/execute.
Windows likes mouse and Linux fingers. :-)
I mean I suggest you to enable Drag &drop to be cosy with the Windowsmachines and the
Shared folders or to be cosy with Linux.
When you will need to be fast with Linux you will feel the need of ssh-keygen and
to Generate once SSH Keys to copy files on/froma remote machine without writingpassword
anymore. Inthis way it functions bash auto-completion remotely too!
PROCEDURE:
Steps:
Host:one-sandbox
After Migration:
Host:one-sandbox
Host:SACET
APPLICATIONS:
Easily migrate your virtual machine from one pc to another.
Performance 50
Viva-voce 10
Record 15
Total 75
Result:
Thus the file transfer between VM was successfully completed.
Ex. No: 7
Date: To Install Hadoop single code cluster and run simple application like word count
Aim:
To Install Hadoop single code cluster and run simple application like word count.
Steps:
Install Hadoop
Step 1: Click here to download the Java 8 Package. Save this file in your homedirectory.
Step 5:Add the Hadoop and Java paths in the bash file (.bashrc). Open.
Command: vi .bashrc
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 system and
can beaccessed throughthe Terminal, execute the java -version and hadoop version
commands.
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
core-site.xml informs Hadoop daemon where NameNode runs in the cluster. It contains
configuration settings of Hadoop core such as I/O settings that are common to HDFS &
MapReduce.
Command: vicore-site.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3 <configuration>
4 <property>
5 <name>fs.default.name</name>
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
4 <configuration>
5 <property>
<name>dfs.replication</name>
6
<value>1</value>
7
Step 9: Edit the mapred-site.xml file and edit the property mentioned below inside configuration tag:
In some cases, mapred-site.xml file is not available. So, we have to create the mapred-
site.xmlfile using mapred-site.xml template.
Command: vi mapred-site.xml.
5 <name>mapreduce.framework.name</name>
Step 10: Edit yarn-site.xml and edit the property mentioned below
inside configuration tag:
Command: vi 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>
<property>
4
<name>yarn.nodemanager.aux-services</name>
5
<value>mapreduce_shuffle</value>
6
</property>
7
<property>
8
hadoop-env.sh contains the environment variables that are used in the script to run
Hadooplike Java home path, etc.
Command: vi hadoop–env.sh
Fig: Hadoop Installation – Configuring
the NameNode.
Command: cd
Command: cd hadoop-2.7.3
This formats the HDFS via NameNode. This command is only executed for the first
time.Formatting the file system means initializing the directory specified by the
dfs.name.dir variable.
Never format, up and running Hadoop filesystem. You will lose all your data stored
in theHDFS.
Step 13: Once the NameNode is formatted, go to hadoop-2.7.3/sbin directory and start
all thedaemons.
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 filesstored in the HDFS and tracks all the file stored across the cluster.
Start NodeManager:
The NodeManager in each machine framework is the agent which is responsible for managing
containers, monitoring their resource usage and reporting the same to the ResourceManager.
Start JobHistoryServer:
JobHistoryServer is responsible for servicing all job history related requests from client.
Step 14: To check that all the Hadoop services are up and running, run thebelowcommand.
Command: jps
On startup, a DataNode connects to the Namenode and it responds to the requestsfrom the
Namenode for different operations.
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.
Performance 50
Viva-voce 10
Record 15
Total 75
Result:
Thus the Hadoop one cluster was installed and simple applications executed successfully.
Ex. No: 8
Date: To create and execute the container using Docker
Aim:
To create and execute the container using Docker.
Prerequisites:
For Ubuntu:
In order to create your first Docker application, I invite you to create a folder on your
A ‘main.py’ file (python file that will contain the code to be executed).
A ‘Dockerfile’ file (Docker file that will contain the necessary instructions
to createthe environment).
0 directories, 2 files
2. Edit the Python file
#!/usr/bin/env python3
print("Docker is
magic!")
Nothing exceptional, but once you see “Docker is magic!” displayed in your
The first step to take when you create a Docker file is to access the
DockerHubwebsite. This site contains many pre-designed images to save
your time
In our case, we will type ‘Python’ in the search bar. The first result is the official image
created to execute Python.
# So we write 'python' for the image name and 'latest' for the version.
FROM python:latest
# The first parameter 'main.py' is the name of the file on the host.
# The second parameter '/' is the path where to put the file on the image.#
Here we put the file at the image root folder.
COPY main.py /
# We need to define the command to launch when we are going to run the
Once your code is ready and the Dockerfile is written, all you have to do is create your
The ’-t’ option allows you to define the name of your image. In our
casewe have chosen ’python-test’ but you can put what you want.
Performance 50
Viva-voce 10
Record 15
Total 75
RESULT:
Thus the creation and execution of container program using Docker executed
successfully.
Ex. No: 9
Date: To run a container from Docker Hub
Aim:
To run a container from Docker Hub.
Procedures:
docker login
Containersdocker ps
docker ps -a
docker ps -a -q
name>
Step-8: Remove
Imagedocker images
docker rmi<image-id>
Performance 50
Viva-voce 10
Record 15
Total 75
RESULT:
Thus the Container from Docker hub executed successfully.