Sei sulla pagina 1di 20

M.Sc. I.T.

Semester II

Cloud and
Ubiquitous
Computing

Teachers Reference Manual


2013-2014

Cloud and Ubiquitous Computing


Practical List
Sr.No
1.
2.
3.
4.
5.
6.
7.

Name
Implement Windows / Linux Cluster
Implement VMWAre ESXi Server.
Developing application for Windows Azure.
Implementing VMs on Xen Server.
Implement Hadoop
Implementing IaaS with Eucalyptus.

Using OpenNebula to manage heterogeneous


distributed data center infrastructures.
8. Using Amazon EC2
9. Native Virtualization using Hyper V.
10. Develop application using GAE

Practical No 1: Implement Windows / Linux Cluster


Creating a Failover Cluster using Failover
Cluster Manager
1. Open Failover Cluster Manager - it can be opened from Server
Manager using the Tools menu:

2. In the Failover Cluster Manager, choose the Create Cluster


action, which can be found in 3 places:

3. The Create Cluster Wizard initializes. Review the information on the


Before You Begin screen. Click Next

4. Enter the names of all the servers that will be part of the cluster. Note:
More that none node can be specified at a time using comma separation.
Example: MyServer1, MyServer2, MyServer3
5. If the nodes specified have not been validated, the following page in
the wizard will be shown. Its highly recommended to validate the
configuration before you create the cluster. This will help ensure that the
servers are connected and configured correctly and that it can be
supported by Microsoft:

6. In the Cluster Name field, provide a NetBIOS name to be used as the


cluster name. This cluster name is also the name that can be used to
connect to the cluster to manage it. During cluster creation, a computer
object will also be created in the Active Directory domain and
Organizational Unit where the cluster nodes computer objects are located.
If the servers have no NICs configured for DHCP, then this page will also
prompt for a static IP address. If any of the networks are configured for
DHCP, then this will not be shown and an IPv4 DHCP assigned address will
be used. Click Next:
Note: If you do not want the Active Directory object for the cluster to be
placed in the same Organizational Unit (OU) as the servers, the specific

OU can be designated by specifying the full distinguished name like


screen shot below:

Review the Confirmation screen. If all eligible storage will be added to


the cluster, check the box Add all eligible storage to the cluster.
Click Next
Note: This ability to choose whether all eligible storage will be added to
the cluster or not is new for Windows Server 2012. In previous versions all
storage would always be added to the cluster. If you choose not to add all
eligible storage to the cluster, you can add specific disks after the cluster

is created:

7. The cluster should be successfully created. Review the Summary


report if desired. Click Finish
8. A Failover Cluster Manager will automatically connect to the cluster
when the wizard finishes:

Creating a Failover Cluster using


PowerShell
An alternate way to create a Failover Cluster is to use PowerShell. This
can be accomplished with the New-Cluster PowerShell cmdlet. The
following command creates 2-Node cluster (Contoso-FC1) and it assumes
that a DHCP assigned address can be assigned and all eligible storage is
added.

New-Cluster -Name Contoso-FC1 -Node Contoso-N1,Contoso-N2


Power
Shell:

The following command is an example of specifying a static IP address for


cluster to use for its management connection, and if you dont want any
storage to be automatically added to the cluster.

New-Cluster -Name Contoso-FC1 -Node Contoso-N1,Contoso-N2


Power StaticAddress 10.0.0.14 -NoStorage
Shell:

The following command is an example that would put the cluster account
put into an existing Active Directory OU called Clusters that is in the
Contoso.local domain.

New-Cluster -Name CN=ContosoPower FC1,OU=Clusters,DC=Contoso,DC=local -Node Contoso-N1,ContosoN2


Shell:

Practical No 3: Develop Applications for Windows Azure


Practical No 5: Develop MapReduce Applications in Hadoop
Installing the Hortonworks Data Platform 2.0 for Windows is straightforward. Lets take a
look at how to install a one node cluster on your Windows Server 2012 R2 machine.
To start, download the HDP 2.0 for Windows package. The package is under 1 GB, and will
take a few moments to download depending on your internet speed. Documentation for
installing a single node instance is located here. This blog post will guide you through that
instruction set to get you going with HDP 2.0 for Windows!
Heres an outline of the process youll work through to deploy:

Install the prerequisites

Deploy HDP on your single node machine

Start the services

Run smoke tests to validate the install

Install the Pre-requisites

