Download as pdf or txt
Download as pdf or txt
You are on page 1of 139

LABORATORY RECORD

for
IT8711– FOSS and CLOUD COMPUTING LABORATORY
of
B.Tech- Information Technology
(Anna University Regulation 2017) For
the Batch (2019 to 2023)

DEPARTMENT OF INFORMATION TECHNOLOGY KCG


COLLEGE OF TECHNOLOGY,
CHENNAI – 600097

1
KARAPAKKAM, CHENNAI 600 097

REG. No. …………………………….

LABORATORY RECORD

Course Code: …………………….

Name of the Course: ……………………………………………………………………………..

It is to certify that this is a bonafide record of the work carried out by

……………………………………………………………………………………………………… of

………………….semester…………………………………………………………………………….

department, during the odd semester of the academic year 2022-2023.

Faculty In-charge: …………………………… HOD…………………………………………….

Int. Examiner: ……………………………… Ext. Examiner ………………………………..

Date of the Examination: ……………………

2
KCG College of Technology, Chennai-600 097

VISION OF THE COLLEGE

KCG College of Technology aspires to become a globally recognized center of excellence for science,
technology & engineering education, committed to quality teaching, learning, and research while
ensuring for every student a unique educational experience which will promote leadership, job
creation, social commitment and service to nation building

MISSION OF THE COLLEGE

 Disseminate knowledge in a rigorous and intellectually stimulating environment

 Facilitate socially responsive research, innovation and entrepreneurship

 Foster holistic development and professional competency

 Nurture the virtue of service and an ethical value system in the young minds

VISION OF THE DEPARTMENT

The department of Information Technology aspires to become a globally acclaimed center of


excellence offering quality education and enabling innovative research in Information Technology
department by producing competent Information Technology graduates to contribute towards nation
building.
MISSION OF THE DEPARTMENT

 Impart knowledge of fundamentals as well as emerging trends in Information Technology.


 Inculcate innovative and entrepreneurial abilities as well as ethical values among the students.
 Establish computing facilities and research activities to enhance the knowledge.
 Enhancing competency of faculty with the advanced technologies in information technology.

3
KCG College of Technology, Chennai-600 097

PROGRAMME EDUCATIONAL OBJECTIVES:


The Graduates of B.Tech (Information Technology) will:

PEO 1 Have successful career in Information Technology sector.

PEO 2 Design, implement, test and maintain software systems based on various client requirements.

PEO 3 Engage in life long learning and adapt to changing professional and societal needs.

PROGRAMME OUTCOMES AND PROGRAMME SPECIFIC OUTCOMES


After successful completion of B.Tech Information Technology programme, the students will be
able to:

Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering


PO 1 specialization to the solution of complex engineering problems.

Identify, formulate, research literature, and analyze complex engineering problems reaching
substantiated conclusions using first principles of mathematics, natural sciences, and
PO 2 engineering sciences.

Design solutions for complex engineering problems and design system components or
processes that meet the specified needs with appropriate consideration for the public health
PO 3 and safety, and the cultural, societal, and environmental considerations.

Use research-based knowledge and research methods including design of experiments,


PO 4 analysis and interpretation of data, and synthesis of the information to provide valid conclusions

Create, select, and apply appropriate techniques, resources, and modern engineering and IT
tools including prediction and modelling to complex engineering activities with an
PO 5 understanding of the limitations.
Apply reasoning informed by the contextual knowledge to assess social, health, safety, legal
and cultural issues and the consequent responsibilities relevant to the professional engineering
PO 6 practice.

Understand the impact of the professional engineering solutions in societal and environmental
PO 7 contexts, and demonstrate the knowledge of, and for sustainable development.

4
KCG College of Technology, Chennai-600 097

PO 8 Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.

PO 9 Function effectively as an individual, and as a member or leader in diverse teams, and in multi-
disciplinary settings.

Communicate effectively on complex engineering activities with the engineering


PO 10 community and with society at large, such as, being able to comprehend an write effective
reports and design documentation, make effective presentations, and give and receive clear
instructions.

Demonstrate knowledge and understanding of the engineering and management principles and
PO 11 apply these to one’s own work, as a member and leader in a team, to manage projects and in
multidisciplinary environments.

PO 12 Recognize the need for, and have the preparation and ability to engage in independent life-
long learning in the broadest context of technological change.

PSO No. Description of PSO


Design system to solve complex IT related problems using algorithm analysis, database
PSO 1 technology, multimedia, web design, networking and principles of Software
Engineering to face the challenges in corporate and industries.

Communicate and function efficiently as an individual and as a member or leader in


PSO 2 multidisciplinary teams in software development process.

Identify the need for sustainable development in software industries and follow the
PSO 3 professional code of ethics.

5
COURSE OUTCOMES WITH HIGHEST COGNITIVE LEVEL

Course Code: IT8711


Course Name: FOSS and CLOUD COMPUTING LABORATORY

Semester: VII
Regulation: 2017
At the end of the course the students will be able to

Highest
COs Course Outcomes Cognitive Level

Configure various virtualization tools such as Virtual Box,


CO 1
VMware workstation. K2

Design and deploy a web application in a PaaS


CO 2 K3
environment.
Simulate a cloud environment to implement new
CO 3 K3
schedulers.
Install and use a generic cloud environment that can be used
CO 4 K3
as a private cloud
CO 5 Manipulate large data sets in a parallel environment. K2

CO 6 Implement parallel programming using Hadoop K3

6
SYLLABUS

IT8711 – FOSS and CLOUD COMPUTING

LABORATORY LIST OF EXPERIMENTS

1. Use gcc to compile c-programs. Split the programs to different modules and create an application using
make command.
2. Use version control systems command to clone, commit, push, fetch, pull, checkout, reset, and delete
repositories.
3. Install Virtual box/VMware Workstation with different flavours of linux or windows OS on top of
windows7 or8.
4. Install a C compiler in the virtual machine created using virtual box and execute Simple Programs
5. Install Google App Engine. Create hello world app and other simple web applications using python/java.
6. Use GAE launcher to launch the web applications.
7. Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not present in CloudSim.
8. Find a procedure to transfer the files from one virtual machine to another virtual machine.
9. Find a procedure to launch virtual machine using trystack (Online Openstack Demo Version)
10. Install Hadoop single node cluster and run simple applications like word count.

SOFTWARE:
 Openstack
 Hadoop
 Eucalyptus or Open Nebula or equivalent

HARDWARE: Standalone desktops – 30 Nos. (or) Server supporting 30 terminals or more.

7
INDEX

SL.
NAME OF THE PROGRAM DATE MARKS SIGNATURE
NO.
Install VirtualBox/VMware workstation with
1 different flavours of Linux or windows OS on top of
windows 7 or 8 or 10
Install a C compiler in the virtual machine created
2 using virtual box and execute Simple Programs
Use gcc to compile C-programs. Split the programs to
3 different modules and create an application using
‘make’ command
Use version control systems command to clone,
4 commit, push, fetch, pull, checkout, reset, and delete
repositories
Install Google App Engine. Create hello world app
5
and other simple web applications using python/java.
6 Use GAE launcher to launch the web applications

7A Simulate a cloud scenario using CloudSim.


7B Run a scheduling algorithm using CloudSim.
Find a procedure to transfer the files from one virtual
8
machine to another virtual machine
Find a procedure to launch virtual machine using
9 trystack
(Online Openstack Demo Version)
10.A Install Hadoop single node cluster

10.B Word Count Program Using Map And Reduce

CONTENT BEYOND SYLLABUS

1 Develop a new Web Service for Calculator.

2 Develop new OGSA-compliant Web Service

8
IT8711 FOSS and Cloud Computing Lab

Ex.No:01
Install Virtual Box/VMware Workstation with different flavours of
Linux or windows OS on top of windows 7 or 8 or 10
Date:

 Virtualization:
 Virtualization is the creation of virtual servers, infrastructures, devices and
computing resources.
 Virtualization changes the hardware-software relations and is one of the
foundational elements of cloud computing technology that helps utilize the
capabilities of cloud computing to the full.
 Virtualization techniques allow companies to turn virtual their networks,
storage, servers, data, desktops and applications.

 Hypervisor or Virtual Machine Monitor (VMM)


A hypervisor or virtual machine monitor (VMM) is a piece of computer
software, firmware or hardware that creates and runs virtual machines. A
computer on which a hypervisor is running one or more virtual machines is
defined as a host machine. Each virtual machine is called a guest machine. The
hypervisor presents the guest operating systems with a virtual operating platform
and manages the execution of the guest operating systems. Multiple instances of
a variety of operating systems may share the virtualized hardware resources.

 Types of Virtualization
 Operating-system-level virtualization - is a server-virtualization method
where the kernel of an operating system allows for multiple isolated user-
space instances, instead of just one. Such instances (sometimes called
containers, software containers, virtualization engines (VE), virtual private
servers (VPS), or jails) may look and feel like a real server from the point of
view of its owners andusers
 Platform / Hardware virtualization -Hardware virtualization or platform
