Skip to main content

Posts

Showing posts from June, 2014

The Failover Process for Amazon RDS

In the event of a planned or unplanned outage of your DB instance, Amazon RDS automatically switches to a standby replica in another Availability Zone if you have enabled Multi-AZ. The automatic failover mechanism simply changes the DNS record of the DB instance to point to the standby DB instance. As a result, you will need to re-establish any existing connections to your DB instance. High availability does not mean that Amazon keeps, for example, two databases running in parallel; it is the data on disk that is replicated. If the primary DB instance becomes unavailable, a failover begins and the database software is started on the standby replica. The time it takes for the failover to complete depends on the database activity and other conditions at the time the primary DB instance became unavailable. When the failover is complete, it can take additional time for the RDS console UI to reflect the new Availability Zone. Amazon RDS handles

Few Advantages of VPC

Few Advantages of VPC multiple NICs per instance multiple IP's per NIC 'deny'-rules in security-groups DHCP options predictable internal IP ranges moving NICs and internal IPs between instances VPN

Points to remember prior to consider VPC as Design Choice

Before deciding to dive into VPC, you should be aware of some of the difficulties in that move. SSH to private subnet   The nodes in the private subnet are not internet addressable . That obviously means you can’t SSH into them without already being in the VPC network.  There are two options for this:   SSH into a node on the public subnet, then SSH into a private node, or  Set up a VPN in order to access all the nodes by their private addresses. We decided to deploy a VPN for ease of use. Elastic IPs for public addressability  Even if you launch a node in a public subnet, it will not get a public IP or hostname like EC2 .  The only way to make it publicly addressable is to assign an elastic IP to the node. Elastic IPs are free, of course, but you are limited to 5 per VPC, so plan accordingly. VPC to VPC communication is non-trivial   If you’re attempting to have one VPC communicate with nodes in another VPC, get ready to buckle up because its a bumpy ride. 

fstab entry

What is fstab file? fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The file is located under /etc , so the full path to this file is /etc/fstab. /etc/fstab contains information of where your partitions and storage devices should be mounted and how. If you can't access your Windows partition from Linux, aren't able to mount your CD or write to your floppy as a normal user, or have problems with your CD-RW, you probably have a misconfigured /etc/fstab file. So, you can usually fix your mounting problems by editing your fstab file. /etc/fstab is just a plain text file, so you can open and edit it with any text editor you're familiar with. However, note that you must have the root privileges before editing fstab. So, in order to edit the file, you must either log in as root or use the su command to become root.

Checkconfig - configure services start and stop automatically in the /etc/rd.d/init.d

The Chkconfig command tool allows to configure services start and stop automatically in the /etc/rd.d/init.d scripts through command line. Let’s see some examples. List All services # chkconfig --list acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off htcacheclean    0:off   1:off   2:off   3:off   4:off   5:off   6:off httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off Check specific services # chkconfig --list | grep httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off   Start Particular Service The command shows how to start HTTP services only on run level 3 and 5 with  ‘ –level ‘ parameter.    # chkconfig --level 35 httpd on -- starts httpd services on run level 3 and 5   # chkconfig --list | grep httpd --verifies the status of httpd services running on run level httpd 0:off 1:off 2:off 3:on 4:off 5

Create File system and Partition table to newly attached EBS volume

Create EBS volume on the same zone of EC2 instance created Attach the EBS volume to the EC2 instance # cat /proc/partitions major minor  #blocks  name  202        1    8388608 xvda1  202       80    1048576 xvdf  202       96    1048576 xvdg # lsblk NAME  MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvdf  202:80   0   1G  0 disk /mnt/my-data xvdg  202:96   0   1G  0 disk xvda1 202:1    0   8G  0 disk / # df -h Filesystem      Size  Used Avail Use% Mounted on /dev/xvda1       7.8G  1.1G  6.7G  14% / devtmpfs        282M   20K  282M   1% /dev tmpfs           297M     0  297M   0% /dev/shm /dev/xvdf      1008M   34M  924M   4% /mnt/my-data for xvdf  referenced in # lsblk output above # sudo mkdir /u02 -- Create directory # mkfs.ext3 /dev/xvdg   -- Create filesystem for /dev/xvdg # sudo mount /dev/xvdg /u02 -- mount newly created file system # df -h Filesystem      Size  Used Avail Use% Mounted on /dev/xvda1      7.8G  1.1G  6.7G  14% / devtmpfs        282M   20K  282M   1% /dev tmpfs      

To connect to the master node of EMR using PuTTY on Windows

Start PuTTY. Select Session in the Category list. Enter hadoop@DNS in the Host Name field. The input looks similar to hadoop@ec2-xxx.xxx.xxx.xxx.compute-1.amazonaws.com . In the Category list, expand Connection , expand SSH , and then select Auth . The Options controlling the SSH authentication pane appears. For Private key file for authentication , click Browse and select the private key file you generated earlier. If you are following this guide, the file name is mykeypair.ppk . Click Open . Note:  If you are asked to log in, enter hadoop .

Configure EMR - CLI

Download Ruby wget http://elasticmapreduce.s3.amazonaws.com/elastic-mapreduce-ruby.zip Check Ruby version ruby -v ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] Verify the RubyGems installation and version gem -v mkdir elastic-mapreduce-cli cd mkdir elastic-mapreduce-cli unzip elastic-mapreduce-ruby.zip  create your credentials file Create a file named  credentials.json   in the directory where you unzipped the Amazon EMR CLI. { "access_id": "Your AWS Access Key ID", "private_key": "Your AWS Secret Access Key", "key-pair": "Your key pair name", "key-pair-file": "The path and name of your PEM file", "log_uri": "A path to a bucket you own on Amazon S3, such as, s3n://mylog-uri/", "region": "The region of your cluster, either us-east-1, us-west-2, us-west-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2, or sa-east-1

How to Install telnet on Linux CLI instance

# yum install telnet Loaded plugins: priorities, update-motd, upgrade-helper amzn-main/latest                                                                                                                                          | 2.1 kB     00:00 amzn-updates/latest                                                                                                                                       | 2.3 kB     00:00 Resolving Dependencies --> Running transaction check ---> Package telnet.x86_64 1:0.17-47.7.amzn1 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================  Package                                Arch                                   Version                                           Repository                                 Size ==========================

Difference between root and IAM Admin user

http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SpecificProducts.html As far as I can tell, the only service that doesn't support IAM is Alexa Web Information Service. To use this service, you have to use the root user's account. In addition to this, some pages on your billing console can only be access by root account. IAM administrator will not have access to the following pages on your billing console: - Payment Methods - Consolidated Billing - Account Settings - Preferences - Devpay