0% found this document useful (0 votes)
25 views

CC Lab Manual

Uploaded by

javeedakthar003
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

CC Lab Manual

Uploaded by

javeedakthar003
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Page

S.No. Date INDEX No.


Signature

1. Install Virtual Box/VM ware Workstation

Install a C Compiler in the Virtual Machine and


2. Execute a Sample Program

3. Installation of Google App Engine

4. Hosting a Static Website on Google App Engine

5. Simulate a Cloud scenario using CloudSim

6. Moving Files between Virtual Machines

7. Open Stack Installation

Establishment of AWS Account using the AWS


8. Management console

9. Create a mashup using Yahoo! Pipes.

10. Install Hadoop Single Node Cluster


EX.NO: 1
DATE: Install Virtual Box / VMware Workstation

AIM:

Find procedure to Install Virtual box/VMware Workstation with different flavours of


Linux or windows OS on top of windows7 or 8. This experiment is to be performed through portal.

PROCEDURE TO INSTALL:

Step 1:Visit http://www.virtualbox.org/wiki/downloads.

Step 2:Download Virtual Box platform packages for your OS.

Step 3: Open the Installation Package by double clicking.

Step 4: Click continue and finish installing Virtual Box.

Step 5: When finished installation, close the window.

INSTALLING VIRTUAL BOX SETUP ON WINDOWS:

Step 1: Once at your desktop, open your web browser and head over to the VirtualBox
website and download it. Then when the download is complete, open the file, and the
installation wizard will begin.
The first window is a welcome screen to introduce you to the installation; Click’ Next’.

2
Step 2:After, we will see the Custom Setup choices to select the additional support features
needed. By default, they are all selected, and we will keep it this way. Click ‘Next’

Step 3:The next screen will allow us to add short cuts to our system and register file
associations. Again, we will keep the default settings and click ‘Next’.

Step 4:We will be prompted with a warning about ‘Network Interfaces’. This lets you know that
your network connection many drop serval times during the installation as it incorporates the
devices with the virtual machine. Click ‘Yes’

3
Step 5:Next, the wizard has all the information it needs to install and is ready to begin. Click on
‘Install’ to start

Step 6: After a few minutes of the installation, it will be completed, and you can leave ‘Start
Oracle VM VirtualBox 6.1.12 after installation’ then click on ‘Finish’. This will start the
program immediately after closing the window.

4
Step 7: You will now see the VirtualBox application loaded. From here, you can modify the
preferences to the system, change settings for various OS’s and start installing a virtually run
operating system.

Download Linux:

Step 1: Visit the page http://www.ubuntu.com/download/ubuntu/download

Step 2:Choose the Latest version of Ubuntu and 64-bit and click “Start Download”

Install Linux using Virtual Box:

Step 1: Run Virtual Box by double-clicking the icon.

Step 2: Click “New” button on the top left corner.

Step 3:Click “Continue” on the pop-up window.

Step 4: Type VM name, select “Linux” for the OS and choose “Ubuntu” for the version.

5
Step 5: Choose the amount of memory to allocate (512 MB to 1024 MB)

Step 6: Click Continue or Next

Step 7:Choose create a new virtual hard disk.

Step 8:Click Continue or Next.

6
Step 9:Choose VDI (VirtualBox Disk Image).

Step 10:Click Continue or Next.

Step 11:Choose “Dynamically Allocated” click continue. This way, the size of your Virtual
Hard Disk will grow as you use.

7
Step 12:Click the folder icon and choose the ubuntu iso file you downloaded.

Step 13:Select the size of the Virtual Disk (8 GB) and click continue.

Step 14:Click Create.

Running Linux:

Step 1: Choose Ubuntu from left column and click Start.

Step 2:Click continue on pop-up window.

Step 3: Click the folder icon and choose the ubuntu iso file you downloaded and click continue
and start.

8
Step 4:Click Install Ubuntu.

Step 5: Check “Download updates” and click Forward.

9
Step 6:Choose “Erase disk and install Ubuntu” and click Forward (Don’t worry, it won’t wipe
your computer).

Step 7: Set up the location, Keyboard layout, Profile Creation.

10
Step 8:Click “Install Now” and wait.

Step 8:When finished, click Restart and press Enter.

RESULT:

Thus Virtualbox/VMware Workstation with different flavours of linux or Windows OS