virtualization refers to the creation of a virtual machine that acts like a real
computer with an operating system. Software executed on these virtual
machines is separated from the underlying hardware resources. For example,
a computer that is running Microsoft Windows may host a virtual machine that
looks like a computer with the Ubuntu Linux operating system; Ubuntu- based
software can be run on the virtual machine. In hardware virtualization, the
host machine is the actual machine on which the virtualization takes place,
and the guest machine is the virtual machine. The words host and guest are
used to distinguish the software that runs on the physical machine from the
software that runs on the virtual machine. Different types of hardware
virtualization include:
o Full virtualization: Almost complete simulation of the actual
hardware to allow software, which typically consists of a guest
operating system, to run unmodified.
o Partial virtualization: Some but not all of the target environment
is simulated. Some guest programs, therefore, may need
modifications to run in this virtual environment.
9
IT8711 FOSS and Cloud Computing Lab
o Para virtualization: A hardware environment is not simulated;
however, the guest programs are executed in their own isolated
domains, as if they are running on a separate system.

 Application virtualization is software technology that encapsulates computer


programs from the underlying operating system on which it is executed. A fully
virtualized application is not installed in the traditional sense, although it is still
executed as if it were.

 Oracle Virtual box

 VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted at


server, desktop and embedded use. Each virtual machine can execute its own
operating system, including versions of Microsoft Windows, Linux, BSD, and
MS-DOS. VMware Workstation is developed and sold by VMware, Inc., a
division of EMC Corporation

 Ubuntu

 Ubuntu is an operating system like any other and it is free & open source. It
means that we can download it freely and install on as many computers as we
like. By the term open source it means that we can actually see its code. To
provide a more secure environment, the ―SUDO ‖tool is used to assign
temporary privileges for performing administrative tasks. Ubuntu comes
installed with a wide range of Software that includes LibreOffice ,Firefox,
Thunderbird

Steps in Installing Oracle Virtualbox with CentOS 7

Step 1:

 Download and Install Oracle Virtual Box latest version &Extension package
o https://virtualbox.org/wiki/downloads

Step 2:

 Download CentOS 7 OVA(Open Virtual Appliance)from


o https://linuxvmimages.com/images/centos-7

Step 3: The files are downloaded in your Local machine and Click the Oracle VirtualBox 6.0.8
Setup Wizard

10
IT8711 FOSS and Cloud Computing Lab

Oracle VM VirtualBox 6.0.8 Setup Wizard is open and follows the steps to install

11
IT8711 FOSS and Cloud Computing Lab

12
IT8711 FOSS and Cloud Computing Lab

Oracle VM VirtualBox 6.0.8 installation is completed

13
IT8711 FOSS and Cloud Computing Lab

Step 4: Import the Oracle VM Virtual Extension pack into the Oracle Virtual Box

14
IT8711 FOSS and Cloud Computing Lab

Oracle VMVirtual Extension pack is imported into the Oracle Virtual Box successfully

15
IT8711 FOSS and Cloud Computing Lab

Step 5: Click import Appliance and select CentOS-7.8.2003.com OVA (Open Virtual
Appliance) file from download directory

16
IT8711 FOSS and Cloud Computing Lab

17
IT8711 FOSS and Cloud Computing Lab

Installation process started

18
IT8711 FOSS and Cloud Computing Lab

Step 6: CentOS-7.8.2003.com is installed successfully and click start button to launch the
virtual machine

Step 7: Login into CentOS 7

 LoginDetails
o User name :centos
o Password :centos

19
IT8711 FOSS and Cloud Computing Lab

20
IT8711 FOSS and Cloud Computing Lab

Result:

21
IT8711 FOSS and Cloud Computing Lab

Ex.No:02
Install a C compiler in the virtual machine created using
virtual box and execute Simple Programs
Date:

Steps in Installing C or C++ Compiler in Virtual machine and executing simple programs

Step 1 : Install the C or C++ compiler on Ubuntu-14.04 Virtual Machine by

$ sudo apt install g++

Step 2: Create a file for writing C program.


$ sudo gedit add.c

Source Code:

Sum of two numbers

Step 3: Compile the Program


$sudo g++ add.c

Step 4: Run theProgram


$ ./a.out

22
IT8711 FOSS and Cloud Computing Lab

Output:

Result:

The simple C programs are executed with C compiler in the Virtual Machine
successfully and different programs are executed and verified.

23
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. What is VMWARE?

2. What is the use of virtual machine?

3. How can we create the VM?

4. How will you allocate the memory to VM?

5. How will you make the virtual block?

24
IT8711 FOSS and Cloud Computing Lab

Ex.No:03
Use gcc to compile c-programs. Split the programs to different modules

Date: and create an application using make command.

Aim:
To use gcc to compile c-programs. Split the programs to different modules and create
an application using make command.

Description:
make- utility for building and maintaining groups of programs.

1. Make: The purpose of the make utility is to determine automatically which pieces of
a large program need to be recompiled, and issue the commands to recompile them.

2. You can use make with any programming language whose compiler can be run with a
shell command.

3. In fact, make is not limited to programs. You can use it to describe any task where
some files must be updated automatically from others whenever the others change.

4. To prepare to use make, you must write a file called the make file that describes the
relationships among files in your program, and the states the commands for updating
each file.

5. In a program, typically the executable file is updated from object files, which are in
turn made by compiling source files.

Procedure to execute make command:

Step 1:

Open text editor in Ubuntu.

Step 2:
Create a files for any application

(Note : You can use any programming language) for example here we have created 4
files to find factorial.

Files include three c files and one header file.

25
IT8711 FOSS and Cloud Computing Lab
Example:

func1.c

funcheader.h
main.c

func2.c

Makefile all:

gccmain.c func1.c func2.c -o main

File 1:

Filename : func1.c

File 2:
Filename :func2.c

26
IT8711 FOSS and Cloud Computing Lab

File 3:

File 4:

Step 3:
Create Make file
Syntax:
target: (use tab space) prereq1 prereq2..

Open new text editor and do the following


File 5:
File Name :Makefile
all:
gccmain.c func1.c func2.c -o main

you can create an executable file for the above application (Factorial)

27
IT8711 FOSS and Cloud Computing Lab

Step 4:
desktop/sample/$ make
gccmain.c func1.c func2.c -o main
desktop/sample/$ ./main

Output:

Result :
Thus the gcc command was executed successfully using make utility command.

28
Review Questions:

1. What is the use of make commands?

2. Explain about functions of make command.

3. What is compiler?

4. Why make file used?

5. Write the syntax to run the make file.

29
Ex.No:04 Use version control systems command to clone, commit, push, fetch,
pull, checkout, reset, and delete repositories
Date:

AIM:
Use version control systems command to clone, commit, push, fetch, pull, checkout, reset, and delete
repositories.

FUNCTIONAL DIAGRAM:

COMMANDS:
The commands are,

Clone
Commit
Push
Fetch
Pull
Checkout
Reset
Delete

30
Clone:

The gitclone command is used to create a copy of a specific repository or branch within a repository.
Git is a distributed version control system. Maximize the advantages of a full repository on your own
machine by cloning.

Syntax:

git clone https://github.com/github/training-kit.git


Commit:

git commit creates a commit, which is like a snapshot of your repository. These commits are snapshots
of your entire repository at specific times. You should make new commits often, based around logical
units of change. Over time, commits should tell a story of the history of your repository and how it came
to be the way that it currently is. Commits include lots of metadata in addition to the contents and
message, like the author, timestamp, andmore.

Syntax:

gitcommit-m"update the README.md with link to contributing guide"

Push:

gitpush updates the remote branch with local commits. It is one of the four commands in Git that
prompts interaction with the remote repository. You can also think of gitpush as update or publish.

Syntax:

gitpush -u originmain
Pull:

git pull is one of the 4 remote operations within Git. Without running git pull, your local repository
will never be updated with changes from the remote. git pull should be used every day you interact with
a repository with a remote, at the minimum. That's why git pull is one of the most used Git commands.

Syntax:

# General format
gitpull OPTIONS REPOSITORY REFSPEC

# Pull from specific branch


gitpullREMOTE-NAMEBRANCH-NAME

31
Checkout:

Use gitcheckout on the command line to create a new branch, change your current working branch
to a different branch, or even to switch to a different version of a file from a different branch with
gitcheckout [branchname] [path to file]. The "checkout" action updates all or part of the working
tree with a tree object or blob from the object database, and updates the index and HEAD if the whole
working tree is pointing to a new branch.

Syntax:

gitcheckout [branch name] [path to file]


Reset:

The term reset stands for undoing changes. The git reset command is used to reset the changes. The git
reset command has three core forms of invocation. These forms are as follows.

Soft
Mixed
Hard

Syntax:

gitreset <option><commit-sha>
Delete:

It is common for a Git repo to have different branches. They are a great way to work on different
features and fixes while isolating the new code from the main codebase.

Repos often have a master branch for the main codebase and developers create other branches to work
on different features.

Once work is completed on a feature, it is often recommended to delete the branch.

Syntax:

// delete branch locally


gitbranch -d localBranchName

// delete branch remotely


