Cloud Computing Unit 5
Cloud Computing Unit 5
Microsoft: Azure Services Platform, Windows live, Exchange Online, Share Point
Services, Microsoft Dynamics CRM (Text Book 2).
Figure 11.2 displays the Amazon Management Console (AMC) window listing the
Amazon Web Services offered at the time of this writing.
The services are grouped into several categories: computing and networking,
storage and content delivery, deployment and management, databases, and
application services.
In spite of the wealth of information available from the providers of cloud services,
the learning curve of an application developer is still relatively steep.
To access AWS one must first create an account at http://aws.amazon.com/.
Once the account is created, the AMC allows the user to select one of the services,
e.g., EC2, and then start an instance.
Recall that an AWS EC2 instance is a virtual server started in a region and the
availability zone is selected by the user.
1
Instances are grouped into a few classes, and each class has available to it a
specific amount of resources, such as: CPU cycles, main memory, secondary
storage, and communication and I/O bandwidth.
Several operating systems are supported by AWS, including
o Amazon Linux
o Red Hat Enterprise Linux, 6.3
o SUSE Linux Enterprise Server 11
o Ubuntu Server 12.04.1
o Several versions of Microsoft Windows.
The next step is to create an (AMI) on one of the platforms supported by AWS and
start an instance using the RunInstance API.
If the application needs more than 20 instances, a special form must be filled out.
The local instance store persists only for the duration of an instance; the data will
persist if an instance is started using the Amazon Elastic Block Storage (EBS) and
then the instance can be restarted at a later time.
Once an instance is created, the user can perform several actions – for example,
connect to the instance, launch more instances identical to the current one, or
create an EBS AMI.
The user can also
o Terminate
o Reboot, or
o Stop the instance
The Network & Security panel allows the creation of Security Groups, Elastic IP
addresses, Placement Groups, Load Balancers, and Key Pairs, whereas the EBS
panel allows the specification of volumes and the creation of snapshots.
A firewall is a software system based on a set of rules for filtering network traffic.
Its function is to protect a computer in a local area network from unauthorized
access.
The first generation of firewalls,
2
o Deployed in the late 1980s, carried out packet filtering; they discarded
individual packets that did not match a set of acceptance rules.
o Such firewalls operated below the transport layer and discarded packets
based on the information in the headers of physical, data link, and transport
layer protocols.
The second generation of firewalls,
o Operate at the transport layer and maintain the state of all connections
passing through them.
o Unfortunately, this traffic-filtering solution opened the possibility of
denial-of-service (DoS) attacks.
o A DoS attack targets a widely used network service and forces the
operating system of the host to fill the connection tables with illegitimate
entries.
o DoS attacks prevent legitimate access to the service.
The third generation of firewalls,
o “understand” widely used application layer protocols such as FTP, HTTP,
TELNET, SSH, and DNS.
o These firewalls examine the header of application layer protocols and
support Intrusion Detection Systems (IDSs).
Firewalls screen incoming traffic and sometimes filter outgoing traffic as well.
A first filter encountered by the incoming traffic in a typical network is a firewall
provided by the operating system of the router; the second filter is a firewall
provided by the operating system running on the local computer.
Typically, the Local Area Network (LAN) of an organization is connected to the
Internet via a router.
A router firewall often hides the true address of hosts in the local network using the
Network Address Translation (NAT) mechanism. The hosts behind a firewall are
assigned addresses in a “private address range,” and the router uses the NAT tables
to filter the incoming traffic and translate external IP addresses to private ones.
3
1. From the AWS Management Console, select EC2 and, once signed in, go to
Launch Instance Tab.
2. To determine the processor architecture when you want to match the
instance with the hardware, enter the command
uname –m
and choose an appropriate Amazon Linux AMI by pressing Select.
3. Choose Instance Details to control the number, size, and other settings for
instances.
4. To learn how the system works, press Continue to select the default
settings.
5. Define the instance’s security, as discussed in Section 11.3: In the Create
Key Pair page enter a name for the pair and then press Create and
Download Key Pair.
6. The key-pair file downloaded in the previous step is a .pem file, and it must
be hidden to prevent unauthorized access. If the file is in the directory
awcdir/dada.pem enter the commands
cd awcdir
chmod 400 dada.pem
7. Configure the firewall. Go to the page Configure firewall, select the option
Create a New Security Group, and provide a Group Name. Normally we
use ssh to communicate with the instance; the default port for
communication is port 8080, and we can change the port and other rules by
creating a new rule.
8. Press Continue and examine the review page, which gives a summary of
the instance.
9. Press Launch and examine the confirmation page, then press Close to end
the examination of the confirmation page.
10. Press the Instances tab on the navigation panel to view the instance.
11. Look for your Public DNS name. Because by default some details of the
instance are hidden, click on the Show/Hide tab on the top of the console
and select Public DNS.
12. Record the Public DNS as PublicDNSname; it is needed to connect to the
instance from the Linux terminal.
4
13. Use the ElasticIP panel to assign an Elastic IP address if a permanent IP
address is required.
Connect to the instance using ssh and the TCP transport protocol.
1. Add a rule to the iptables to allow ssh traffic using the TCP protocol. Without
this step, either an access denied or permission denied error message appears
when you’re trying to connect to the instance.
sudo iptables -A iptables -p -tcp -dport ssh -j ACCEPT
2. Enter the Linux command:
ssh -i abc.pem ec2-user@PublicDNSname
If you get the prompt You want to continue connecting? respond Yes. A
warning that
the DNS name was added to the list of known hosts will appear.
3. An icon of the Amazon Linux AMI will be displayed.
5
Create an S3 client. S3 access is handled by the class AmazonS3Client instantiated
with the account credentials of the AWS user:
AmazonS3Client s3 = new AmazonS3Client(
new BasicAWSCredentials("your_access_key",
"your_secret_key"));
The access and the secret keys can be found on the user’s AWS account homepage.
6
The InputStream can be accessed using Scanner, BufferedReader, or any other
supported method. Amazon recommends closing the stream as early as possible,
since the content is not buffered and it is streamed directly from the S3. An open
InputStream means an open connection to S3. For example, the following code will
read an entire object and print the contents to the screen:
AmazonS3Client s3 = new AmazonS3Client(
new BasicAWSCredentials("access_key", "secret_key"));
InputStream input = s3.getObject("bucket_name", "key")
.getObjectContent();
Scanner in = new Scanner(input);
while (in.hasNextLine())
{
System.out.println(in.nextLine());
}
in.close();
input.close();
Batch upload/download. Batch upload requires repeated calls of s3.putObject()
while iterating over local files.
To view the keys of all objects in a specific bucket, use
ObjectListing listing = s3.listObjects("bucket_name");
ObjectListing supports several useful methods, including getObjectSummaries().
S3ObjectSummary encapsulates most of an S3 object properties (excluding the
actual data), including the key to access the object directly,
List<S3ObjectSummary> summaries =
listing.getObjectSummaries();
7
applications, and other event-driven applications that require a simple and efficient
mechanism for message delivery.
SNS “pushes” messages to clients rather than requiring a user to periodically poll a
mailbox or another site for messages.
SNS is based on the publish/subscribe paradigm; it allows a user to define the
topics, the transport protocol used (HTTP/HTTPS, email, SMS, SQS), and the
endpoint (URL, email address, phone number, SQS queue) for notifications to be
delivered. It supports the following actions:
Add/Remove Permission.
Confirm Subscription.
Create/Delete Topic.
Get/Set Topic Attributes.
List Subscriptions/Topics/Subscriptions by Topic.
Publish/Subscribe/Unsubscribe.
To install the SNS client the following steps must be taken:
1. Install Java in the root directory and then execute the commands:
deb http://archive.canonical.com/lucidpartner
update
install sun-java6-jdk
Then change the default Java settings:
update-alternatives -config java
2. Download the SNS client, unzip the file, and change permissions:
wget http://sns-public-resources.s3.amazonaws.com/
SimpleNotificationServiceCli-2010-03-31.zip
chmod 775 /root/ SimpleNotificationServiceCli-1.0.2.3/bin
3. Start the AWS Management Console and go to Security Credentials. Check
the Access Key ID and the Secret Access Key and create a text file
/root/credential.txt with the following content:
AWSAccessKeyId= your_Access_Key_ID
AWSSecretKey= your_Secret_Access_Key
4. Edit the .bashrc file and add:
export AWS_SNS_HOME=˜/SimpleNotificationServiceCli-1.0.2.3/
export AWS_CREDENTIAL_FILE=$HOME/credential.txt
8
export PATH=$AWS_SNS_HOME/bin
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
5. Reboot the system.
6. Enter on the command line:
sns.cmd
If the installation was successful, the list of SNS commands will be displayed.
9
Computer -> System Properties -> Advanced System Settings ->
Environment Variables
Click on the variable named Path and press Edit; append the
following value to the path variable:
;c:\cygwin\bin;c:\cygwin\usr\bin
3. Configure the ssh daemon using cygwin. Left-click on the cygwin icon on
the desktop and click “Run as Administrator.” Type in the command
window of cygwin:
ssh-host-config.
10
connect. Answer Yes and press Enter. You should see the cygwin prompt
again, which means that you have successfully connected.
13. Now execute again the command:
ssh localhost
This time no prompt should appear.
Download Hadoop
• Download Hadoop 0.20.1 and place it in a directory such as:
C:Java
• Open the cygwin command prompt and execute:
cd
• Enable the home directory folder to be shown in the Windows Explorer
window:
Explorer
• Open another Windows Explorer window and navigate to the folder that
contains the downloaded
Hadoop archive.
• Copy the Hadoop archive into the home directory folder.
Unpack Hadoop
• Open a new cygwin window and execute:
tar -xzf hadoop-0.20.1.tar.gz
• List the contents of the home directory:
ls -l
• You should see a newly created directory called Hadoop-0.20.1. Execute:
cd hadoop-0.20.1
ls -l
Cloud-Based Simulation of A Distributed Trust Algorithm
12
A Cloud Service for Adaptive Data Streaming
Data streaming is the name given to the transfer of data at a high rate with real-
time constraints.
Multimedia applications such as music and video streaming, high-definition
television (HDTV), scientific applications that process a continuous stream of data
collected by sensors, the continuous backup copying to a storage medium of the
data flow within a computer, and many other applications require the transfer of
real-time data at a high rate.
For example, to support real-time human perception of the data, multimedia
applications have to make sure that enough data is being continuously received
without any noticeable time lag.
Concerned with the case when data streaming involves a multimedia application
connected to a service running on a computer cloud.
The stream could originate from the cloud, as is the case of the iCloud service
provided by Apple, or could be directed toward the cloud, as in the case of a real-
time data collection and analysis system.
Data streaming involves three entities: the sender, a communication network, and a
receiver.
The resources necessary to guarantee the timing constraints include CPU cycles
and buffer space at the sender and the receiver, as well as network bandwidth.
Adaptive data streaming determines the data rate based on the available resources.
Lower data rates imply lower quality, but they reduce the demands for system
resources.
Adaptive data streaming is possible only if the application permits tradeoffs
between quantity and quality.
Such tradeoffs are feasible for audio and video streaming, which allow lossy
compression, but are not acceptable for many applications that process a
continuous stream of data collected by sensors.
13
Data streaming requires accurate information about all resources involved, and this
implies that the network bandwidth has to be constantly monitored; at the same
time, the scheduling algorithms should be coordinated with memory management
to guarantee the timing constraints.
Adaptive data streaming poses additional constraints because the data flow is
dynamic.
Indeed, once we detect that the network cannot accommodate the data rate required
by an audio or video stream, we have to reduce the data rate; thus, to convert to a
lower quality audio or video.
Data conversion can be done on the fly and, in this case, the data flow on the cloud
has to be changed.
14
from one user to one million by taking advantage of Bigtable and
other components of Google’s scalable infrastructure.
• Easily integrate with other Google services It’s unnecessary and
inefficient for developers to write components like authentication
and email from scratch for each new application. Developers using
Google App Engine can make use of built-in components and
Google’s broader library of APIs that provide plug-and-play
functionality for simple but important features.
Cost
Google enticed developers by offering the App Engine for free, when it
launched, but after a few months slapped on some fees.
Google App Engine is available at http://code.google.com/
appengine/.
15
Accomplishes this by performing deep inlining, better dead-code elimination, and
other forms of enhanced static analysis.
Google Web Toolkit also continues to provide a rich and growing set of libraries
that help developers build world-class AJAX, including thoroughly tested, reusable
libraries for implementing user interfaces, data structures, client/server
communication, internationalization, testing, and accessibility. More information
about Google Web Toolkit is available at http://code.google.com/webtoolkit/.
16