was successfully installed on top of Windows 7 or 8.
11
EX.NO: 2
Install a C Compiler in the Virtual Machine and
DATE :
Execute a Sample Program

AIM:

To install a C compiler in the virtual machine created using virtual box and execute
simple programs.

STEPS:

STEP-1: Open the virtual machine.

STEP-2: Navigate through Ubuntu and open the terminal.

STEP-3: To install C compiler enter the following commands

$ sudo apt update

$ sudo apt install build-essential

STEP-4: Open file using the command “gedit&” on the terminal.

STEP-5: Type the following program on the gedit.

#include<stdio.h>

main()

printf("Hello World\n");

STEP-6: Save this file as “helloworld.c”


STEP-7: Type “gcchelloworld.c” on the terminal to compile the file.
STEP-8: Type “./a.out” on terminal to run the program.
STEP-9: “Hello World” will be printed on the next line of the terminal.

12
SCREENSHOTS

STEP-1:

STEP-2,3:

STEP-4:

13
STEP-5 and 6:

STEP-7,8 and 9:

RESULT:

Thus to install a C compiler in the virtual machine created using virtual box and execute
simple programs was successfully implemented and output was successfully obtained and
verified.
14
EX.NO: 3
DATE : Installation of Google App Engine

AIM:

To install Google app engine create hello world app and other simple web applicationusing
python/java.

STEPS:

Step1: Download and Install python 3.0.9 in your computer.

Step2: Download the Google App Engine SDK


Step2.1: Download the appropriate install package.
Step2.2: Download the Windows installer – the simplest thing is to download it to your
Desktop or another folder that you remember.
Step2.3: Click through the installation wizard, and it should install the App Engine.
Step3: Creating First application
Step3.1: Make a folder for your Google App Engine applications and then make a sub-
‐folder in within previous folder
Step3.2: Using a text editor, create a file with .yaml extension in the sub folder.
Step3.3: Create a python file using .py in the previous file.
Step3.4: Then in cmd as google-cloud-sdk\bin\dev_appserver.py and type folder path
and click enter.
Step4: Server is running at localhost, copy the localhost server and type in browser.
Step5: Click on the file, you can see the application.

SOURCE CODE (Source code for hello world )


Test.py
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.write("hello world")
app = webapp2.WSGIApplication([('/', MainPage),
],
debug=True)

15
app.yaml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
script: test.app

SCREENSHOTS:

16
RESULT:

Thus, to install Google app engine create hello world app and other simple web application
using python/java has been executed successfully.
17
EX:NO: 4
Hosting a Static Website on Google App Engine
DATE :

AIM:

To use Google app engine launcher to launch the web application.

STEPS:

STEP-1: Install Google App Engine, cloud SDK, tomcat and Maven into local machine.

STEP-2: Create cloud account and enter a name for cloud project and click create.

STEP-3: Enable App engine for cloud project

STEP-4: Create a maven project and include Java servlet API in maven repository. Use,gcloud
components install app-engine-java

STEP-5: Adding the app engine maven plugin in pom.xml file.

<plugin>

<groupId>com.google.cloud.tools</groupId>

<artifactId>appengine-maven-plugin</artifactId>

<version>2.2.0</version>

</plugin>

STEP-6: To run a web project, create an environment using tomcat and include the tomcat
plug-in in maven pom.xml file.
STEP-7: Run the command in app.yaml file terminal, gcloud app deploy and source file will be
uploaded to Google cloud storage.

18
SCREENSHOTS
STEP-1:

19
STEP-2:

STEP-3:

STEP-4:

20
STEP-5:

STEP-6:

STEP-7:

21
STEP-8:

STEP-9:

RESULT:

Thus, the procedure to use Google app engine launcher to launch the web application had
been executed successfully.
22
EX:NO: 5
Simulate a Cloud scenario using CloudSim
DATE :

AIM:

To Simulate a cloud scenario using CloudSim and run a Scheduling algorithm that is not
present in CloudSim.

STEPS:

Step1: Download the pre-requisites for Cloudsim.

Step2: Pre-requisites are Eclipse for java developers, Java Development kit & Java Runtime
Environment should be same versions, cloudsim 3.0.3, common math.

Step3: After extraction open eclipse and create new java project.

Step4: Below the name of project select cloudsim from the source folder where it is saved.

Step5: Then to add common math, select add external library and get the common math(JAR file)
from the source folder where it is saved.