gitpush origin --delete remoteBranchName

32
IT8711 FOSS and Cloud Computing Lab

33
IT8711 FOSS and Cloud Computing Lab

RESULT:

Thus the program is to use version control systems command to clone, commit, push, fetch, pull,
checkout, reset, and delete repositories is executed successfully.

34
IT8711 FOSS and Cloud Computing Lab

Review questions:

1. What is version control commands?

2. What is GIT?

3. Where do we use the commit?

4. Why should we use clone?

5. What is push and pull commands?

35
IT8711 FOSS and Cloud Computing Lab

Ex. No: 05
Install Google App Engine. Create hello world app and other simple web
applications using python/java.
Date:

Aim:
To install Google App Engine. Create hello world app and other simple web applications using
python/java

Google Cloud Platform(GCP)

o Google Cloud Platform (GCP), offered by Google, is a suite of cloud


computing services that runs on the same infrastructure that Google uses
internally for its end-user products, such as Google Search, Gmail, file storage,
and YouTube.
o Alongside a set of management tools, it provides a series of modular cloud
servicesincludingcomputing,datastorage,dataanalyticsandmachinelearning.
o Google Cloud Platform provides infrastructure as a service, platform as a
service, and server less computing environments.

Platform as a Service(PaaS)
o Cloud computing service which provides a computing platform and a solution
stack as a service.
o Consumer creates the software using tools and/or libraries from the provider.
o Provider provides the networks, servers, storage,etc.

Google AppEngine:

o Google App Engine was first released as a beta version in April2008.


36
IT8711 FOSS and Cloud Computing Lab
o It is a is a Platform as a Service (PaaS) cloud computing platform for
developing and hosting web applications in Google-managed datacenters.
o Google‘s App Engine opens Google‘s production to any person in the world at
no charge.
o Google App Engine is software that facilitates the user to run his web
applications on Google infrastructure.
o It is more reliable because failure of any server will not affect either the
performance of the end user or the service of the Google.
o It virtualizes applications across multiple servers and datacenters.
 Other cloud-based platforms include offerings such as Amazon Web
Services and Microsoft's Azure Services Platform.
Introduction of Google AppEngine
 Google App Engine lets you run your web applications on Google's
