<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>My AWS Musings &#187; RDS</title>
	<atom:link href="http://aws-musings.com/category/rds/feed/" rel="self" type="application/rss+xml" />
	<link>http://aws-musings.com</link>
	<description>Cloud computing, EC2, RDS, SQS, S3, Java...</description>
	<lastBuildDate>Mon, 30 May 2011 18:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Amazon AWS Java SDK released</title>
		<link>http://aws-musings.com/amazon-aws-java-sdk-released/</link>
		<comments>http://aws-musings.com/amazon-aws-java-sdk-released/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 01:25:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Autoscaling]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[RDS]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SNS]]></category>
		<category><![CDATA[SQS]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=252</guid>
		<description><![CDATA[Amazon recently announced the AWS SDK for java. SDK or a java api is very much needed &#8211; especially if you are writing your automation scripts in groovy. We have tried multiple java apis in our scripts including JetS3t and Typica. These apis were really helpful, but they only supported some of the AWS services [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon recently <a href="http://aws.amazon.com/about-aws/whats-new/2010/03/22/announcing-the-aws-sdk-for-java/">announced</a>  the AWS SDK for java. </p>
<p>SDK or a java api is very much needed &#8211; especially if you are writing your automation scripts in groovy. We have tried multiple java apis in our scripts including <a href="http://jets3t.s3.amazonaws.com/index.html">JetS3t</a>  and <a href="http://code.google.com/p/typica/">Typica</a>. These apis were really helpful, but they only supported some of the AWS services and were not up to date (for obvious reasons). Having one java api that can support all of AWS technologies was definitely the need of the hour. I am sure Amazon will keep it updated as new services are released. They have the necessary resources to do so.</p>
<p>Furthermore, Amazon has also uploaded the SDK to the <a href="http://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk/1.0.002">maven repository</a>.<br />
You can use the following dependency in your pom.xml:<br />
<code><br />
&lt;dependency><br />
    &nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId>com.amazonaws&lt;/groupId><br />
    &nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId>aws-java-sdk&lt;/artifactId><br />
    &nbsp;&nbsp;&nbsp;&nbsp;&lt;version&gt;1.0.002&lt;/version><br />
&lt;/dependency><br />
</code><br />
The java doc for the SDK is hosted at <a href="http://docs.amazonwebservices.com/AWSJavaSDK/latest/javadoc/index.html">http://docs.amazonwebservices.com/AWSJavaSDK/latest/javadoc/index.html</a></p>
<p>Amazon has also opened the SDK source code for all. They have mirrored the SDK code repository at github. You can look at the SDK code at <a href="http://github.com/amazonwebservices/aws-sdk-for-java">http://github.com/amazonwebservices/aws-sdk-for-java</a></p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/amazon-aws-java-sdk-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>7 easy tips to reduce your Amazon ec2 cloud costs</title>
		<link>http://aws-musings.com/7-easy-tips-to-reduce-your-amazon-ec2-cloud-costs/</link>
		<comments>http://aws-musings.com/7-easy-tips-to-reduce-your-amazon-ec2-cloud-costs/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 18:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Autoscaling]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[RDS]]></category>
		<category><![CDATA[cloud cost]]></category>
		<category><![CDATA[cloud money saving]]></category>
		<category><![CDATA[it cost]]></category>
		<category><![CDATA[reduce ec2 costs]]></category>
		<category><![CDATA[save ec2 money]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=177</guid>
		<description><![CDATA[Amazon ec2 costs can grow very fast if you are not mindful of the Amazon ec2 billing structure. We came across the following ways to save money at our company. Keep machines in the same availability zone Don&#8217;t scatter your machines that talk to each other across multiple availability zones. You will end up paying [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon ec2 costs can grow very fast if you are not mindful of the Amazon ec2 billing structure. We came across the following ways to save money at <a href="http://gumgum.com">our company</a>. </p>
<p><strong>Keep machines in the same availability zone</strong><br />
Don&#8217;t scatter your machines that talk to each other across multiple availability zones. You will end up paying for the bandwidth. Off course this does not apply to the people who purposely keep their machines in different availibilty zones to ensure high availibility.</p>
<p><strong>Use cnames instead of A records </strong><br />
In other words do not map your domain name to an elastic ip. Map it to the public domain name of the instance. Let&#8217;s say you have a machine with name splunk.gumgum.com. All the web servers (within the same availability zone) send considerable data to this machine. If you setup splunk.gumgum.com as an A record, your data will go out and come back in. But if you map it as cname, your data will always remain within the ec2 cluster. To read more about this visit <a href="http://alestic.com/2009/06/ec2-elastic-ip-internal">Eric Hammond&#8217;s Using Elastic IP to Identify Internal Instances on Amazon EC2</a> post.</p>
<p><span id="more-177"></span><br />
<strong>Use spot instances</strong><br />
Use spot instances whenever possible. Spot instances cost less than on demand instances. You can read more about<a href="http://aws.amazon.com/ec2/spot-instances/"> spot instances on Amazon&#8217;s web page</a>.  There is a website that shows <a href="http://www.spothistory.com/">spot history price graphs</a>. It  will tell you an average price of various types of instances. The average price of a m1.small sport instance is 3 cents an hour. You pay 8.5 cents an hour for the same type of on demand instance.</p>
<p><strong>Choose your instance types wisely</strong><br />
A smallest possible instance may not be the right choice to save money. For example c1.medium costs twice as much as m1.small. But it offers 5 times more compute power than m1.small. Thus in some compute heavy jobs it might be cheaper to use c1.medium instead of the least expensive m1.small.</p>
<p><strong>Choose the smallest possible storage</strong><br />
Choose the smallest possible EBS volumes and RDS instances. It is very easy to expand an ebs volume when needed. Same is the case with a RDS instance. Furthermore by choosing smaller drives, you will save money needed for the backup(snapshot) storage too.</p>
<p><strong>Use Autoscaling</strong><br />
<a href="http://aws.amazon.com/autoscaling/">Autoscaling</a>  can start additional instances when needed. It can shut down the additional instances when the need disappears. This is especailly useful for hosting websites/web services that have a specific traffic/usage pattern.</p>
<p><strong>Reserve your instances</strong><br />
You can reduce your costs significantly by reserving number of instances for a year or for three years. Reservation is only a billing concept and thus you don&#8217;t have to designate any istances as reserved. If you reserve 4 m1.small instances, Amazon will make 4 of your running m1.small instances as reserved. For more information <a href="http://www.allthingsdistributed.com/2009/03/amazon_ec2_reserved_instances.html">visit Werner Vogels&#8217;s (Amazon CTO) blog</a>.  </p>
<p>There might be numerous other ways you can save money. Please feel free to leave a comment to share your ways. The more the merrier!</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/7-easy-tips-to-reduce-your-amazon-ec2-cloud-costs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Amazon Relational Database Service (RDS) &#8211; The Timezone Problem</title>
		<link>http://aws-musings.com/amazon-relational-database-service-rds-the-timezone-problem/</link>
		<comments>http://aws-musings.com/amazon-relational-database-service-rds-the-timezone-problem/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 05:41:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EC2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[RDS]]></category>
		<category><![CDATA[mysql in cloud]]></category>
		<category><![CDATA[time zone]]></category>
		<category><![CDATA[timezone]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=155</guid>
		<description><![CDATA[The default time zone of your RDS database instance is UTC. It simply can not be changed. RDS does not give you super privileges. That is why you won&#8217;t be able to change the global time zone by simply executing: SET GLOBAL time_zone = 'US/Pacific'; The default_time_zone db parameter is not modifiable. In this Amazon [...]]]></description>
			<content:encoded><![CDATA[<p>The default time zone of your <a href="http://aws.amazon.com/rds/">RDS</a> database instance is UTC. It simply can not be changed. </p>
<p>RDS does not give you super privileges. That is why you won&#8217;t be able to change the global time zone by simply executing:<br />
<code><br />
SET GLOBAL time_zone = 'US/Pacific';<br />
</code><br />
<span id="more-155"></span><br />
The default_time_zone db parameter is not modifiable.</p>
<p>In <a href="http://developer.amazonwebservices.com/connect/thread.jspa?messageID=161339">this Amazon forum thread</a>, you can clearly see the AWS guy saying that there is no way to change the time zone of a RDS instance.</p>
<p>It is very important to understand that unlike Java (or other programming languages), MySQL does not store time zone in its date, datetime or timestamp datatypes. That is why it&#8217;s important that all the dates are stored in one time zone. Most people prefer to store them in their own time zone for easier calculations.</p>
<p>Since you cannot change the database server settings, you will have to change your application. Here are some approaches you can take to make sure that the date and time stored in your database is in your desired time zone.</p>
<p><strong>1) Set time zone per database connection </strong><br />
When ever you create a connection, set time zone using<br />
<code><br />
SET time_zone = 'US/Pacific';<br />
</code><br />
This time zone will be valid only for the connection. That is why it must be done for every single connection you open. If you have a java application, you can use a wrapper around the JDBC driver to accomplish this.</p>
<p>Please note that MySQL allows you to specify time zone by its name (such as &#8216;US/Pacific&#8217;) or by the difference in hours  (such as &#8216;-8:00&#8242;). If you are in a part of United States or any other part of the world that uses day light savings, do not use the difference of hours option for obvious reasons.</p>
<p>Named time zones can only be used if the time zone related tables are populated in MySQL. Thankfully they seem to be populated in RDS.</p>
<p><strong>2) Use convert_tz function</strong><br />
You can use MySQL&#8217;s convert_tz function to convert the time zone. For example:</p>
<p><code><br />
insert into my_table (created_date) values (convert_tz(now(), 'GMT', 'US/Pacific'));<br />
</code></p>
<p>For more information on convert_tz function visit  <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz">convert_tz documentation on MySQL website</a> </p>
<p><strong>3) Set the date/time pragmatically in your application code in every query. </strong><br />
Thus if you have created_date column in your table, do not rely on timestamp datatype&#8217;s default value. The default value will be in  UTC time zone. Set the value explicitly using application code. If you are using a prepared statement this becomes very easy. All you have to make sure is to pass a date object with appropriate time zone set in it. In order for your application to calculate correct date, you have to make sure that your application instance&#8217;s time zone is set to your time zone.</p>
<p>Amazon ec2 instances allow you to change their default time zones. If your web server is also deployed in ec2, I would suggest you to bundle an AMI with your time zone and use it to launch all your instances. I think most of the ubuntu public AMIs have time zone set to UTC.</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/amazon-relational-database-service-rds-the-timezone-problem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Database in cloud &#8211; Amazon RDS or MySQL on ebs?</title>
		<link>http://aws-musings.com/database-in-cloud-should-i-use-amazon-rds-or-mysql-installed-on-an-ebs-backed-ec2-instance/</link>
		<comments>http://aws-musings.com/database-in-cloud-should-i-use-amazon-rds-or-mysql-installed-on-an-ebs-backed-ec2-instance/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RDS]]></category>
		<category><![CDATA[cloud database]]></category>
		<category><![CDATA[ec2 database]]></category>
		<category><![CDATA[mysql in cloud]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=114</guid>
		<description><![CDATA[Recently Amazon launched RDS &#8211; Relational Database Service. Before Amazon offered this service, we had a MySQL configured on an ec2 instance. We needed one more database in cloud. Which way did we go? In this article, I have tried to compare both the options. RDS Pros: 1) No need to maintain MySQL in the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently Amazon launched <a href="http://aws.amazon.com/rds/">RDS &#8211; Relational Database Service</a>. Before Amazon offered this service, we had a MySQL configured on an ec2 instance. We needed one more database in cloud. Which way did we go? In this article, I have tried to compare both the options. </p>
<p><span id="more-114"></span><br />
<strong>RDS Pros:</strong><br />
1) No need to maintain MySQL in the cloud. Amazon will maintain it. Amazon will apply all the patches and upgrade the server software.</p>
<p>2) It&#8217;s very easy to scale up. All you have to do is execute <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2936">rds-modify-db-instance command</a>. You can change your db class to the bigger/better machine.</p>
<p>3) Snapshot based backups are very easy to manage.</p>
<p>4) No need to manage an ec2 volume, backup and an ec2 instance separately to run your database in the cloud. RDS combines all the three in one package.</p>
<p><strong>RDS Cons:</strong><br />
1) The biggest problem about RDS is the 4 hour per week maintenance window. I don&#8217;t believe that this maintenance takes place every week. They only take down your database when they are applying patches or upgrading the database server. They will take down your database in your specified time only. This time can be changed any time by simply executing an api call. I also believe that in most cases the downtime  will be much less than 4 hours. Nevertheless the threat of downtime exists every week!</p>
<p>2) Does not expose my.cnf file of the database. It instead gives you an <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2935">API to modify the parameters</a></p>
<p>3) If you are an advanced MySQL user and want to use tweaked MySQL (such as by Percona http://www.percona.com/), RDS is clearly not a solution.</p>
<p>4) As of now, there is no replication support. This means you cannot have any read only slaves. I have read somewhere that they are working on it. </p>
<p>Clearly RDS is not a silver bullet. In fact in many cases where your application cannot run without a database, you may not be able to afford the weekly downtime. I talked to some friends and the 4 hour weekly downtime was their the biggest problem with RDS.  I wish that Amazon would declare the downtime whenever the need arises (such as when new MySQL patches are ready) and less frequently (such as once a month).</p>
<p>We did not have a full time system administrator in our team. We were bunch of software engineers trying to manage our ec2 instances by ourselves. Furthermore our application wasn&#8217;t dependant on database completely. Most of the data was cached. Thus we could afford an occasional downtime. That is why we chose RDS.</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/database-in-cloud-should-i-use-amazon-rds-or-mysql-installed-on-an-ebs-backed-ec2-instance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ylastic &#8211; an amazing web based interface for aws</title>
		<link>http://aws-musings.com/ylastic-an-amazing-web-based-interface-for-aws/</link>
		<comments>http://aws-musings.com/ylastic-an-amazing-web-based-interface-for-aws/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 19:22:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[RDS]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SQS]]></category>
		<category><![CDATA[cloud interface]]></category>
		<category><![CDATA[cloud website]]></category>
		<category><![CDATA[ec2 interface]]></category>
		<category><![CDATA[ylastic]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=81</guid>
		<description><![CDATA[Let&#8217;s say you have 10 ec2 instances up and they do various different kinds of work. Some are web servers, some are queue servers, some are cache servers and a cluster with hadoop/hbase. Have you found it hard to remember which server is which? Wouldn&#8217;t it be cool if Amazon let us name our servers? [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have 10 ec2 instances up and they do various different kinds of work. Some are web servers, some are queue servers, some are cache servers and a cluster with <a href="http://hadoop.apache.org/">hadoop</a>/<a href="http://hadoop.apache.org/hbase">hbase</a>. Have you found it hard to remember which server is which? Wouldn&#8217;t it be cool if Amazon let us name our servers?</p>
<p>We have found a solution. <a href="http://ylastic.com">Ylastic</a> provides an amazing and inexpensive web based interface for various AWS services. It allows you to name your ec2 instances and remembers it. If you have an autoscaling setup it will automatically name your autoscaled instances when they start e.g. webserver001, webserver002 etc.</p>
<p><span id="more-81"></span><br />
Ylastic does much more than just naming the servers. It has a very user friendly user interface and also provides an iphone website from which you can start, stop instances etc. It also has a concept of locking an instance so that you don&#8217;t accidentally terminate it.<br />
<div id="attachment_84" class="wp-caption alignnone" style="width: 310px"><a href="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_inst.png"><img src="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_inst-300x102.png" alt="ylastic ec2 instances table" title="ylastic-instances-page" width="300" height="102" class="size-medium wp-image-84" /></a><p class="wp-caption-text">ylastic ec2 instances table</p></div></p>
<p>It has nice graphs for <a href="http://aws.amazon.com/cloudwatch">cloudwatch</a> data. </p>
<div id="attachment_87" class="wp-caption alignnone" style="width: 310px"><a href="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_cwatch.png"><img src="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_cwatch-300x266.png" alt="ylastic cloudwatch graphs" title="ylastic-cloudwatch" width="300" height="266" class="size-medium wp-image-87" /></a><p class="wp-caption-text">ylastic cloudwatch graphs</p></div>
<p>It supports most of the AWS services such as EC2, RDS, Auto scaling, S3, Simple DB.<br />
<div id="attachment_82" class="wp-caption alignnone" style="width: 310px"><a href="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_db.png"><img src="http://aws-musings.com/wp-content/uploads/2009/12/ysplash_db-300x255.png" alt="ylastic dashboard" title="ylastic-dashboard" width="300" height="255" class="size-medium wp-image-82" /></a><p class="wp-caption-text">ylastic dashboard</p></div></p>
<p>It also lets you schedule tasks such as taking a snapshot of your ebs volumes etc. It keep tabs on your instances by receiving alerts when the state of the launched instance changes. </p>
<p>Ylastic costs only $25 per month per Amazon account. It allows you to create multiple users for the same Amazon account. Furthermore <a href="http://ylastic.com">ylastic</a> guys are amazingly fast. Their customer service usually comes back with an answer within the first hour. We have hardly had any complaints though. Most of the times we have suggested new features and these people have implemented them in few days.</p>
<p>I totally recommend <a href="http://ylastic.com">ylastic</a>. We are very happy with it at <a href="http://bedrock.com">Bedrock</a>. It has made our life easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/ylastic-an-amazing-web-based-interface-for-aws/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Amazon RDS in 10 mins</title>
		<link>http://aws-musings.com/amazon-rds-in-10-mins/</link>
		<comments>http://aws-musings.com/amazon-rds-in-10-mins/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 19:49:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RDS]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud database]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql in cloud]]></category>
		<category><![CDATA[relational database service]]></category>
		<guid isPermaLink="false">http:/?p=1</guid>
		<description><![CDATA[Amazon&#8217;s Relational Database Service (RDS) offers hosted MySQL database in the cloud. In pre RDS era, you would have fired up an instance, installed MySQL yourself on it, configured an EBS volume so that the database data storage is persistent. You would have setup a cron to snapshot your EBS volume. But RDS saves the [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon&#8217;s Relational Database Service (RDS) offers hosted MySQL database in the cloud.</p>
<p>In pre RDS era, you would have fired up an instance, installed MySQL yourself on it, configured an EBS volume so that the database data storage is persistent. You would have setup a cron to snapshot your EBS volume. But RDS saves the headache of managing an EBS volume and your instance separately. It offers you installed MySQL with persistent storage. It also offers you automated database backup. And setting it up is as easy as 1,2,3&#8230;</p>
<p><span id="more-1"></span><br />
Here is what you do to setup a database using RDS:</p>
<p>1) Sign up for RDS by visiting http://aws.amazon.com/rds.</p>
<p>2) Install RDS tools on your local machine so that you can execute RDS setup commands. You can download the toolkit from the <a title="RDS CLI Download Page" href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2928&amp;categoryID=294" target="_blank">download page</a>.<br />
Installation of the client toolkit involves the following procedure:</p>
<p>a) Unzip the downloaded file into a suitable folder, say /home/vaibhav/software/rds-tools</p>
<p>b) Make sure that you have java 1.5 or up installed on your machine and  JAVA_HOME variable is set. If not <a title="Install latest version of java" href="http://java.com/en/download/help/5000010500.xml" target="_blank">install the latest version of java</a> and <a title="How to set JAVA_HOME?" href="http://www.ehow.com/how_5120825_change-java-home.html" target="_blank">set JAVA_HOME</a> to the folder where java is installed.</p>
<p>c) Set AWS_RDS_HOME=/home/vaibhav/software/rds-tools in your .bashrc or execute the following command to  set AWS_RDS_HOME for this session</p>
<p><code>export AWS_RDS_HOME=/home/vaibhav/software/rds-tools</code></p>
<p>d)Add AWS_RDS_HOME to your path by executing <code>export PATH=$PATH:$AWS_RDS_HOME/bin</code></p>
<p>e) Rename credential-file-path.template in AWS_RDS_HOME (/home/vaibhav/software/rds-tools) to any name of your choice say credentials.txt. Set AWS_CREDENTIAS_FILE variable by executing</p>
<p><code>export AWS_CREDENTIAL_FILE=&lt;the path of the file created above - credentials.txt</code></p>
<p>3) Now let&#8217;s create a security group before creating a database instance. This is because we would like to supply this security group while creating an instance. A security group can be created by executing</p>
<p><code>rds-create-db-security-group --db-security-group-name database  --db-security-group-description 'Default mysql database security group'</code></p>
<p>This will create a security group called database. If you want to connect to the mysql server from your local machine, you will need to add authorization to this group by executing</p>
<p><code>rds-authorize-db-security-group-ingress --db-security-group-name database -i 71.168.56.100/32</code></p>
<p>Here 71.168.56.100/32 is the ip address range of the network from which you want to access the database and 123456789012 is your Amazon AWS account number</p>
<p>4) Now create the database instance. The database instance can be created by executing the following command:<br />
<code><br />
rds-create-db-instance --db-instance-identifier reporting --allocated-storage 5 --db-instance-class db.m1.small --engine MySQL5.1 --master-username master --master-user-password s0mePassw0rd --db-name MyFirstDb --availability-zone us-east-1a  --preferred-maintenance-window  Sun:12:00-Sun:16:00   --preferred-backup-window  10:00-12:00 --db-security-groups database --headers<br />
</code></p>
<p>There are few parameters that you need to understand very well before executing this command. The preferred-maintenance-window is the 4 hour time period Amazon requires to apply patches and to carry out other maintenance tasks on the database server.  preferred-backup-window  is the daily two hour window in which your database will be backed up. The database won&#8217;t be down in the period, but its performance could get affected because of the backup operation. Please note that both the time periods must be specified in UTC time. If you are going to access this database from an Amazon ec2 instance then choose an availability zone that is the same as the web server so that you are not charged for the bandwidth. You should change other parameters such as the database instance type, allocated storage as per your requirement. More information on these parameters can be obtained from the <a title="CLI Reference" href="http://docs.amazonwebservices.com/AmazonRDS/latest/CommandLineReference/" target="_blank">CLI reference page</a>. The instance name will be <em>reporting</em> as specified. To find out its address, you can simply execute</p>
<p><code> rds-describe-db-instances</code></p>
<p>This command will list all the db instances with their dns names. The dns name will be something like reporting.crly0gpnhroz.us-east-1.rds.amazonaws.com. The port will also be in the output (3306). You can use this dns name and port to connect to the database using any mysql client.</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/amazon-rds-in-10-mins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