Step6: Finish the project. After the project gets opened, right click on project and selectproperties.

Step7: Select java compiler and enable the project specific settings and click select jdk compliance
version above 1.5 to avoid errors in project.

Step8: Select an example from the and run it.

23
SNAPSHOTS:

Step1:

Step2:

Step3:

24
Step4:

Step5:

Step6:

25
Step7:

Step8:

26
Step9:

Step10:

27
Step11:

Step12:

Step13:

28
Step14:

Step15:

RESULT:

The given project to simulate a cloud scenario using CloudSim and run a scheduling
algorithm has successfully executed.
29
EX NO : 6
DATE : Moving Files between Virtual Machines

AIM:

To find a procedure to transfer the files from one virtual machine to host machine.

STEPS:

STEP-1: Login to the host machine and create a folder in ‘desktop’ named ‘Shared Folder’.

STEP-2: Open the virtual machine.

STEP-3: Click the settings ---> Shared Folders.

STEP-4: In order to select the shared folder path click (Folder with ‘+’ symbol).

STEP-5: Select the path Desktop ---> Shared Folders and select checkbox ‘auto mount’ click
OK.

STEP-6: Start the Guest OS which is present in the Virtual Machine.

STEP-7: Shared Folder Icon will be displayed in the Guest OS which is present inside the VM.
STEP-8: Create a file inside the shared folder it will be updated in guest and host machine.
SCREENSHOTS

STEP-1:

30
STEP-2:

STEP-3:

31
STEP-4:

STEP-5:

32
STEP-6:

STEP-7:

33
STEP-8:

RESULT:

Thus, a procedure to transfer the files from one virtual machine to host machine had been
executed successfully.
34
EX NO : 7
Open Stack Installation
DATE :

AIM:

To find a procedure to launch virtual machine using trystack.

STEPS:

STEP-1: In order to try OpenStack in TryStack, you must register by joining TryStack
FacebookGroup

STEP-2: Create Network

1. Go to Network > Networks and then click Create Network.


In Network tab, fill Network Name for example internal and then click Next.

2. In Subnet tab,
a) Fill Network Address with appropriate CIDR, for example
192.168.1.0/24. Use private network CIDR block as the best
practice.
b) Select IP Version with appropriate IP version, in this case IPv4.
c) Click Next.
3. In Subnet Details tab, fill DNS Name Servers with 8.8.8.8
(Google DNS) and then click Create.

STEP-3: Create Instance

1. Go to Compute > Instances and then click Launch Instance.


2. In Details tab,
1. Fill Instance Name, for example Ubuntu 1.
2. Select Flavor, for example m1.medium.
3. Fill Instance Count with 1.
4. Select Instance Boot Source with Boot from Image.
5. Select Image Name with Ubuntu 14.04 amd64 (243.7 MB) if you want install
Ubuntu
14.04 in your virtual machine.
35
3. In Access & Security tab,
1. Click [+] button of Key Pair to import key pair. This key pair is a
public and private key that we will use to connect to the instance
from our machine.
2. In Import Key Pair dialog,
1. Fill Key Pair Name with your machine name (for example Edward-Key).
2. Fill Public Key with your SSH public key (usually is in
~/.ssh/id_rsa.pub). See description in Import Key Pair
3. dialog box for more information. If you are using
Windows, you can use Puttygento generate key pair.
4. Click Import key pair.
3. In Security Groups, mark/check default.
4. In Networking tab,
1. In Selected Networks, select network that have been created in Step 1, for example
internal.
5. Click Launch.
6. If you want to create multiple instances, you can repeat step 1-5. I
created one more instance with instance name Ubuntu 2.

STEP-4:Create Router

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.

36
STEP-5: Configure Floating IP Address

1. Go to Compute > Instance.


2. In one of your instances, click More > Associate Floating IP.
3. In IP Address, click Plus [+].
4. Select Pool to external and then click Allocate IP.
5. Click Associate.

Now you will get a public IP, e.g. 8.21.28.120, for your instance

STEP-6: Configure Access & Security

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.

STEP-7: SSH to Your Instance

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.

SCREENSHOTS

STEP:1

37
STEP:2

STEP:3

RESULT:

Thus, the procedure to find a procedure to launch virtual machine using trystack has
been successfully executed.
38
EX NO: 8 Establishment of AWS Account using the
DATE: AWS Management console