infrastructure. App Engine applications are easy to build, easy to maintain, and
easy to scale as your traffic and data storage needs grow. With App Engine, there
are no servers to maintain :You just upload your application, and it's ready to
serve your users.
 You can serve your app from your own domain name (such as
https://www.example.com/) using Google Apps. Or, you can serve your app
using a free name on the appspot.com domain. You can share your application
with the world, or limit access to members of your organization.
 Google App Engine supports apps written in several programming languages.
With App Engine's Java runtime environment, you can build your app using
standard Java technologies, including the JVM, Java servlets, and the Java
programming language—or any other language using a JVM-based interpreter
or compiler, such as JavaScript or Ruby. App Engine also features a dedicated
Python runtime environment, which includes a fast Python interpreter and the
Pythonstandardlibrary.TheJavaandPythonruntimeenvironmentsarebuiltto
ensure that your application runs quickly, securely, and without interference
from other apps on the system.
 With AppEngine, you only pay for what you use. There are no set-up costs and
no recurring fees. The resources your application uses, such as storage and
bandwidth, are measured by the gigabyte, and billed at competitive rates. You
control the maximum amounts of resources your app can consume, so it always
stays within your budget. App Engine costs nothing to get started. All
applications can use up to 500 MB of storage and enough CPU and bandwidth
to support an efficient app serving around 5 million page views a month,
37
IT8711 FOSS and Cloud Computing Lab

absolutely free. When you enable billing for your application, your free limits
are raised, and you only pay for resources you use above the free levels.
Architecture of Google AppEngine

Features of Google AppEngine

38
IT8711 FOSS and Cloud Computing Lab

GAE Application Environment:

 Google App Engine makes it easy to build an application that runs reliably, even
under heavy load and with large amounts of data. App Engine includes the following
features:
 Persistent storage with queries, sorting and transactions
 Automatic scaling and load balancing
 APIs for authenticating users and sending email using Google Accounts
 Task queues for performing work outside of the scope of a web request
 Scheduled tasks for triggering events at specified times and regular intervals
 Dynamic web serving, with full support for common web technologies

Java Runtime Environment

 You can develop your application for the Java runtime environment using
common Java web development tools and API standards. Your app interacts
with the environment using the Java Servlets standard, and can use common
web application technologies such as Java Server Pages
 The Java runtime environment uses Java6. The AppEngine JavaSDK supports
developing apps using either Java5 or 6.The environment includes the JavaSE
Runtime Environment (JRE) 6 platform and libraries. The restrictions of the
sandbox environment are implemented in the JVM. An app can use any JVM
byte code or library feature, as long as it does not exceed the sandbox
restrictions. For instance, byte code that attempts to open a socket or write to a
file will throw a runtime exception.
 Your app accesses most AppEngine services using Java standard APIs. For the
AppEngine data store, the Java SDK includes implementations of the Java Data
Objects (JDO) and Java Persistence API(JPA) interfaces. Your app can use the
JavaMail API to send email messages with the App Engine Mail service. The
java.net HTTP APIs accesses the App Engine URL fetch service.
 App Engine also includes low-level APIs for its services to implement
additional adapters, or to use directly from the application. See the
documentation for the data store, memcache, URL fetch, mail, images and
Google Accounts APIs. Typically, Java developers use the Java programming
language and APIs to implement web applications for the JVM. With the use

39
IT8711 FOSS and Cloud Computing Lab

of JVM-compatible compilers or interpreters, you can also use other languages


to develop web applications, such as JavaScript, Ruby.

Workflow of Google AppEngine

40
IT8711 FOSS and Cloud Computing Lab

Step1 : Login to www.cloud.google.com

Step2 :Goto Console

41
IT8711 FOSS and Cloud Computing Lab

Step 3 : Google Cloud Platform is shown

Step 4 : Click Dashboard in the Google Cloud Plaform

42
IT8711 FOSS and Cloud Computing Lab

Step 5 : Dashboard in the Google Cloud Plaform

Step 6 : Click New Project and give unique Project Name.

Example :kcet-cloud-project

43
IT8711 FOSS and Cloud Computing Lab

Step 7 : Google App Engine is initated

Step 8 : Click create Application

44
IT8711 FOSS and Cloud Computing Lab

Step 9 : Create app and Select Language Python

Step 10 : Python app is created in Google App Engine

45
IT8711 FOSS and Cloud Computing Lab

Step 11 : Python app Engine application is created

Step 12 : Click Cloud Shell in the Kathir-Cloud-Project

46
IT8711 FOSS and Cloud Computing Lab

Step 13 : Create a Directory PythonProject using mkdir command

Syntax: mkdir PythonProject

Step 14 : Click Editor to create Python application

47
IT8711 FOSS and Cloud Computing Lab

Step 15 : Click New File in the PythonProject Folder (Python file)

Step 16 : Create main.py file

48
IT8711 FOSS and Cloud Computing Lab

main.py file

Step 17 : Create app.yaml file

49
IT8711 FOSS and Cloud Computing Lab

app.yaml

Step 18 : Create requirements.txt file

requirements.txt

Flask==0.11.1
gunicorn==19.6.0

50
IT8711 FOSS and Cloud Computing Lab

Step 19 : Move to Cloud Shell Environment to run the application

Step 20 : Move to Cloud Shell Environment to run the application

Syntax : gcloud app deploy

Continue the application. It enable service on the given project

51
IT8711 FOSS and Cloud Computing Lab

It started building the object and fetching the storage object for the created application

It is updating the service

52
IT8711 FOSS and Cloud Computing Lab

The application is successfully deployed and URL is https://expanded-

curve-289413.uc.r.appspot.com

Step 21 : Run your program in the browser

53
IT8711 FOSS and Cloud Computing Lab

Step 22 : Hello World Program is sucessfully run in the browser

Result:

Thus the Google App Engine is installed successfully and a web application to display hello
world using python is developed and deployed in the GAE and used GAE Launcher to launch the
web applications.

54
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. What is virtual machine?

2. What is compiler?

3. How will you run the compiler?

4. What is GCC compiler?

5. Explain the uses ofVM.

55
IT8711 FOSS and Cloud Computing Lab

Ex.No:06
Use GAE launcher to launch the web applications

Date:

AIM:
To install the Google App Engine Software Development Kit (SDK) on a
Microsoft Windows and running a simple “hello world” application.

PROCEDURE:

Pre-•Requisites: Python 2.5.4

If you don't already have Python 2.5.4 installed in your computer, download
and Install Python 2.5.4 from:

http://www.python.org/download/releases/2.5.4/

Download and Install

You can download the Google App Engine SDK by going to:

http://code.google.com/appengine/downloads.html and

download the appropriate install package.

56
IT8711 FOSS and Cloud Computing Lab

Download the Windows installer – the simplest thing is to download it to our Desktop or another
folder that you remember.

Double Click on the GoogleApplicationEngine installer.

Click through the installation wizard, and it should install the App Engine. If you do not
have Python 2.5, it will install Python 2.5 as well.

Once the install is complete you can discard the downloaded installer

57
IT8711 FOSS and Cloud Computing Lab

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:\Documents and Settings\csev\Desktop\apps

And then make a sub-­‐folder in within apps called “ae-•01-•trivial”–the path to this
folder would be:

C:\ Documents and Settings \csev\Desktop\apps\ae-•01-•trivial

Using a text editor such as JEdit (www.jedit.org), create a file called app.yaml in the ae-•01-•trivial folder with the
following contents:

application: ae-01-trivial
version: 1 runtime: python
api_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 'Content-Type: text/plain' print '


' print 'Hello there Chuck'

Then start the GoogleAppEngineLauncher program that can be found under


Applications. Use the File -•> Add Existing Application command and navigate in to 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.

58
IT8711 FOSS and Cloud Computing Lab

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:8080 into 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 your updates.

Watching the Log

You can watch the internal log of the actions that the webserver is performing when you are interacting
with your application in the browser. Select your application in the Launcher and press the Logs
button to bring up a log window:

59
IT8711 FOSS and Cloud Computing Lab

Each time you press Refresh in your browser – you can see it retrieving the output with a GET
request.

Dealing With Errors

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
a yellow icon near your application:

60
IT8711 FOSS and Cloud Computing Lab

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(line8).

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

61
IT8711 FOSS and Cloud Computing Lab

When you make a mistake in the app.yamlfile – 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.

Shutting Down the Server

To shut down the server, use the Launcher, select your application and press the Stop button.
Alternate Method
1. Download and install Cloud SDK:

Download the SDK


Note: If you already have the Cloud SDK installed, update it by running the following command:
2. Create a newproject:
gcloud projects
gcloud components update
create [YOUR_PROJECT_ID] --set-as-default

Replace [YOUR_PROJECT_ID]with a string of charactersthat uniquely identifies your project.


For example, my-project-24.
Verify the project was created:

gcloud projects describe [YOUR_PROJECT_ID]

You see project details that might look like the following:

createTime: year-month-hour
lifecycleState: ACTIVE
name: project-name
parent:
id: '433637338589'
type: organization
projectId: project-name-id
projectNumber: 499227785679

3. Initialize your App Engine app with your project and choose its region:

gcloud app create --project=[YOUR_PROJECT_ID]

62
IT8711 FOSS and Cloud Computing Lab

When prompted, select the region where you want your App Engine application located.
Caution: You cannot change an app's region once it has been set.

4. Make sure billing is enabled for your project. A billing account needs to be linked to your
project in order for the application to be deployed to AppEngine.

Enable billing
Note: Running this sample app does not exceed your free quota.

5. Install the following prerequisites:


 Download and install Git.
 Run the following command to install the gcloud component that includes the App Engine
extension for Python3:

gcloud components install app-engine-python

6. Prepare your environment for Python development. It is recommended that you have the latest
version of Python, pip, and other related tools installed on your system. For instructions, refer to the
Python Development Environment Setup Guide.

This quickstart demonstrates a simple Python app written with the Flaskweb framework that can be
deployed to App Engine. Although this sample uses Flask, you can use any web framework that satisfies
the requirements above. Alternative frameworks include Django, Pyramid, Bottle, and web.py.

Download the Hello World app

We've created a simple Hello World app for Python 3 so you can quickly get a feel for deploying
an app to the Google Cloud.

1. Clone the Hello World sample app repository to your local machine.

git clone https://github.com/GoogleCloudPlatform/python-docs-samples

Alternatively, you can download the sampleas a zip file and extract it.
2. Change to the directory that contains the samplecode.

cd python-docs-samples/appengine/standard_python3/hello_world

Run Hello World on your local machine

To run the Hello World app on your local computer:


63
IT8711 FOSS and Cloud Computing Lab

Mac OS / Linux/Windows
1. Create an isolated Python environment in a directory external to your project and activate it:

python3 -m venvenv
source env/bin/activate
2. Navigate to your project directory and install dependencies:
Cd YOUR_PROJECT
pip install -r requirements.txt
3. Run the application:

pythonmain.py
4. In your web browser, enter the following address:

http://localhost:8080

Note: If you are using Cloud Shell, in the toolbar, click Web Preview and select Preview on port
8080 instead.

The Hello World message from the sample app displays on the page. In your terminal
window, press Ctrl+C to exit the web server.

Deploy and run Hello World on App Engine

To deploy your app to the App Engine standard environment:


1. Deploy the Hello World app by running the following command
from the standard_python3/hello_worlddirectory:

gcloud appdeploy
Learn about the optional flags.
2. Launch your browser to view the app at https://PROJECT_ID.REGION_ID.r.appspot.com

gcloud app browse

wherePROJECT_IDrepresents your Google Cloud project ID.

This time, the page that displays the Hello World message is delivered by a web server running on an App
Engine instance.

Congratulations! You've deployed your first Python 3 app to App Engine standard environment!

See the following sections for information about cleaning up as well as links to possible next steps that
you can take.

64
IT8711 FOSS and Cloud Computing Lab

Clean up

To avoid incurring charges, you can delete your Cloud project to stop billing for all the resources used
within that project.

Caution: Deleting a project has the following effects:


 Everything in the project is deleted. If you used an existing project for this tutorial, when you
delete it, you also delete any other work you've done in the project.
 Custom project IDs are lost. When you created this project, you might have created a custom project ID
that you want to use in the future. To preserve the URLs that use the project ID, such as an appspot.com
URL, delete selected resources inside the project instead of deleting the whole project.
2. In the Cloud Console, go to the Manage resources page.
Go to the Manage resources page
3. In the project list, select the project that you want to delete and then click Delete.
4. In the dialog, type the project ID and then click Shut down to delete the project.

Result:
Thus the installation of Google cloud SDK on the system and creating the hello world app is
completed successfully

65
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. What is GAE?

2. What is ASP?

3. What is JSP?

4. Explain the procedure to create the GAE

5. What is SDK?

66
IT8711 FOSS and Cloud Computing Lab

Ex.No:07.A
Simulate a cloud scenario using CloudSim

Date:

Introduction:

 CloudSim
 A Framework for modeling and simulation of Cloud Computing
Infrastructures and services
 Originally built at the Cloud Computing Distributed Systems (CLOUDS)
Laboratory, The University of Melbourne,Australia
 It is completely written in JAVA
 Main Features of CloudSiM
 Modeling and simulation
 Data centre network topologies and message-passing applications
 Dynamic insertion of simulation elements
 Stop and resume of simulation
 Policies for allocation of hosts and virtual machines
 Cloudsim –Essentials
 JDK 1.6 or abovehttp://tinyurl.com/JNU-JAVA
 Eclipse 4.2 or abovehttp://tinyurl.com/JNU-Eclipse
 AlternativelyNetBeanshttps://netbeans.org/downloads
 Up & Running with cloudsim guide:https://goo.gl/TPL7Zh

 Cloudsim-Directory structure
 cloudsim/ -- top level CloudSimdirectory
 docs/ -- CloudSim APIDocumentation
 examples/ -- CloudSimexamples
 jars/ -- CloudSim jararchives
 sources/ -- CloudSim sourcecode

 Cloudsim – Layered Architecture

67
IT8711 FOSS and Cloud Computing Lab

 Cloudsim - Component model classes


o CloudInformationService.java
o Datacenter.java,Host.java,Pe.java
o Vm.java,Cloudlet.java
o DatacenterBroker.java
o Storage.java,HarddriveStorage.java,SanStorage.java

 Cloudsim - Majorblocks/Modules
o org.cloudbus.cloudsim
o org.cloudbus.cloudsim.core
o org.cloudbus.cloudsim.core.predicates
o org.cloudbus.cloudsim.distributions
o org.cloudbus.cloudsim.lists
o org.cloudbus.cloudsim.network
o org.cloudbus.cloudsim.network.datacenter
o org.cloudbus.cloudsim.power
o org.cloudbus.cloudsim.power.lists
o org.cloudbus.cloudsim.power.models
o org.cloudbus.cloudsim.provisioners
o org.cloudbus.cloudsim.util

 Cloudsim - keycomponents
o Datacenter
o DataCenterCharacteristics
o Host
o DatacenterBroker
o RamProvisioner
o BwProvisioner
o Storage
o Vm
o VMAllocationpolicy
o VmScheduler
o Cloudlet
o CloudletScheduler
o CloudInformationService
o CloudSim
o CloudSimTags
o SimEvent
o SimEntity
o CloudsimShutdown
o FutureQueue
o DefferedQueue
o Predicate and associativeclasses.

68
IT8711 FOSS and Cloud Computing Lab

CloudSim Elements/Components

Procedure to import Eclipse, Cloudsim in your system

Step 1: Link to download Eclipse and download Eclipse for Windows 64bit into your Local
machine

https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclipse-ide-java-
developers

Windows x86_64

69
IT8711 FOSS and Cloud Computing Lab
Step 2: Download cloudsim-3.0.3 from git hub repository in your local machine
https://github.com/Cloudslab/cloudsim/releases/tag/cloudsim-3.0.3

Cloudsim-

Step 3: Download commons-maths3-3.6.1 from git hub repository in your local machine

https://commons.apache.org/proper/commons-math/download_math.cgi

Commons-
maths3-3.6.1-
bin.zip

70
IT8711 FOSS and Cloud Computing Lab

Step 4: Downloaded Eclipse, cloudsim-code-master and Apache Commons Math 3.6.1 in


your local machine and extract cloudsim-3.0.3 and Apache Commons Math 3.6.1

Downloaded Files

Step 5: First of all, navigate to the folder where you have unzipped the eclipse folder and
open Eclipse.exe

71
IT8711 FOSS and Cloud Computing Lab

Step 6: Now within Eclipse window navigate the menu: File -> New -> Project, to open the
new project wizard

Step 7: A ‗New Project‗ wizard should open. There are a number of options displayed and
you have to find & select the ‗Java Project‗ option, once done click ‘Next‗

72
IT8711 FOSS and Cloud Computing Lab

Step 8: Now a detailed new project window will open, here you will provide the project name
and the path of CloudSim project source code, which will be done as follows:

Project Name: CloudSim.

Step 9: Unselect the ‘Use default location’ option and then click on ‘Browse’ to open the path
where you have unzipped the Cloudsim project and finally click Next to set project settings.

73
IT8711 FOSS and Cloud Computing Lab

Step 10: Make sure you navigate the path till you can see the bin, docs, examples etc folder in the
navigation plane.

Step 11: Once done finally, click ‗Next‘ to go to the next step i.e. setting up of project
settings

Step 12: Now open ‘Libraries’ tab and if you do not find commons-math3-3.x.jar (here ‘x’
means the minor version release of the library which could be 2 or greater) in the list then
simply click on ‗Add External Jar’ (commons-math3-3.x.jar will be included in the project
74
IT8711 FOSS and Cloud Computing Lab
from this step)

Step 13: Once you have clicked on ‗Add External JAR’s‗ Open the path where you have
unzipped the commons-mathbinaries and select‗Commons-math3-3.x.jar‘ and click on open.

75
IT8711 FOSS and Cloud Computing Lab

Step 14: Ensure external jar that you opened in the previous step is displayed in the list and
then click on ‗Finish‘ (your system may take 2-3 minutes to configure the project)

Step15:Once the project is configured you can open the ‗ProjectExplorer‗ and start exploring
the Cloudsim project. Also for the first time eclipse automatically start building the workspace
for newly configured Cloudsim project, which may take some time depending on the
configuration of the computer system.

Following is the final screen which you will see after Cloudsim is configured.

76
IT8711 FOSS and Cloud Computing Lab
Step 16: Now just to check you within the ‗Project Explorer‗, you should navigate to the
‗examples‗ folder, then expand the package ‗org.cloudbus.cloudsim.examples‗ and double
click to open the ‗CloudsimExample1.java‗

77
IT8711 FOSS and Cloud Computing Lab

Step 17: Now navigate to the Eclipse menu ‗Run ->Run‗ or directly use a keyboard
shortcut ‘Ctrl + F11’ to execute the ‗CloudsimExample1.java‗.

78
IT8711 FOSS and Cloud Computing Lab

Step 18: If it is successfully executed it should be displaying the following type to output in
the console window of the Eclipse IDE.

Result:

Thus the cloudsim is simulated using Eclipse Environment successfully.

79
IT8711 FOSS and Cloud Computing Lab

Ex.No:07.B
Run a scheduling algorithm using CloudSim

Date:

Procedure to import Eclipse, running scheduling algorithms in your system

Step 1: Link to download Eclipse and download Eclipse for Windows 64bit into your Local
machine
https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclipse-ide-java-
developers

Windows x86_64

Step 2: Download scheduling source code cloudsim-code-master from git hub repository in
your local machine
https://github.com/shiro873/Cloudsim-Code

Src-schedulingsource
files

80
IT8711 FOSS and Cloud Computing Lab

Step 3: Download commons-maths3-3.6.1 from git hub repository in your local machine

https://commons.apache.org/proper/commons-math/download_math.cgi

Commons-maths3-
3.6.1-bin.zip

Step 4: Downloaded Eclipse, cloudsim-3.0.3 and Apache Commons Math 3.6.1 in your local
machine and extract cloudsim-3.0.3 and Apache Commons Math 3.6.1

Downloaded Files

81
IT8711 FOSS and Cloud Computing Lab

Step 5: First of all, navigate to the folder where you have unzipped the eclipse folder and
open Eclipse.exe

Step 6: Now within Eclipse window navigate the menu: File -> New -> Project, to open the
new project wizard

82
IT8711 FOSS and Cloud Computing Lab

Step 7: A ‗New Project‗ wizard should open. There are a number of options displayed and
you have to find & select the ‗Java Project‗ option, once done click ‘Next‗

Step 8: Now a detailed new project window will open, here you will provide the project name
and the path of CloudSim-master-code project source code, which will be done as follows:

Project Name: CloudSim

83
IT8711 FOSS and Cloud Computing Lab

Step 9: Unselect the ‘Use default location’ option and then click on ‘Browse’ to open the path where
you have unzipped the Cloudsim-code-masterproject and finally click Next to set project settings.

Step 10: Make sure you navigate the path till you can see the bin, docs, examples etc folder in the
navigation plane.

84
IT8711 FOSS and Cloud Computing Lab

Step 11: Once done finally, click ‘Next‘ to go to the next step i.e. setting up of project settings

Step 12: Once the project is configured you can open the ‗Project Explorer‗ and start exploring the
Cloudsim project. Also for the first time eclipse automatically start building the workspace for newly
configured Cloudsim project, which may take some time depending on the configuration of the
computer system.

Following is the final screen which you will see after Cloudsim is configured.

85
IT8711 FOSS and Cloud Computing Lab

Step13: Now just to check you with in the‗ProjectExplorer‗,you should navigate to the ‗src‗ folder,
then expand the package ‗default package‗ and double click to open the ‗RoundRobin.java‗.

Step 14: Now navigate to the Eclipse menu ‗Run ->Run‗ or directly use a keyboard shortcut ‘Ctrl
+ F11’ to execute the ‘RoundRobin.java‘. If it is successfully executed it should be displaying the
following type to output in the console window of the Eclipse IDE.

86
IT8711 FOSS and Cloud Computing Lab

Result:

Thus the scheduling algorithm is executed in cloudsim is simulated using Eclipse


Environment successfully.

87
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. What is cloudSim?

2. Explain the applications.

3. What is scheduling?

4. Name the cloud scheduler.

5. What is VM scheduler?

88
IT8711 FOSS and Cloud Computing Lab

Ex.No:08
Procedure File Transfer in Client & Server using virtual machine

Date:

Aim:

To procedure File Transfer in Client & Server using virtual machine.


Steps:
Steps to perform File Transfer in Client & Server using virtual machine.

Step 1: Open a virtual machine to do file transfer.


Step 2: Write the java program for FTP Client and FTP Server.
Step 3: Run the program.

Source Code:

FTPClient.java

89
IT8711 FOSS and Cloud Computing Lab

90
IT8711 FOSS and Cloud Computing Lab

FTPServer.java

91
IT8711 FOSS and Cloud Computing Lab

Output:

Result:
Thus the program to the File transfer operation using virtual machine was successfully
executed and verified.
92
IT8711 FOSS and Cloud Computing Lab

Review questions:

1. What is client?

2. What is server?

3. What is socket?

4. What is the functionality of dos.writeUTF(fn)?

5. Describe the corer mechanism behind file transfer between client and server.

93
IT8711 FOSS and Cloud Computing Lab

Ex.No: 09
Find a procedure to launch virtual machine using trystack (Online Openstack
Date: Demo Version)

Aim:
To find a procedure to launch virtual machine using Openstack

Introduction:
 OpenStack was introduced by Rackspace and NASA in July2010.
 OpenStackis an Infrastructure as a Service known as Cloud Operating System, that
takeresourcessuchasCompute,Storage,NetworkandVirtualizationTechnologiesand
control those resources at a data center level
 Theprojectisbuildinganopensourcecommunity-toshareresourcesandtechnologies with
the goal of creating a massively scalable and secure cloudinfrastructure.
 The software is open source and limited to just open source APIs such asAmazon.

The following figure shows the OpenStack architecture

OpenStack architecture
 It is modular architecture
 Designed to easily scale out
 Based on (growing) set of core services
The major components are
1. Keystone
2. Nova
3. Glance
4. Swift
5. Quantum
6. Cinder

94
IT8711 FOSS and Cloud Computing Lab

 KEYSTONE :
o Identity service
o Common authorization framework
o Manage users, tenants and roles
o Pluggable back ends (SQL,PAM,LDAP, IDMetc)

 NOVA
o Core compute service comprised of
 Compute Nodes – hypervisors that run virtual machines
 Supports multiple hypervisors KVM,Xen,LXC,Hyper-V
and ESX
 Distributed controllers that handle scheduling, API calls, etc
 Native OpenStack API and Amazon EC2 compatible
API
 GLANCE
o Image service
o Stores and retrieves disk images (Virtual machinetemplates)
o Supports RAW,QCOW,VHD,ISO,OVF &AMI/AKI
o Backend Storage : File System, Swift, Gluster, AmazonS3
 SWIFT
o Object Storage service
o Modeled after Amazon‘s Service
o Provides simple service for storing and retrieving arbitrary data
o Native API and S3 compatible API
 NEUTRON
o Network service
o Provides framework for Software Defined Network
o Plugin architecture
 Allows integration of hardware and software based network
solutions
 Open vSwitch, Cisco UCS, Standard Linux Bridge,
NiCiraNVP

95
IT8711 FOSS and Cloud Computing Lab

 CINDER
o Block Storage (Volume)service
o Provides block storage for Virtual machines(persistent disks)
o Similar to Amazon EBS service
o Plugin architecture for vendor extensions
 NetApp driver for cinder
 HORIZON
o Dashboard
o Provides simple self service UI for end-users
o Basic cloud administrator functions
 Define users, tenants and quotas
 No infrastructure management
 HEAT OpenStack Orchestration
o Provides template driven cloud application orchestration
o Modeled after AWS Cloud Formation
o Targeted to provide advanced functionality such as high availability
and auto scaling
o Introduced byRedhat
 CEILOMETER – OpenStack Monitoring and Metering
o Goal: To Provide a single infrastructure to collect measurements from
an entire OpenStack Infrastructure; Eliminate need for multiple agents
attaching to multiple OpenStack Projects
o Primary targets metering and monitoring: Providedextensibility

 Steps in Installing Openstack


Step1:
 Download and Install Oracle Virtual Box latest version &Extension
package
o https://virtualbox.org/wiki/downloads
Step 2:
 Download CentOS 7 OVA(Open Virtual Appliance)from
o Link :https://linuxvmimages.com/images/centos-7
 Import CentOS 7 OVA(Open Virtual Appliance) into Oracle VirtualBox

96
IT8711 FOSS and Cloud Computing Lab

Step 3: Login into CenOS 7

 Login Details
o User name :centos
o Password :centos
 To change into root user in Terminal

#sudo su–

Step 4: Installation Steps for OpenStack

Step5: Command to disable and stop firewall

# systemctl disable firewalld

#systemctl stop firewalld

97
IT8711 FOSS and Cloud Computing Lab

Step 6: Command to disable and stop Network Manager

# systemctl disable NetworkManager

# systemctl stop NetworkManager

Step 7: Enable and start Network

#systemctl enable network

#systemctl start network

98
IT8711 FOSS and Cloud Computing Lab

Step 8: OpenStack will be deployed on your Node with the help of PackStack package
provided by rdo repository (RPM Distribution of OpenStack). In order to enable rdo
repositories on Centos 7 run the below command.

#yum install -y https://rdoproject.org/repos/rdo-release.rpm

Step 9: Update Current packages

#yum update –y

99
IT8711 FOSS and Cloud Computing Lab

Step 10:Install OpenStack Release for CentOS

#yum install –y openstack-packstack

Step 11:Start packstack to install OpenStack Newton

#packstak --allinone

Step 12:Note the user name and password from keystonerc_admin

#cat keystonerc_admin

100
IT8711 FOSS and Cloud Computing Lab

Step 13: Click the URL and enter the user name and password to start OpenStack

OpenStack is successfully launched in your machine

101
IT8711 FOSS and Cloud Computing Lab

Result:

Thus the OpenStack Installation is executed successfully.


102
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. How to Enable File sharing in VirtualBox?

2. What is mount?

3. How can we share the folder in VM?

4. What is VM?

5. What is guest OS?

103
IT8711 FOSS and Cloud Computing Lab

Ex.No:10.A
Install Hadoop single node cluster
Date :

Aim:
To find procedure to set up the one node Hadoop cluster.

Procedure:

Step:1
Installing Java is the main prerequisite for Hadoop. Install java1.7.

$sudo apt-get update


$sudo apt-get install openjdk-7-jdk
$sudo apt-get install openjdk-7-jre
$ java -version

java version "1.7.0_79"

Open JDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)

