Professional Documents
Culture Documents
NAME : …………………………………………….…….
SUBJECT : …………………………………………………..
COURSE : …………………………………………………..
NAME : CLASS :
UNIVERSITY REG No :
INDEX
AIM:
To Install Virtual Box/VMware Workstation with different flavours of Linux or Windows OS on top of
windows7 or 8
PROCEDURE:
Install Ubuntu as the guest operating system from an ISO image file. To create a new virtual
machine click on the New button in the Virtual Box Manager GUI window.
Give the VM a name and make sure that the operating system and version are Linux and
Ubuntu, respectively. Click Next.
Next, you must specify a virtual hard disk for your VM. There are multiple ways in which
Virtual Box can provide hard disk space to a VM, but the most common way is to use a large
image file on your real hard disk, whose contents Virtual Box presents to your VM as if it were a
In this example we will be using dynamic disks, but fixed disks will work just as well:
When the VM creation thingy goes away, press Ctrl + s to open your VM settings.
Next, click Storage in the left pane and click the CD icon in the right pane to browse for the
Ubuntu ISO you downloaded in the first steps.
After a few seconds the Ubuntu welcome window happily shoots on the screen ready to install
Ubuntu.
Choose the language as needed; and this one will be the default (once installed) throughout the
system.
3. At this point, choose the installation type and the first screenshot is an automated process,
even if you have an operating system already installed, the installer will auto-detect it and allow
you partition the drive in the next screen with simple sliders that will auto-allocate your assigned
space for the Ubuntu partition.
4. Prompt to confirm that you want the changes to be made to your internal drive; click continue
to move onto the next screen.
6. Configure as needed — depending on your type of keyboard and default input language.
7. This is where you enter your user details and clicks continue to proceed to the next screen.
8. Right up next, is the beginning of installation which (depending on your PC hardware), can
take a long or short time.
9. At this point, the installation is complete and now, you may restart your PC.
10. Once you’ve restarted, you are now greeted with the login screen where you input your
password.
RESULT:
Thus, the Virtual Box/VMware Workstation with different flavours of Linux or Windows OS has
been successfully installed.
AIM:
To install C compiler in the virtual machine created using virtual box and execute a simple
program.
PROCEDURE:
Install the compiler:
administrator@administrator-Virtual Box:~ sudo apt-get install gcc
Open the editor and write the c code:
administrator@administrator-Virtual Box:~ vi cse.c
Program:
#include <stdio.h>
int main() {
int year;
year = 2016;
else
return 0;
OUTPUT:
2016 is a leap year
RESULT:
Thus, the C compiler in the virtual machine has been installed and a simple C program has
been executed.
AIM:
To Install Google App Engine. Create a hello world app and other simple web applications
using python/java
PROCEDURE:
RESULT:
Thus, the installation of Google App Engine has been successfully done.
PROCEDURE:
Step 1: Download the basic
No matter what platform you build products on, there is always some housekeeping stuff you
need to put in place before you can hit the ground running. And deploying apps within the
Google App Engine is no exception.
1. Download Python 2.7
As of when this article was written, the Google App Engine standard environment supports
Python only upto version 2.7. However, it is only a matter of time before support for Python 3.x
is added. You can check the App Engine docs for the latest info.
2. Download Google Cloud SDK
This will allow you to fork apps onto your local machine, make changes (edit and develop the
app), and deploy your app back to the cloud.
3. Set the Python path in the Google App Engine launcher
After downloading the SDK, launch the App Engine launcher, go to Edit -> Preferences and
make sure you set the path for where you installed Python in step 1 above.
Thus, the GAE launcher to launch the web applications has been done and verified successfully.
PROCEDURE:
1. Download CloudSim installable files
from https://code.google.com/p/cloudsim/downloads/list and unzip
2. Open Eclipse
3. Create a new Java Project: File -> New
4. Import an unpacked CloudSim project into the new Java Project
5. The first step is to initialise the CloudSim package by initialising
the CloudSim library, as follows:
CloudSim.init(num_user, calendar, trace_flag)
6. 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:
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared())
9. Submit the VM list to the broker:
KGiSL Institute of Technology711717104001
broker.submitVmList(vmlist)
10. Create a cloudlet with length, file size, output size, and utilisation model:
broker.submitCloudletList(cloudletList)
12. Start the simulation:
CloudSim.startSimulation()
AIM:
To find a procedure to transfer the files from one virtual machine to another virtual machine
PROCEDURE:
CREATE DIRECTORY:
hduser@administrator-Virtual Box:~$ /usr/local/hadoop/bin/hdfs dfs -mkdir /sampledir
MOVE THE DATA TO INPUT DIRECTORY:
hduser@administrator-Virtual Box:~$ /usr/local/hadoop/bin/hdfs dfs -put
/home/administrator/Desktop/file1.txt /sampledir
BROWSER OUTPUT:
AIM:
To Find a procedure to launch a virtual machine using try stack (Online Openstack Demo
Version)
PROCEDURE:
Migrating instances
$ nova list
ID N Status Networks
a
m
e
2. Check the information associated with the instance. In this example, vm1 is running on HostB:
Property Value
OS-EXT-SRV- HostB
ATTR:host
...
...
m1.tiny
flavor
d1df1b5a-70c4-4fed-98b7-
id 423362f2c47c
name vm1
status ACTIVE
... ...
3. Select the compute node the instance will be migrated to. In this example, we will migrate the
instance to HostC, because nova-compute is running on it:
In this example, SERVER can be the ID or name of the instance. Another example:
6. To migrate an instance and watch the status, use this example script:
#!/bin/bash
# Provide usage
usage() {
exit 1
echo -n "."
sleep 2
done
Ex. No : 8
: HADOOP INSTALLATION
Date :
AIM:
Install Hadoop single node cluster and run simple applications like word count
PROCEDURE:
Procedure to set up one node Hadoop Cluster
Installing Java
administrator@administrator-Virtual Box:~$ cd ~
# Update the source list
administrator@administrator-Virtual Box:~$ sudo apt-get update
Installing SSH
1. ssh : The command is used for connecting to remote machines - the client.
2. sshd : The daemon that is running on the server and allows clients to connect, to the
server.
The ssh is pre-enabled on Linux, but in order to start sshd daemon, install ssh first.
Hadoop requires SSH access to manage its nodes, i.e. remote machines plus our local machine.
For our single-node setup of Hadoop, we therefore need to configure SSH access to localhost.
So, we need to have SSH up and running on our machine and configured it to allow SSH public
key authentication.
Hadoop uses SSH (to access its nodes) which would normally require the user to enter a
password. However, this requirement can be eliminated by creating and setting up SSH
certificates using the following commands. If asked for a filename just leave it blank and press
the enter key to continue.
The second command adds the newly created key to the list of authorized keys so that Hadoop
can use ssh without prompting for a password.
Install Hadoop
hduser@administrator-Virtual Box:~$ wget https://downloads.apache.org/hadoop/common/hadoop-
3.3.2/hadoop-3.3.2.tar.gz
hduser@administrator-Virtual Box:~$ tar -xvzf hadoop-3.3.2.tar.gz
To move the Hadoop installation to the /usr/local/hadoop directory using the following
command:
The following files will have to be modified to complete the Hadoop setup:
1. ~/.bashrc
2. /usr/local/hadoop/etc/hadoop/hadoop-env.sh
3. /usr/local/hadoop/etc/hadoop/core-site.xml
4. /usr/local/hadoop/etc/hadoop/mapred-site.xml.template
5. /usr/local/hadoop/etc/hadoop/hdfs-site.xml
1. ~/.bashrc:
Before editing the .bashrc file in our home directory, find the path where Java has been installed
to set the JAVA_HOME environment variable using the following command:
2. /usr/local/hadoop/etc/hadoop/hadoop-env.sh
hduser@administrator-Virtual Box:~$ vi
/usr/local/hadoop/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Adding the above statement in the hadoop-env.sh file ensures that the value of JAVA_HOME
variable will be available to Hadoop whenever it is started up.
3. /usr/local/hadoop/etc/hadoop/core-site.xml:
This file can be used to override the default settings that Hadoop starts with.
Open the file and enter the following in between the <configuration></configuration> tag:
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary
directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A URI
whose scheme and authority determine the FileSystem
implementation. The uri's scheme determines the config
property (fs.SCHEME.impl) naming the FileSystem
implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.
</description>
</property>
</configuration>
4. /usr/local/hadoop/etc/hadoop/mapred-site.xml
hduser@administrator-Virtual Box:~$ cp
/usr/local/hadoop/etc/hadoop/mapred-site.xml.template
/usr/local/hadoop/etc/hadoop/mapred-site.xml
The mapred-site.xml file is used to specify which framework is being used for MapReduce.
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:54311</value>
<description>The host and port that the MapReduce job
tracker runs at. If "local", then jobs are run in-process
as a single map and reduce task.
</description>
</property>
</configuration>
5. /usr/local/hadoop/etc/hadoop/hdfs-site.xml
It is used to specify the directories which will be used as the namenode and the datanode on that
host.
Before that, create two directories which will contain the namenode and the datanode for the
Hadoop installation.
Open the file and enter the following content in between the <configuration></configuration>
tag:
hduser@administrator-Virtual Box:~$ vi
/usr/local/hadoop/etc/hadoop/hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when
the file is created.
The default is used if replication is not specified in
create time.
</description>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/hadoop_store/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/hadoop_store/hdfs/datanode</value>
</property>
</configuration>
If this command is executed again after Hadoop has been used, it'll destroy all the data on the
Hadoop file system.
Starting Hadoop
Now it's time to start the newly installed single node cluster.
The output means that we now have a functional instance of Hadoop running on our VPS
(Virtual private server).
Stopping Hadoop
$ pwd
/usr/local/hadoop/sbin
$ ls
distribute-exclude.sh httpfs.sh start-all.sh
start-yarn.cmd stop-dfs.cmd yarn-daemon.sh
We run stop-all.sh or (stop-dfs.sh and stop-yarn.sh) to stop all the daemons running on our
machine:
Let's start the Hadoop again and see its Web UI:
SecondaryNameNode
DataNode
INPUT DIRECTORY:
hduser@administrator-VirtualBox:~$ /usr/local/hadoop/bin/hdfs dfs -mkdir
/sampledir
OUTPUT BROWSER:
RESULT:
Thus, the Hadoop Installation has been successfully completed.