<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ec2 on Evan Hoffman</title><link>https://evan.wtf/tags/ec2/</link><description>Recent content in Ec2 on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Wed, 29 Oct 2014 14:11:40 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/ec2/index.xml" rel="self" type="application/rss+xml"/><item><title>How (the hell) do you set up Splunk Cloud on Linux?</title><link>https://evan.wtf/2014/10/29/how-the-hell-do-you-set-up-splunk-cloud-on-linux/</link><pubDate>Wed, 29 Oct 2014 14:11:40 +0000</pubDate><guid>https://evan.wtf/2014/10/29/how-the-hell-do-you-set-up-splunk-cloud-on-linux/</guid><description>&lt;p&gt;This took me way longer than I would&amp;rsquo;ve thought, mostly due to horrible documentation. Here&amp;rsquo;s my TL;DR version:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Sign up for &lt;a href="http://www.splunk.com/getsplunk/cloudtrial"&gt;Splunk Cloud&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;Download and install the forwarder binary from &lt;a href="http://www.splunk.com/download/universalforwarder"&gt;here&lt;/a&gt;.- Log in &lt;a href="https://www.splunk.com/page/cloudtrial_status"&gt;here&lt;/a&gt; and note the URL of your Splunk instance:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;&lt;a href="https://evan.wtf/wp-content/uploads/2014/10/splunk_cloud.png"&gt;&lt;img src="https://evan.wtf/wp-content/uploads/2014/10/splunk_cloud.png" alt="splunk_cloud"&gt;&lt;/a&gt;&#10;In the above picture, assume the URL is &lt;strong&gt;&lt;a href="https://prd-p-jxxxxxxxx.splunk6.splunktrial.com"&gt;https://prd-p-jxxxxxxxx.splunk6.splunktrial.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Make sure your instances can connect to port tcp/9997 on your input host. Your input host is the hostname from above with &amp;ldquo;input-&amp;rdquo; prepended to it. So in our example, the input host is &lt;strong&gt;input-prd-p-jxxxxxxxx.splunk6.splunktrial.com&lt;/strong&gt;. To ensure you can connect, try &lt;code&gt;telnet input-prd-p-jxxxxxxxx.splunk6.splunktrial.com 9997&lt;/code&gt;. If it can&amp;rsquo;t connect you may need to adjust your firewall rules / Security groups to allow outbound tcp/9997&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Below are the actual commands I used to get data into our Splunk Cloud trial instance:&lt;/p&gt;</description></item><item><title>Can I create an EC2 MySQL slave to an RDS master?</title><link>https://evan.wtf/2014/10/08/can-i-create-an-ec2-mysql-slave-to-an-rds-master/</link><pubDate>Wed, 08 Oct 2014 15:25:10 +0000</pubDate><guid>https://evan.wtf/2014/10/08/can-i-create-an-ec2-mysql-slave-to-an-rds-master/</guid><description>&lt;h2 id="no"&gt;No.&lt;a class="heading-anchor" href="#no" aria-label="Link to this section"&gt;&#10; &lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"&#10; stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&#10; &lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&#10; &lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&#10; &lt;/svg&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Here&amp;rsquo;s what happens if you try:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;mysql&amp;gt; grant replication slave on *.* to &amp;#39;ec2-slave&amp;#39;@&amp;#39;%&amp;#39;;&#10;ERROR 1045 (28000): Access denied for user &amp;#39;rds_root&amp;#39;@&amp;#39;%&amp;#39; (using password: YES)&#10;mysql&amp;gt; update mysql.user set Repl_slave_priv=&amp;#39;Y&amp;#39; WHERE user=&amp;#39;rds_root&amp;#39; AND host=&amp;#39;%&amp;#39;;&#10;ERROR 1054 (42S22): Unknown column &amp;#39;ERROR (RDS): REPLICA SLAVE PRIVILEGE CANNOT BE GRANTED OR MAINTAINED&amp;#39; in &amp;#39;field list&amp;#39;&#10;mysql&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note: this is for MySQL 5.5, which is unfortunately what I&amp;rsquo;m currently stuck with.&lt;/p&gt;</description></item><item><title>The m3.medium is terrible</title><link>https://evan.wtf/2014/08/12/the-m3-medium-is-terrible/</link><pubDate>Tue, 12 Aug 2014 13:51:08 +0000</pubDate><guid>https://evan.wtf/2014/08/12/the-m3-medium-is-terrible/</guid><description>&lt;p&gt;I&amp;rsquo;ve been doing some testing of various instance types in our staging environment, originally just to see if Amazon&amp;rsquo;s t2.* line of instances is usable in a real-world scenario. In the end, I found that not only are the t2.mediums viable for what I want them to do, but they&amp;rsquo;re far better suited than the m3.medium, which I wouldn&amp;rsquo;t use for anything that you ever expect to reach any load.&lt;/p&gt;</description></item><item><title>Setting hostname in an EC2 instance from the name tag</title><link>https://evan.wtf/2014/05/19/setting-hostname-in-an-ec2-instance-from-the-name-tag/</link><pubDate>Mon, 19 May 2014 15:24:09 +0000</pubDate><guid>https://evan.wtf/2014/05/19/setting-hostname-in-an-ec2-instance-from-the-name-tag/</guid><description>&lt;pre tabindex="0"&gt;&lt;code&gt;# pip install awscli&#10;# HOSTNAME=`aws ec2 describe-tags --region us-east-1 --filters Name=resource-id,Values=`curl http://169.254.169.254/latest/meta-data/instance-id 2&amp;gt; /dev/null` Name=key,Values=Name --output text --query &amp;#39;Tags[*].Value&amp;#39;`&#10;# hostname $HOSTNAME&#10;# hostname &amp;gt; /etc/hostname&#10;&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Load balancing in EC2 with Nginx and HAProxy</title><link>https://evan.wtf/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/</link><pubDate>Mon, 09 Jan 2012 17:00:22 +0000</pubDate><guid>https://evan.wtf/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/</guid><description>&lt;p&gt;We wanted to setup a loadbalanced web cluster in AWS for expansion. My first inclination was to use &lt;a href="http://aws.amazon.com/elasticloadbalancing/"&gt;ELB&lt;/a&gt; for this, but I soon learned that ELB doesn&amp;rsquo;t let you allocate a static IP, requiring you to refer to it only by DNS name. This would be OK except for the fact that our current DNS provider, &lt;a href="http://dyn.com/dns/dynect-managed-dns/"&gt;Dyn&lt;/a&gt;, requires IP addresses when using their GSLB (geo-based load balancer) service.&lt;/p&gt;&#10;&lt;p&gt;Rather than let this derail the whole project, I decided to look into the software options available for loadbalancing in EC2. I&amp;rsquo;ve been a fan of hardware load balancers for a while, sort of looking down at software-based solutions without any real rationale, but in this case I really had no choice so I figured I&amp;rsquo;d give it a try.&lt;/p&gt;</description></item><item><title>Installing Sun (Oracle) JDK 1.5 on an EC2 instance</title><link>https://evan.wtf/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/</link><pubDate>Wed, 16 Nov 2011 11:52:55 +0000</pubDate><guid>https://evan.wtf/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/</guid><description>&lt;p&gt;I&amp;rsquo;m currently working on moving a Tomcat-based application into EC2. The code was written for Java 5.0. While Java 6 would probably work, I&amp;rsquo;d like to keep everything as &amp;ldquo;same&amp;rdquo; as possible, since EC2 presents its own challenges. I spun up a couple of t1.micro instances and copied everything over, including the Java 5 JDK, &lt;a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR"&gt;jdk-1_5_0_22-linux-amd64.rpm&lt;/a&gt;. Installing from RPM was easy, but the EC2 instance defaults to using OpenJDK 1.6:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;[root@ec2 ~]# java -version&#10;java version &amp;#34;1.6.0_20&amp;#34;&#10;OpenJDK Runtime Environment (IcedTea6 1.9.10) (amazon-52.1.9.10.40.amzn1-x86_64)&#10;OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There were a couple of things I had to do to get the system to accept the Sun JDK as its &amp;ldquo;real&amp;rdquo; java.&lt;/p&gt;</description></item><item><title>Integrating Amazon Simple Email Service with postfix for SMTP smarthost relaying.</title><link>https://evan.wtf/2011/04/28/integrating-amazon-simple-email-service-with-postfix-for-smarthost-relaying/</link><pubDate>Thu, 28 Apr 2011 12:23:47 +0000</pubDate><guid>https://evan.wtf/2011/04/28/integrating-amazon-simple-email-service-with-postfix-for-smarthost-relaying/</guid><description>How I configured an EC2 instance to relay mail through Amazon&amp;rsquo;s SES, and some of the bumps I encountered along the way.</description></item><item><title>Relaying through Google Apps using Sendmail to bypass EC2 spam blockage</title><link>https://evan.wtf/2010/12/01/relaying-through-google-apps-using-sendmail-to-bypass-ec2-spam-blockage/</link><pubDate>Wed, 01 Dec 2010 14:48:06 +0000</pubDate><guid>https://evan.wtf/2010/12/01/relaying-through-google-apps-using-sendmail-to-bypass-ec2-spam-blockage/</guid><description>&lt;p&gt;Update 3 May 2011: I&amp;rsquo;ve subsequently modified our EC2 systems to &lt;a href="https://evan.wtf/2011/04/28/integrating-amazon-simple-email-service-with-postfix-for-smarthost-relaying/"&gt;relay SMTP mail through Amazon&amp;rsquo;s SES&lt;/a&gt; which doesn&amp;rsquo;t have the 500 messages per day limit that Google Apps does.&lt;/p&gt;&#10;&lt;p&gt;A few months ago I moved a site into EC2. I didn&amp;rsquo;t want to move the existing IMAP server (ugh) so I moved the email to Google Apps. There are only about 10 mailboxes so we went with &amp;ldquo;Standard&amp;rdquo; edition (free). Once we completed the move to EC2 we discovered that emails from our webserver were bouncing due to our EC2 IP address being listed in a spam RBL. This sucked, so I looked into relaying the mail from the EC2 webserver through our Google Apps account. Fortunately this turned out to be pretty easy.&lt;/p&gt;</description></item><item><title>Amazon EC2 - ext3 mkfs takes 30+ minutes?</title><link>https://evan.wtf/2010/08/02/amazon-ec2-ext3-mkfs-takes-30-minutes/</link><pubDate>Mon, 02 Aug 2010 11:33:42 +0000</pubDate><guid>https://evan.wtf/2010/08/02/amazon-ec2-ext3-mkfs-takes-30-minutes/</guid><description>&lt;p&gt;I&amp;rsquo;ve been playing around with Amazon EC2 for a new project I&amp;rsquo;m working on and so far I&amp;rsquo;m really impressed. One thing I&amp;rsquo;ve noticed, however, is that it takes forever to create an ext3 filesystem on a new volume. For example, the below command took over 30 minutes to create the filesystem on a 300 GB volume:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;h1 id="mke2fs--j--m0-devsdf1"&gt;mke2fs -j -m0 /dev/sdf1&lt;a class="heading-anchor" href="#mke2fs--j--m0-devsdf1" aria-label="Link to this section"&gt;&#10; &lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"&#10; stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&#10; &lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&#10; &lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&#10; &lt;/svg&gt;&#10; &lt;/a&gt;&#10;&lt;/h1&gt;&#10;&lt;p&gt;mke2fs 1.40.4 (31-Dec-2007)&#10;Filesystem label=&#10;OS type: Linux&#10;Block size=4096 (log=2)&#10;Fragment size=4096 (log=2)&#10;39321600 inodes, 78642183 blocks&#10;0 blocks (0.00%) reserved for the super user&#10;First data block=0&#10;Maximum filesystem blocks=4294967296&#10;2400 block groups&#10;32768 blocks per group, 32768 fragments per group&#10;16384 inodes per group&#10;Superblock backups stored on blocks:&#10;32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,&#10;4096000, 7962624, 11239424, 20480000, 23887872, 71663616&lt;/p&gt;</description></item></channel></rss>