Open JDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Step 2:

SSH Server accepting password authentication (at least for the setup

time). To install, run:

student@a4cse196:~$

su Password:

root@a4cse196:/home/student# apt-get install openssh-server

Step 3:

Generate the ssh key

root@a4cse196:/home/student# ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa

Generating public/private rsa key

pair. Created directory '/root/.ssh'.

Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in

/root/.ssh/id_rsa.pub

104
IT8711 FOSS and Cloud Computing Lab

The key fingerprint is:

77:a1:20:bb:db:95:6d:89:ce:44:25:32:b6:81:5d:d5

root@a4cse196 The key's random art image is:

+--[ RSA 2048] ---+

| .... |

| o. E|

| oB.o |

| +*+. |

| .S+. |

| .o=. |

| .=+ |

| o=. |
| . .o |

+ +

Step 4:
If the master also acts a slave (`sshlocalhost` should work without a password)

root@a4cse196:/home/student# cat $HOME/.ssh/id_rsa.pub

>>$HOME/.ssh/authorized_keys

Step5:

Create hadoop group and user:

Step 5.1 root@a4cse196:/home/student# sudoaddgrouphadoop

Adding group `hadoop' (GID 1003) ... Done.

Step 5.2 root@a4cse196:/home/student# sudoadduser --ingrouphadoophadoop

Adding user `hadoop' ...