Youll now install Java, Python, and MSFT C++ run time. Windows Server 2012 already has
the up to date .NET runtime, so you can skip that step.
Lets download the C++ run time, and install that by double clicking the downloaded MSI.
Download Python 2.7.x, and double click the downloaded MSI to install the package.
Once youve installed, youll need to ensure HDP can find Python by updating the PATH
System Environment variable.
Go to Computer > Properties > Advanced System Settings > Environment variables.
Then append the install path to Python, for example C:\Python27, to this path after a ;:

Verify your path is setup by entering a new Powershell or Command Prompt and typing:
python, which should run the python interpreter. Type quit() to exit.
Setup Java, which you can get here. You will also need to setup JAVA_HOME, which
Hadoop requires. Make sure to install Java to somewhere without a space in the path
Program Files will not work!
To setup JAVA_HOME, in Explorer > right click Computer > Properties > Advanced
System Settings > Environment variables. Then setup a new System variable called
JAVA_HOME that points to your Java install (in this case, C:\java\jdk1.6.0_31).

Install the MSI package

Now we have all the pre-requisites installed. The next step is to install the HDP 2.0 for
Windows package.
Extract the MSI from the zip package you downloaded earlier. Open a Powershell prompt in
Administrator (Run as Administrator) mode, and execute the MSI through this command:
> msiexec /i "hdp-2.0.6.0.winpkg.msi"
The HDP Setup window appears pre-populated with the host name of the server, as well as
default installation parameters. Now, complete the form with your parameters:

Set the Hadoop User Password. This enables you to log in as the
administrative user and perform administrative actions. This must match
your local Windows Server password requirements. We recommend a
strong pasword. Note the password you set well use this later.

Check Delete Existing HDP Data. This ensures that HDFS will be
formatted and ready to use after you install.

Check Install HDP Additional Components. Select this check box to


install Zookeeper, Flume, and HBase as HDP services deployed to the
single node server.

Set the Hive and Oozie database credentials. Set hive for all Hive
Metastore entries, and oozie for all Oozie Metastore entries.

Select DERBY, and not MSSQL, as the DB Flavor in the dropdown


selection. This will setup HDP to use an embedded Derby database,
which is ideal for the evaluation single node scenario.

When you have finished setting the installation parameters, click Install to install HDP.

The HDP Setup window will close, and a progress indicator will be displayed while the
installer is running. The installation will take a few minutes disregard the progress bar
expected time display.
The MSI installer window will display an info prompt when the installation is finished and
successful.

Start the services and run a jobs

Once the install is successful, you will start the HDP services on the single node.
Open a command prompt, and navigate to the HDP install directory. By default, the location
is C:\hdp, unless you set a different location:
> cd C:\hdp
> start_local_hdp_services
Validate the install by running the full suite of smoke tests. Its easiest to run the smoke tests
as the HDP super user: hadoop.
In a command prompt, switch to using the hadoop user:
> runas /user:hadoop cmd
When prompted, enter the password you had set up during install.
Run the provided smoke tests as the hadoop user to verify that the HDP 2.0 services work as
expected:
> cd C:\hdp
> Run-SmokeTests hadoop
This will fire up a Mapreduce job on your freshly set up cluster. If it fails the first time, try
running it again with the same command Run-SmokeTests hadoop.

Practical No 10: Develop Applications using Google AppEngine


What Is Google App Engine?
Google App Engine lets you run your web applications on Google's infrastructure. App
Engine applications are easy to build, 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 http://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 languageor 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 Python standard library. The Java and Python runtime environments are
built to ensure that your application runs quickly, securely, and without interference with
other apps on the system.
With App Engine, 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 in
gigabyte, and billed at competitive rates. You control the maximum amount 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, 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.

Requirements:

Download and Install Eclipse IDE


Configure Google Plug-in for Eclipse
Validate the Configuration

1. Download the latest update site archive for Eclipse 4.3.


2. Unzip the archive.
3. In Eclipse, choose Help > Install New Software...
4. In the "Work with" section, click the Add... button. The "Add Repository" dialog box
appears.
5. Click Local and select the directory you unzipped, then click OK. Its path appears in the
"Location" field. Leave the "Name" field empty.
6. Follow the steps below:
a. Select the software components you want (typically the Google Plugin for Eclipse
and the Google App Engine SDK).

b. Click Next to review the list of items to be installed, click Next again to read and
accept the license agreements, then click Finish. Eclipse will then install any
external dependencies, and add the chosen components to the Eclipse installation.
c. When asked, restart Eclipse.
The plugin should now be installed!
Simple Hello World Application:
1. Select the File menu > New > Web Application Project (If you do not see
this menu option, select the Window menu > Reset Perspective..., click
OK, then try the File menu again.) Alternatively, click the New Web
Application Project button on the toolbar.