AIM:

To Establish an AWS Account use the AWS management console to launch an EC2 Instance
and connect to it.
STEPS:
STEP-1: Create cloud account and enter a name for cloud project and click create.

STEP-2: In AWS Console, Select a region

STEP-3: Navigate to the EC2 Console, once you select the desired AWS region, go to the EC2
Console. From the same landing page, search for EC2 (Figure 1). Your landing page in the
management interface will likely display EC2 among the most used services in the account.

STEP-4: Create the EC2 instance, An EC2 instance is a virtual server deployed in the AWS cloud.
The first server-specific configuration to choose is the Amazon Machine Image (AMI). An AMI
is a base server image stored in the cloud.

STEP-5: Choose an instance type, after selecting the AMI, the next step is to choose an instance
type. There are close to 500 types of EC2 instances in instance families. They are grouped by
characteristics in terms of compute, memory, storage, and networking resources. Most instances
are billed by the minute. Pricing is proportional to the resources allocated to it, such as memory,
vCPUs, Elastic Block Store (EBS)/SSD storage and the network's data throughput rate.

STEP-6: Configure storage, Most EC2 instances attach to an EBS volume, which is configured
in this section. Specify the storage size in gigabytes and the storage type options. Options include
various generations of general-purpose SSD or provisioned IOPS as well as older-generation
magnetic volumes (not recommended). Storage-optimized instance types, such as EC2 C5d, come
with built-in SSD storage.

STEP-7: Tag the instance, A consistent tagging strategy across AWS resources is an operational
39
best practice. Therefore, appropriately tagging the new instance is important. Specify a Name tag
to easily identify the EC2 instance in the console after it's launched
STEP-8: Build in security, Security groups in AWS determine a set of access rules for both
incoming and outgoing traffic in the EC2 instance. The settings include port ranges, IPs or security
group IDs assigned to resources trying to access an EC2 instance. Limit incoming traffic to only
the set of parameters strictly required to access an EC2 instance. Avoid generic rules that allow
open access to a wide range of ports and IP addresses.

STEP-1: Enable SSH access with a key. The last step is to create an EC2 key or select an existing
one. The key is used to enable Secure Shell (SSH) access into the EC2 instance. With Windows
instances, the private EC2 key helps generate an admin password to access the instance. AWS
stores a copy of the public key inside the EC2 instance. Users keep the private key.

SCREENSHOTS

STEP-3:

STEP-4:

40
STEP-5:

STEP-6:

STEP-7:

41
STEP-8:

RESULT:

Thus, the procedure to Establish an AWS account Use the AWS management console to
launch an EC2 instance had been executed successfully.

42
EX NO: 9 Create a Mashup using Yahoo! Pipes.
DATE:

AIM:
To Create a mashup using Yahoo! Pipe to build a mashup of RSS feeds.

STEPS

STEP-1: Create a Yahoo! Pipes Account and login to Yahoo! Pipes and go to the ‘my pipes’ page.

STEP-2: Click on 'Create a New Pipe' to create a new pipe using a mashup using Yahoo! Pipes.

STEP-3: The list of sources on the left-hand side. You can build pipes using any of these sources.
For your RSS mashup, you will be using 'Fetch'.

STEP-4: Click on the 'Fetch' module and drag it onto the canvas. Fetch is a generic module that
can read any RSS feed on the Web. You just need to tell it which ones. Once you have dragged
the module onto the canvas, you can fill in the URLs for the RSS feeds you want in your mashup

STEP-5: You can add any number of URLs to the Fetch module you've created (there is a limit,
but it's not documented yet). To add a URL, simply click on the plus sign next to the word URL
at the top, and a new blank field will open at the end of the list. Then type or paste the URL into
the space where it says URL.

STEP-6: When you click on the 'Save' button at the top right of the canvas, a blue box appears
top left. Fill in the name of your mashup and then click on the 'Save' button right next to it.

STEP-7: Now that you have assembled your feeds in the 'Fetch' module, Pipes makes it easy to
test and build your mashup. In the menu to the left of the canvas, clicking on the word 'Operators'
pulls down a list of modules you will use to build the mashup.

STEP-8: We'll be using the 'Sort' operator to rearrange the items in our feed mashup into date
order. Drag the 'Sort' module into an empty space on the canvas.