Adding new user `hadoop' (1003) with group `hadoop' ... Creating

home directory `/home/hadoop' ...


105
IT8711 FOSS and Cloud Computing Lab
Copying files from `/etc/skel' ...

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

Changing the user information for hadoop

Enter the new value, or press ENTER for the

default Full Name []:

Room Number []:

Work Phone []:

Home Phone []:

Other []:

Is the information correct? [Y/n] y

root@a4cse196:/home/student#

Step 6:

Copy your .tar file to home.(hadoop-2.7.0.tar.gz)

Step 7:

Extracting the tar file.

root@a4cse196:/home/student# sudo tar -xzvf hadoop-2.7.0.tar.gz -C /usr/local/lib/

Step 8:

Changing the Ownership

root@a4cse196:/home/student# sudochown -R hadoop:hadoop /usr/local/lib/hadoop-2.7.0

Step 9:

Create HDFS directories:

root@a4cse196:/home/student# sudomkdir -p

106
IT8711 FOSS and Cloud Computing Lab
/var/lib/hadoop/hdfs/namenoderoot@a4cse196:/home/student# sudomkdir

-p /var/lib/hadoop/hdfs/datanoderoot@a4cse196:/home/student#

sudochown -R hadoop /var/lib/hadoop

Step 10:

Check where your Java is installed:

root@a4cse196:/home/student# readlink -f

/usr/bin/java

/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

Step 11:

Open gedit and do it

root@a4cse196:/home/student# gedit

~/.bashrc Add to ~/.bashrc file:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-

amd64 export

HADOOP_INSTALL=/usr/local/lib/hadoop-2.7.0 export

PATH=$PATH:$HADOOP_INSTALL/bin

export PATH=$PATH:$HADOOP_INSTALL/sbin

export

HADOOP_MAPRED_HOME=$HADOOP_INSTALL

export

HADOOP_COMMON_HOME=$HADOOP_INSTALL

export HADOOP_HDFS_HOME=$HADOOP_INSTALL

export YARN_HOME=$HADOOP_INSTALL

export

HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
107
IT8711 FOSS and Cloud Computing Lab
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib/native"

Step 12:

Reload source

root@a4cse196:/home/student# source ~/.bashrc

Step 13:

Modify JAVA_HOME in /usr/local/lib/hadoop-2.7.0/etc/hadoop/hadoop-

env.sh: root@a4cse196:/home/student# cd /usr/local/lib/hadoop-

2.7.0/etc/hadooproot@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop#

gedit hadoop-env.sh export JAVA_HOME=${ JAVA_HOME}

Changed this to below path

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

Step 14:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/core-site.xml to have something

like: root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit core-

site.xml

<configuration>

<property>

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

<value>hdfs://localhost:9000</value>

</property>

</configuration>

Step 15:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/yarn-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit yarn-site.xml

<configuration>

108
IT8711 FOSS and Cloud Computing Lab
<property>

<name>yarn.nodemanager.aux-services</name>

<value>mapreduce_shuffle</value>

</property>

<property>

<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>

<value>org.apache.hadoop.mapred.ShuffleHandler</value>

</property>

</configuration>

Step 16:

Create /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-site.xml from template:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# cp /usr/local/lib/hadoop-
2.7.0/etc/hadoop/mapred-site.xml.template /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-
site.xml

Step 17:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/mapred-site.xml to have something like:


root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit mapred-site.xml

<configuration>

<property>

<name>mapreduce.framework.name</name>

<value>yarn</value>

</property>

</configuration>

Step 18:

Modify /usr/local/lib/hadoop-2.7.0/etc/hadoop/hdfs-site.xml to have something

