Book Image

Amazon EC2 Cookbook

Book Image

Amazon EC2 Cookbook

Overview of this book

Discover how to perform a complete forensic investigation of large-scale Hadoop clusters using the same tools and techniques employed by forensic experts. This book begins by taking you through the process of forensic investigation and the pitfalls to avoid. It will walk you through Hadoop’s internals and architecture, and you will discover what types of information Hadoop stores and how to access that data. You will learn to identify Big Data evidence using techniques to survey a live system and interview witnesses. After setting up your own Hadoop system, you will collect evidence using techniques such as forensic imaging and application-based extractions. You will analyze Hadoop evidence using advanced tools and techniques to uncover events and statistical information. Finally, data visualization and evidence presentation techniques are covered to help you properly communicate your findings to any audience.
Table of Contents (15 chapters)
Amazon EC2 Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Grouping EC2 instances using placement groups


EC2 instances can be grouped using placement groups. For example, instances requiring low latency and high bandwidth communication can be placed in the same placement group. When instances are placed in this placement group, they have access to low latency, non-blocking 10 Gbps networking when communicating with other instances in the placement group (within a single availability zone). AWS recommends launching all the instances within the cluster placement group at the same time.

How to do it…

In order to group EC2 instances using placement groups, first we create a placement group, and then add our EC2 instances in it.

Creating a placement group

Run the following command to create placement groups. You have to provide the placement group name and the placement strategy.

$ aws ec2 create-placement-group 
--group-name [GroupName] 
--strategy [Strategy]

Here, the GroupName parameter specifies a name for the placement group and the Strategy parameter specifies the placement strategy.

Next, run the following command to create a placement group with the name WebServerGroup:

$ aws ec2 create-placement-group 
--group-name WebServerGroup 
--strategy cluster

Placing instances in the placement group

Run the following command to launch instances in a placement group. You will need to specify the placement group name along with the EC2 instance properties.

$ aws ec2 run-instances 
--image-id [ImageId] 
--count [Count]
--instance-type [InstanceType]
--key-name [KeyPairName]
--security-group-ids [SecurityGroupIds]
--subnet-id [SubnetId]
--placement [Placement]

The parameters used in this command are described as follows:

  • [ImageId]: This gives the ID of the image from which you want to create the EC2 instance

  • [Count]: This one provides the number of instances to create

  • [InstanceType]: This option gives the type of EC2 instance

  • [KeyPairName]: This parameter provides the key pair name for the authentication

  • [SecurityGroupIds]: This parameter gives one or more security group IDs

  • [SubnetId]: This option provides the ID of the subnet where you want to launch your instance

  • [Placement]: This gives the placement for the instance.

    Syntax:

    --placement AvailabilityZone=value,GroupName=value,Tenancy=value
    

Next, execute the following command to launch a c3.large EC2 instance in the WebServerGroup placement group:

$ aws ec2 run-instances 
--image-id ami-7e2c612c 
--count 1 
--instance-type c3.large 
--key-name WebServerKeyPair
--security-group-ids sg-ad70b8c8 
--subnet-id subnet-aed11acb 
--placement GroupName= WebServerGroup