Lab File Cloud Computing
Lab File Cloud Computing
Aim:
To Install VirtualBox / VMware Workstation with different flavours of linux or windows
OS on top of windows7 or 8.
PROCEDURE:
6. Then installation was completed. They show virtual box icons 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:opennebula
Steps to create Virtual Machine through opennebula
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Click on instances, select VMs then follow the steps to create Virtaul machine
a. Expand the + symbol
b. Select user oneadmin
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 engines and 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.
RESULT:
Thus, the procedure to run the virtual machine of different configuration.
EXP No. 02 Install a C compiler in the virtual machine created using virtual
box and execute 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.
Steps to run c program:
1. Open the terminal.
2. Type cd /opt/axis2/axis2-1.7.3/bin then press enter
3. gedit hello.c
4. gcc hello.c
5. ./a.out
1. Type cd /opt/axis2/axis2-1.7.3/bin then press enter.
APPLICATIONS:
Simply running all programs in a grid environment.
RESULT:
Thus, the simple C programs executed successfully.
EXP No. 03 Install Google App Engine. Create Hello World App and other simple
web applications using python/java.
Aim: To Install Google App Engine. Create Hello World App and other simple web applications
using python/java.
Procedure:
1. Install Google Plugin for Eclipse
Read this guide – how to install Google Plugin for Eclipse. If you install the Google App Engine
Java SDK together with “Google Plugin for Eclipse“, then go to step 2, Otherwise, get the Google
App Engine Java SDK and extract it.
Click finished; Google Plugin for Eclipse will generate a sample project automatically.
3. Hello World
Review the generated project directory.
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 the
application.
File: appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application></application>
<version>1</version>
In this demonstration, I created an application ID, named “mkyong123”, and put it in appengine
web.xml.
File: appengine-web.xml
Copy
To deploy, see following steps:
Figure 1.1 – Click on GAE deploy button on the
toolbar.
Figure 1.2 – Sign in with your Google account and
click on the Deploy button.
Figure 1.3 – If everything is fine, the hello world web
application will be deployed to this URL –
http://mkyong123.appspot.com/
Result:
Thus, the simple application was created successfully.
EXP No. 04 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
Steps:
CloudSimExample1 finished!
RESULT:
The simulation was successfully executed.
EXP No. 05 To Use GAE launcher to launch web applications.
Aim:
Use GAE launcher to launch web applications.
Steps:
Making your First Application
Nowyouneedtocreateasimpleapplication. Wecouldusethe “+”optiontohave the launcher make
us an application – but instead we willdo it byhand to get a better sense of what is going on.
C:\Documents and Settings\csev\Desktop\apps And then make a sub--‐folder in within apps called “ae--01--trivial” – the
path to this folder wouldbe:
In this instance – the mistake is mis--‐indenting the last line in the app.yaml (line 8).
If you make antiterror in the index.pyfile, 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 to start
the application again.
If you make a mistake 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.
Result:
Thus, the GAE web applications were created.
EXP No. 06 To Find a procedure to transfer the files from one virtual
machine to another virtual machine.
Aim: Find a procedure to transfer the files from one virtual machine to another virtual machine.
Steps:
You can copy few (or more) lines with copy & paste mechanism.
For this you need to share clipboard between host OS and guest OS, installing Guest 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 from the host OS to the second guest OS.
• You can enable drag and drop too with the same method (Click on the
machine, settings, general, advanced, drag and drop: set to bidirectional )
• You can have common Shared Folders on both virtual machines and
use one of the directory shared as buffer to copy.
Installing Guest Additions you have the possibility to set Shared Folders too. As you put a file in
a shared folder from host OS or from guest OS, is immediately visible to the other. (Keep in mind
that can arise some problems for date/time of the files when there are different clock settings on
the different virtual machines).
If you use the same folder shared on more machines you can exchange files directly copying them in this
folder.
• You can use usual method to copy files between 2 different computer with client-
server application. (e.g. scp with sshd active for linux, winscp... you can get some
info about SSH servers e.g. here)
You need an active server (sshd) on the receiving machine and a client on the sending machine.
Of course you need to have the authorization setted (via password or, better, via an automatic
authentication method).
Note: many Linux/Ubuntu distribution install sshd by default: you can see if it is running with
pgrep sshd from a shell. You can install with sudo apt-get install openssh-server.
• You can mount part of the file system of a virtual machine via NFS or
SSHFS on the 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 machines with different
operative systems, and in particular:
• Each virtual machine has its own operative system running on and acts as
a physical machine.
• Each virtual machine is an instance of a program owned by an user in the hosting
operative system and should undergo the restrictions of the user in the hosting 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 of them 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 both users can read/write/execute.
• Windows likes mouse and Linux fingers. :-)
I mean I suggest you to enable Drag & drop to be cosy with the Windows machines 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/from a remote machine without writing password anymore. In this way it functions bash auto-
completion remotely too!
PROCEDURE:
Steps:
1. Open Browser, type localhost:9869
2. Login using username: oneadmin, password: opennebula
3. Then follow the steps to migrate VMs
a. Click on infrastructure
b. Select clusters and enter the cluster name
c. Then select host tab, and select all host
d. Then select Vnets tab, and select all vnet
e. Then select datastores tab, and select all datastores
f. And then choose host under infrastructure tab
g. Click on + symbol to add new host, name the host then click on create.
4. on instances, select VMs to migrate then follow the stpes
a. Click on 8th icon ,the drop down list display
b. Select migrate on that ,the popup window display
c. On that select the target host to migrate then click on migrate.
APPLICATIONS:
Easily migrate your virtual machine from one pc to another.
Result:
Thus, the file transfer between VM was successfully complete.
EXP No. 07 Find a procedure to launch virtual machine using trystack (Online
Openstack Demo Version)
TryStack.org Homepage-
I assume that you already join to the Facebook Group and login to the dashboard. After you log
in to the TryStack, you will see the Compute Dashboard like:
I guess you already know what router is. In the step 1, we created our network, but it is isolated. It doesn’t connect to
the internet. To make our network has an internet connection, we need a router that running as the gateway to the
internet.
1. Go to Network > Routers and then click Create Router.
2. Fill Router Name for example router1 and then click Create router.
3. Click on your router name link, for example router1, Router Details page.
4. Click Set Gateway button in upper right:
1. Select External networks with external.
2. Then OK.
5. Click Add Interface button.
1. Select Subnet with the network that you have been created in Step 1.
2. Click Add interface.
6. Go to Network > Network Topology. You will see the network topology. In the example,
there,are two network, i.e. external and internal, those are bridged by a router. There are
instances those are joined to internal network.
OpenStack has a feature like a firewall. It can whitelist/blacklist your in/out connection. It is called
Security Group.
1. Go to Compute > Access & Security and then open Security Groups tab.
2. In default row, click Manage Rules.
3. Click Add Rule, choose ALL ICMP rule to enable ping into your instance, and then click
Add.
4. Click Add Rule, choose HTTP rule to open HTTP port (port 80), and then click Add.
5. Click Add Rule, choose SSH rule to open SSH port (port 22), and then click Add.
6. You can open other ports by creating new rules.
Now, you can SSH your instances to the floating IP address that you got in the step 4. If you
are using Ubuntu image, the SSH user will be ubuntu.
Result:
Thus, the openstack demo worked successfully.
EXP No. 08 To Install Hadoop single node 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.
Step 2: Extract the Java Tar File.
Command: tar -xvf jdk-8u101-linux-i586.tar.gz
Step 5: Add the Hadoop and Java paths in the bash file (.bashrc). Open. bashrc file.
Command: vi .bashrc
Fig: Hadoop Installation –
Setting Environment Variable
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.
namenode -format
This formats the HDFS via NameNode. This command is only executed for the
first time. Formatting the file system means initializing the directory specified
by the 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 above command is a combination of start-dfs.sh, start-yarn.sh & mr-
jobhistory- daemon.sh
Or you can run all the services individually as below:
Start DataNode:
On startup, a DataNode connects to the Namenode and it responds to the requests from the
Namenode for different operations.
Command: ./hadoop-daemon.sh 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: ./yarn-daemon.sh 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: ./yarn-daemon.sh start nodemanager
Start JobHistoryServer:
JobHistoryServer is responsible for servicing all
job history related requests from client.
Command: ./mr-jobhistory-daemon.sh 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
Result:
Thus, Hadoop one cluster was installed and simple applications executed successfully.