like: root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# gedit hdfs-

109
IT8711 FOSS and Cloud Computing Lab
site.xml

<configuration>

<property>

<name>dfs.replication</name>

<value>1</value>

</property>

<property>

<name>dfs.namenode.name.dir</name>

<value>file:/var/lib/hadoop/hdfs/namenode</value>

</property>

<property>

<name>dfs.datanode.data.dir</name>

<value>file:/var/lib/hadoop/hdfs/datanode</value>

</property>

</configuration>

Step 19:

Make changes in /etc/profile

$gedit /etc/profile

JAVA_HOME=/usr/lib/jvm/java-7-openjdk-

amd64 PATH=$PATH:$JAVA_HOME/bin

export JAVA_HOME

export PATH

$source /etc/profile

Step 20:

110
IT8711 FOSS and Cloud Computing Lab
root@a4cse196:/usr/local/lib/hadoop-2.7.0/etc/hadoop# hdfsnamenode -format
Step 21:

Switch to hadoop user


start-dfs.sh

yesyes

start-

yarn.shroot@a4cse196:/home/hado

op# jps6334 SecondaryNameNode

6498 ResourceManager

6927 Jps

6142 DataNode

5990 NameNode

6696 NodeManager

Step 22:

Browse the web interface for the Name Node; by default it is available at:

http://localhost:50070

Result:

Thus the procedure to set up the one node Hadoop cluster was successfully done and verified.
111
IT8711 FOSS and Cloud Computing Lab

Ex.No: 10.B
Word Count Program Using Map And Reduce
Date:

Aim:

To execute a Word Count Program Using Map And Reduce

Procedure:

1. Analyze the input file content


2. Develop the code
a. Writing a map function
b. Writing a reduce function
c. Writing the Driver class
3. Compiling the source
4. Building the JAR file
5. Starting the DFS
6. Creating Input path in HDFS and moving the data into Input path
7. Executing the program

Program: WordCount.java

112
IT8711 FOSS and Cloud Computing Lab

113
IT8711 FOSS and Cloud Computing Lab

Step 1:Compile the java program

For compilation we need this hadoop-core-1.2.1.jar file to compile the map reduce program.

https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-core/1.2.1

Assuming both jar and java files in same directory run the following command to

compile root@a4cseh160:/#javac -classpath hadoop-core-1.2.1.jar WordCount.java

Step 2: Create a jar file

Syntax:

jarcf jarfilename.jar MainClassName*.class

Output:

root@a4cseh160:/#jar cf wc.jar WordCount*.class

Step 3: Make directory in hadoop file system

Syntax:

hdfsdfs -mkdirdirectoryname

Output:

root@a4cseh160:/# hdfsdfs -mkdir /user

Step 4: Copy the input file into hdfs


Syntax:

hdfsdfs -put sourcefiledestpath

Output:

root@a4cseh160:/#hdfsdfs -put /input.txt /user

Step5: To a run a program

Syntax:

hadoop jar jarfilenamemain_class_nameinputfileoutputpath

114
IT8711 FOSS and Cloud Computing Lab
Output:

root@a4cseh160:/#hadoop jar wc.jar WordCount /user/input.txt /user/out

InputFile: (input.txt)

Cloud and Grid Lab. Cloud and Grid Lab. Cloud Lab.

Output:

18

3 Cloud

3 Lab.

2 Grid

2 and

Step 6:Check the output in the Web UI at http://localhost:50070.

In the Utilities tab select browse file system and select the correct user. The output is available inside the

output folder named user.

115
IT8711 FOSS and Cloud Computing Lab

Step 7:To Delete an output folder

Syntax:

hdfsdfs -rm -R outputpath

Output:

root@a4cseh160:/#hdfsdfs -rm -R /user/out.txt

Result:

Thus the numbers of words were counted successfully by the use of Map and Reduce tasks.

116
IT8711 FOSS and Cloud Computing Lab

Review Questions:

1. What is Map?

2. What is Reduce?

3. What is Hadoop core?

4 What is HBase, Pig, Zooeeper and Hive?

117
IT8711 FOSS and Cloud Computing Lab
1. Develop a new Web Service for Calculator.

OBJECTIVE:
To develop a new Web service for Calculator applications.

PROCEDURE:
When you start Globus toolkit container, there will be number of services starts up. The service for
this task will be a simple Math service that can perform basic arithmetic for a client.

The Math service will access a resource with two properties:


1. An integer value that can be operated upon by the service
2. A string values that holds string describing the last operation
The service itself will have three remotely accessible operations that operate upon value:

(a) add, that adds a to the resource property value.


(b) subtract that subtracts a from the resource property value.
(c) getValueRP that returns the current value of value.

Usually, the best way for any programming task is to begin with an overall description of what
you want the code to do, which in this case is the service interface. The service interface
describes how what the service provides in terms of names of operations, their arguments and
return values. A Java interface for our service is:

public interface Math {


public void add(int a);
public void subtract(int a);
public intgetValueRP();
}

It is possible to start with this interface and create the necessary WSDL file using the standard
Web service tool called Java2WSDL. However, the WSDL file for GT 4 has to include details
of resource properties that are not given explicitly in the interface above. Hence, we will provide
the WSDL file.

Step 1 Getting the Files

The MathService source code files can be found from


http://www.gt4book.com(http://www.gt4book.com/downloads/gt4book-examples.tar.gz)
A Windows zip compressed version can be found at
http://www.cs.uncc.edu/~abw/ITCS4146S07/gt4book-examples.zip.
Download and uncompress the file into a directory called GT4services. Everything is included (the java
source WSDL and deployment files, etc.):

118
IT8711 FOSS and Cloud Computing Lab

WSDL service interface description file -- The WSDL service interface description
file is provided within the GT4services folder at:

GT4Services\schema\examples\MathService_instance\Math.wsdl

The Java code for the service and its resource properties is located within the GT4 services
folder at:

GT4services\org\globus\examples\services\core\first\impl\MathService.java. Deployment
Descriptor -- The deployment descriptor gives several different important sets of information
about the service once it is deployed. It is located within the GT4services folder at:
GT4services\org\globus\examples\services\core\first\deploy-server.wsdd.

Step 2 – Building the Math Service