Click 'Next'

Note: Unselect 'Use Google Web Toolkit' option.


The "Create a Web Application Project" wizard opens. For "Project name," enter a
name for your project, such as 'CodeLabEx0'. For "Package," enter an appropriate
package name, such as com.google.appengine.codelab.

And the project file structure would look like


CodeLabEx0/
src/
com.google.appengine.codelab/
CodeLabEx0Servlet.java
META-INF/
jdoconfig.xml
log4j.properties
logging.properties
war/
WEB-INF/
lib/
...App Engine JARs...
appengine-web.xml
web.xml
index.html

Run the application

Open a browser instance and type 'http://localhost:8888/' to launch application


deployed.

Click on Servlet link to launch application UI (run.html content).

Uploading Your Application


You create and manage applications in App Engine using the Administration Console. Once
you have registered an application ID for your application, you upload it to App Engine using
either the Eclipse plugin, or a command-line tool in the SDK.
Note: Once you register an application ID, you can delete it, but you can't re-register that
same application ID after it has been deleted. You can skip these next steps if you don't want
to register an ID at this time.
Registering the Application
You create and manage App Engine web applications from the App Engine Administration
Console, at the following URL:
https://appengine.google.com/
Sign in to App Engine using your Google account. If you do not have a Google account, you
can create a Google account with an email address and password.
Note: You may have already created a project using the Google Cloud Console. If this is the
case, you do not have to create a new application. Your project has a title and an id. In the
instructions that follow, the project title and id can be used wherever an application title and
id are mentioned. They are the same thing.
To create a new application, click the "Create an Application" button. Follow the instructions
to register an application ID, a name unique to this application.
Edit the appengine-web.xml file, then change the value of the <application> element to be
your registered application ID.

For this tutorial, you should probably elect to use the free appspot.com domain name, and so
the full URL for the application will be http://your_app_id.appspot.com/. You can also
purchase a top-level domain name for your app, or use one that you have already registered.
For Authentication Options (Advanced), the default option, "Open to all Google Accounts
users", is the simplest choice for this tutorial. If you choose "Restricted to the following
Google Apps domain", then your domain administrator must add your new app as a service
on that domain. If you choose the Google Apps domain authentication option, then failure to
add your app to your Google Apps domain will result in an HTTP 500 where the stack trace
shows the error "Unexpected exception from servlet: java.lang.IllegalArgumentException:
The requested URL was not allowed: /guestbook.jsp". If you see this error, add the app to
your domain. See Configuring Google Apps to Authenticate on Appspot for instructions.
If you have an App Engine Premier account, you can specify that your new application
should reside in the European Union rather than the United States. This is especially useful if
your application's users are closer to Europe than to the United States. There is less network
latency and the End User Content will be stored at rest in the European Union. You must
specify this location when you register the application; you cannot change it later. Click the
Edit link in the Location Options section; select a location option, either United States or
European Union.

Uploading the Application


You can upload your application using Eclipse, or using a command at the command prompt.
Uploading From Eclipse

You can upload your application code and files from within Eclipse using the Google Plugin.
To upload your application from Eclipse, click on the Google button
toolbar, then select "Deploy to App Engine."

in the Eclipse

If prompted, follow the instructions to provide the Application ID from the App Engine
console that you would like to use for this app, your Google account username (your email
address), and your password. Then click the Deploy button. Eclipse will then automatically
upload the contents of the war/ directory.
Uploading Using the Command Prompt

You can upload your application code and files using a command included in the SDK named
appcfg.cmd (Windows) or appcfg.sh (Mac OS X, Linux).
AppCfg is a multi-purpose tool for interacting with your app on App Engine. The command
takes the name of an action, the path to your app's war/ directory, and other options. To
upload the app code and files to App Engine, you use the update action.

To upload the app, using Windows:


..\appengine-java-sdk\bin\appcfg.cmd update war

To upload the app, using Mac OS X or Linux:


../appengine-java-sdk/bin/appcfg.sh update war

Enter your Google username and password at the prompts.


Checking Your Application State

After your application is uploaded, its Datastore Indexes will be automatically generated.
This operation may take some time, and any visitors to your site will receive a
DatastoreNeedIndexException until the indexes have been built. You can monitor the
progress of the operation by visiting the App Engine console, selecting your application, and
then selecting the Datastore Indexes link.
Accessing Your Application

You can now see your application running on App Engine. If you set up a free appspot.com
domain name, the URL for your website begins with your application ID:
http://your_app_id.appspot.com/

Potrebbero piacerti anche