STEP-9: Now you will see the pipes concept come to life. You need to connect the 'Fetch' module
containing all your feeds to the 'Sort' module. Click on the small circle at the bottom of the 'Fetch'
module and drag it towards the small circle at the top of the 'Sort' module.

43
STEP-10: To finish off, connect the 'Sort' module to the 'Pipe Output'. Click on the 'Save' button
and you are done.

STEP-11: Now click on ‘Back to my pipes’ which will take you to the home page of Yahoo! Pipe

STEP-12: Whenever you want to make changes, click on the schematic, or 'View/Edit' to go back
to the module’s canvas. To see how your RSS mashup has turned out, click on 'Run this Pipe'

SCREENSHOTS:

STEPS-1:

STEP-2:

44
STEP-3:

STEP-4:

45
STEP-5:

STEP-6:

46
STEP-7:

STEP-8:

47
STEP-9:

RESULT:

Thus, the procedure to create a mashup using Yahoo! Pipe has been created and executed
successfully.

48
EX NO : 10 Install Hadoop Single Node Cluster
(Content Beyond the Syllabus)
DATE :

AIM:

To install Hadoop Single node cluster and run simple Application like word count.

STEPS:

Step 1: Click hereto download the Java 8 Package. Save this file in yourhome directory.

Step 2: Extract the Java Tar File.

Step 3: Download the Hadoop 2.7.3 Package.

Step 4: Extract the Hadoop tar File.

Step 5: Add the Hadoop and Java paths in the bashfile(.bashrc).


Step 6: Edit the Hadoop Configuration files.

Step 7: Open core-site.xml and edit the property mentioned below insideconfiguration
tag:
Step 8: Edit the mapred-site.xml file and edit the property mentioned below inside
configuration tag:

Step 9: Edit yarn-site.xml and edit the property mentioned below insideconfiguration tag:

Step 10: Edit hadoop-env.sh and add the Java Path as mentioned below:

Step 11: Go to Hadoop home directory and format the Name Node.
Step 12: Once the NameNode is formatted, go to hadoop-2.7.3/sbindirectory and start all
the daemons.

Step 13: To check that all the Hadoop services are up and running, run thebelow command.

Step 14: Now open the Mozilla browser and gotolocalhost:50070/dfshealth.html to check
the NameNode interface.

SCREENSHOTS :
49
STEP 1:

After download

STEP 2:

Hadoop Installation – Extracting Java Files

STEP 3:

Hadoop Installation – Downloading Hadoop

50
STEP 4:

Hadoop Installation – Extracting Hadoop Files

STEP 5:

Hadoop Installation – Setting Environment Variable

STEP 6:

Hadoop Installation – Hadoop Configuration Files

51
STEP 7:

Hadoop Installation – Configuring core-site.xml

STEP 8:

Hadoop Installation – Configuring hdfs-site.xml

1
<?xmlversion="1.0"encoding="UTF-8"?>
2
3 <configuration>

4 <property>

<name>fs.default.name</name>
5

52
1
<?xmlversion="1.0"encoding="UTF-8"?>
2
3 <configuration>
4 <property>

5 <name>dfs.replication</name>

<value>1</value>
6

STEP 9:

Hadoop Installation – Configuring mapred-site.xml

1
<?xmlversion="1.0"encoding="UTF-8"?>
2
3 <configuration>

4 <property>
<name>mapreduce.framework.name</name>
5
53
STEP 10:

Hadoop Installation – Configuring yarn-site.xml

1
<?xmlversion="1.0">
2
<configuration>
3 <property>
4 <name>yarn.nodemanager.aux-services</name>

5 <value>mapreduce_shuffle</value>
</property>
6
<property>
7
<name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</ name>
8 <value>org.apache.hadoop.mapred.ShuffleHandler</value>

9 </property>

1 </configuration>

STEP 11:

Hadoop Installation – Configuring hadoop-env.sh

54
STEP 12:

Installation – Formatting NameNode

STEP 13:

Hadoop Installation – Starting NameNode

Hadoop Installation – Starting DataNode Hadoop

Installation – Starting ResourceManager

55
Hadoop Installation – Starting NodeManager

STEP 14:

Hadoop Installation – Checking Daemons

STEP 15:

Hadoop Installation – Starting WebU

56
RESULT :

The given experiment to install Hadoop Single node cluster and run simple application
has executed successfully.
57

You might also like