It is now necessary to package all the required files into a GAR (Grid Archive) file. The build tool
ant from the Apache Software Foundation is used to achieve this as shown overleaf: Generating a
GAR file with Ant (from http://gdp.globus.org/gt4- tutorial/multiplehtml/ch03s04.html).

Ant is similar in concept to the Unix make tool but a java tool and XML based. Build scripts are
provided by Globus 4 to use the ant build file. The windows version of the build script for
MathService is the Python file called globus-build- service.py, which held in the GT4services
directory. The build script takes one argument, the name of your service that you want to deploy.
To keep with the naming convention in [1], this service will be called first. In the Client Window,
run the build script from the GT4services directory with:

globus-build-service.py first

The output should look similar to the following:

Buildfile: build.xml
.
.
.
.
.

119
IT8711 FOSS and Cloud Computing Lab
BUILD SUCCESSFUL

During the build process, a new directory is created in your GT4Services directory that is
named build. All of your stubs and class files that were generated will be in that directory and
its subdirectories. More importantly, there is a GAR (Grid Archive) file called
org_globus_examples_services_core_first.gar. The GAR file is the package that contains
every file that is needed to successfully deploy your Math Service into the Globus container.
The files contained in the GAR file are the Java class files, WSDL, compiled stubs, and the
deployment descriptor.

Step 3 – Deploying the Math Service

If the container is still running in the Container Window, then stop it using Control- C. To deploy
the MathService, you will use a tool provided by the GlobusToolkit called globus-deploy-gar. In
the Container Window, issue the command:

globus-deploy-garorg_globus_examples_services_core_first.gar

Successful output of the command is :

The service has now been deployed.


Check service is deployed by starting container from the Container Window:
You should see the service called MathService.

120
IT8711 FOSS and Cloud Computing Lab

Step 4 – Compiling the Client

A client has already been provided to test the Math Service and is located in the
GT4Services directory at:

GT4Services\org\globus\examples\clients\MathService_instance\Client.java
and contains the following code:

packageorg.globus.examples.clients.MathService_insance; import
org.apache.axis.message.addressing.Address;
importorg.apache.axis.message.addressing.EndpointReferenceType;
importorg.globus.examples.stubs.MathService_instance.MathPortType;
import org.globus.examples.stubs.MathService_instance.GetValueRP;
import
org.globus.examples.stubs.MathService_instance.service.MathServiceAddressingLo
cator;
public class Client {
public static void main(String[] args) {
MathServiceAddressingLocator locator = new
MathServiceAddressingLocator()
try {
String serviceURI = args[0];
// Create endpoint reference to service
EndpointReferenceType endpoint = new
EndpointReferenceType();
endpoint.setAddress(new Address(serviceURI));
MathPortType math;
// Get PortType
121
IT8711 FOSS and Cloud Computing Lab
math = locator.getMathPortTypePort(endpoint);

// Perform an addition
math.add(10);
// Perform another addition
math.add(5);
// Access value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP()));
// Perform a subtraction
math.subtract(5);
// Access value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP()));
} catch (Exception e) {
e.printStackTrace();
}
}
}

When the client is run from the command line, you pass it one argument. The argument is the
URL that specifies where the service resides. The client will create the end point reference and
incorporate this URL as the address. The end point reference is then used with the
getMathPortTypePort method of a MathServiceAdressingLocator objectto obtain a
reference to the Mathinterface (portType). Then, we can apply the methods available in the
service as though they were local methods Notice that the call to the service (add and subtract
methodcalls) must be in a“try{}catch(){}”blockbecausea“RemoteException” may be thrown.
The code for the “MathServiceAddressingLocator” is created during the build process.

(a) Settting theClasspath

To compile the new client, you will need the JAR files from the Globus toolkit in your
CLASSPATH. Do this by executing the following command in the Client Window:

%GLOBUS_LOCATION%\etc\globus-devel-env.bat

You can verify that this sets your CLASSPATH, by executing the command:

echo %CLASSPATH%

You should see a long list of JAR files.

Running\gt4\etc\globus-devel-env.batonlyneedstobedoneonceforeachClientWindowthat you
open. It does not need to be done each time you compile.

(b) CompilingClient

Once your CLASSPATH has been set, then you can compile the Client code by typing in the
following command:

122
IT8711 FOSS and Cloud Computing Lab
javac -classpath build\classes\org\globus\examples\services\core\first\impl\:%CLASS
PATH% org\globus\examples\clients\MathService_instance\Client.java

Step 5 – Start the Container for your Service

Restart the Globus container from the Container Window with:


globus-start-container -nosec
if the container is not running.

Step 6 – Run the Client

To start the client from your GT4Services directory, do the following in the Client Window, which
passes the GSH of the service as an argument:

java -classpath build\classes\org\globus\examples\services\core\first\impl\:%CLASS PATH%


org.globus.examples.clients.MathService_instance.Client
http://localhost:8080/wsrf/services/examples/core/first/MathService which should give the output:

Current value:15
Current value:10

Step 7 – Undeploy the Math Service and Kill a Container

Before we can add functionality to the MathService, we must undeploy the service. In the
ContainerWindow, kill the container with a Control-C. Then to undeploy the service, type in
the following command:

globus-undeploy-garorg_globus_examples_services_core_first
which should result with the following output:
Undeploying gar...
Deleting /.
.
.
Undeploy successful

6 Adding Functionality to the Math Service


In this final task, you are asked to modify the Math service and associated files so the service
supports the multiplication operation. To do this task, you will need to modify:

Servce Code (MathService.java)


WSDL file (Math.wsdl)

Keep all file names the same and simply redeploy the service afterwards. You will also need to
add a code to the client code (Client.java) to test the modified service to include multiplication.

Result:
Thus the Develop a new Web Service for Calculator was executed successfully.
123
IT8711 FOSS and Cloud Computing Lab

2. Develop new OGSA-compliant Web Service

OBJECTIVE:

To develop a new OGSA-compliant web service.

PROCEDURE:

Writing and deploying a WSRF Web Service is easier than you might think. You just
have to follow five simple steps

1. Define the service's interface. This is done withWSDL


2. Implement the service. This is done with Java.
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done withAnt
5. Deploy service. This is also done with a GT4tool

To run this program, as a minimum you will be required to have installed the
following prerequisite software
a. Download the latest Axis2 runtime from the above link and extract it. Now we
point Eclipse WTP to downloaded Axis2 Runtime. Open Window ->Preferences
-> Web Services -> Axis2 Emitter

Select the Axis2 Runtime tab and point to the correct Axis2 runtime location.
Alternatively at the Axis2 Preference tab, you can set the default setting that will
come up on the Web Services Creation wizards. For the moment we will accept
the default settings.
b. ClickOK.

124
IT8711 FOSS and Cloud Computing Lab

c. Next we need to create a project with the support of Axis2 features. Open File ->
New -> Other... -> Web -> Dynamic WebProject

Click next
d. Select the name Axis2WSTest as the Dynamic Web project name (you canspecify
any name you prefer), and select the configured Tomcat runtime as the target
runtime.

Click next.
e. Select the Axis2 Web servicefacet

Click Finish.

125
IT8711 FOSS and Cloud Computing Lab

f. This will create a dynamic Web project in theworkbench

g. Import the wtp/Converter.java class into Axis2WSTest/src (be sure to preservethe


package).

Build the Project, if its not auto build.

126
IT8711 FOSS and Cloud Computing Lab

h. Select Converter.java, open File -> New -> Other... -> Web Services -> Web
Service

Click next.

i. The Web service wizard would be brought up with Web service type setto
Bottom up Java bean Web Service with the service implementation
automatically filled in. Move the service scale to Startservice.

127
IT8711 FOSS and Cloud Computing Lab

j. Click on the Web Service runtime link to select the Axis2runtime.

Click OK.

k. Ensure that the correct server and service project are selected as displayedbelow.

Click next.

128
IT8711 FOSS and Cloud Computing Lab

This page is the service.xml selection page. if you have a custom services.xml,
you can include that by clicking the Browse button. For the moment, just leaveit
at the default.

Click next.

l. This page is the Start Server page. It will be displayed if the server has not been
started. Click on the Start Server button. This will start the server runtime.

Click next.
129
IT8711 FOSS and Cloud Computing Lab

m. This page is the Web services publication page, accept thedefaults.

Click Finish.

n. Now, select the Axis2WSTest dynamic Web project, right-click and select Run ->
Run As -> Run on Server to bring up the Axis2servlet.

Click Next.

130
IT8711 FOSS and Cloud Computing Lab

o. Make sure you have the Axis2WSTest dynamic Web project on the right-hand
side under the Configured project.

Click Finish.

p. This will deploy the Axis2 server webapp on the configured servlet container
and will display the Axis2 home page. Note that the servlet container will start
up according to the Server configuration files on your workspace.

q. Click on the Services link to view the available services. The newly
created converter Web service will be shown there.

131
IT8711 FOSS and Cloud Computing Lab

r. Click on the Converter Service link to display the WSDL URL of the newly
created Web service. Copy the URL.

s. Now we'll generate the client for the newly created service by referring the WSDL
generated by the Axis2 Server. Open File -> New -> Other... -> Web Services ->
WebServiceClient

132
IT8711 FOSS and Cloud Computing Lab

t. Paste the URL that was copied earlier into the service definition field.

133
IT8711 FOSS and Cloud Computing Lab

u. Click on the Client project hyperlink and enter Axis2WSTestClient as the name
of the client project. Click OK.

Back on the Web Services Client wizard, make sure the Web service runtime is
set to Axis2 and the server is set correctly. Click Next.

134
IT8711 FOSS and Cloud Computing Lab

Next page is the Client Configuration Page. Accept the defaults and click Finish.

The Clients stubs will be generated to your Dynamic Web project Axis2WSTestClient.

Now we are going to write Java main program to invoke the client stub. Import the
ConverterClient.javafile to the workspace into the wtp package in the src folder
ofAxis2WSTestClient.

135
IT8711 FOSS and Cloud Computing Lab

Then select the ConverterClient file, right-click and select Run As -> Java
Application. Here's what you get on the server console:

Another way to test and invoke the service is to select Generate test case to test the
service check box on the Axis2 Client Web Service Configuration Page when going
through the Web Service Client wizard.

136
IT8711 FOSS and Cloud Computing Lab

If that option is selected, the Axis2 emitter will generate JUnittestcases matching the
WSDL we provide to the client. These JUnittestcases will be generated to a newly added
source directory to the Axis2WSTestClient project called test.

Next thing we need to do is to insert the test case with the valid inputs as the Web
service method arguments. In this case, let's test the
ConverterConverterSOAP11Port_httpTest.java by provide values for Celsius and
Farenheit for the temperature conversion. As an example, replace the generated
TODO statement in each test method to fill in

137
the data with values as: IT8711 FOSS and Cloud Computing Lab

testfarenheitToCelsius() -> farenheitToCelsius8.setFarenheit(212);


testStartfarenheitToCelsius() -
>farenheitToCelsius8.setFarenheit(212);
testcelsiusToFarenheit() ->celsiusToFarenheit10.setCelsius(100);
testStartcelsiusToFarenheit() ->
celsiusToFarenheit10.setCelsius(100);

Here the testcases were generated to test both the synchronous and
asynchronous clients.

v. After that, select the testcase, right-click, select Run As ->JUnit Test. You will be
able to run the unit test successfully invoking the Webservice.

138
IT8711 FOSS and Cloud Computing Lab

The Web Service wizard orchestrates the end-to-end generation, assembly, deployment,
installation and execution of the Web service and Web service client. Now that your Web
service is running, there are a few interesting things you can do with this WSDL file.
Examples:

 You can choose Web Services -> Test with WebServices


Explorer to test theservice.
 You can choose Web Services -> Publish WSDL file to publish
the service to a public UDDIregistry.

RESULT:

Thus the development of a new OGSA-compliant web service was executed successfully.

139

You might also like