<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4461177963215771820</id><updated>2012-02-16T19:42:26.345-08:00</updated><category term='Linux'/><category term='.NET'/><category term='AWS'/><title type='text'>Steve Wiggins</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.stevewiggins.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461177963215771820/posts/default'/><link rel='alternate' type='text/html' href='http://www.stevewiggins.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Steve W</name><uri>http://www.blogger.com/profile/12600652696483499467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4461177963215771820.post-6585571045910654354</id><published>2011-12-17T18:09:00.001-08:00</published><updated>2011-12-17T20:26:19.138-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AWS'/><title type='text'>Amazon Web Services - Linux - RAID</title><content type='html'>First off, I’m no Linux expert. I’ve always liked it but it’s a struggle every time. When something goes wrong it takes me forever to figure it out.&lt;br /&gt;&lt;br /&gt;I’m running three micro instances on AWS using &lt;a href="http://aws.amazon.com/amazon-linux-ami/"&gt;Amazon’s Linux Distro&lt;/a&gt;. They provide the &lt;a href="http://www.mongodb.org/"&gt;MongoDB &lt;/a&gt;backend for&lt;a href="http://www.cleanchow.com/"&gt; Clean Chow&lt;/a&gt;. &amp;nbsp;Amazon’s recent affinity for &lt;a href="http://aws.amazon.com/maintenance-help/"&gt;rebooting instances&lt;/a&gt; combined with my lack of Linux knowledge (and stupidity) almost caused my site to go down.&lt;br /&gt;&lt;br /&gt;I use RAID to improve database performance. What I didn’t know is that the RAID configuration would not survive a reboot. So when Amazon rebooted two of my instances MongoDB didn't come back up. &amp;nbsp;Since I still had one instance running the database just went into read-only mode. &amp;nbsp;The site stayed up because with the exception of some caching it doesn’t need write access. I was lucky. I know I should have rebooted the servers after adding RAID to the equation. At the time I was just happy to get it going.&lt;br /&gt;&lt;br /&gt;So in the end these are the steps I had to go through to get RAID working on AWS. &lt;b&gt;Note: I’m using RAID 0 which does NOT provide for any redundancy, it’s purely for performance.&lt;/b&gt; I believe these steps should work for other RAID levels, but I haven’t tested it.&lt;br /&gt;&lt;br /&gt;1) Start a new instance &amp;nbsp;(I used the Micro instance with the ‘&lt;i&gt;Basic 64-bit Amazon Linux AMI 2011.09&lt;/i&gt;')&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8kMh0Mx3kv8/Tu1LxoLH0OI/AAAAAAAAAC8/TPz_2n5ab2A/s1600/Image1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://1.bp.blogspot.com/-8kMh0Mx3kv8/Tu1LxoLH0OI/AAAAAAAAAC8/TPz_2n5ab2A/s400/Image1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2) SSH into the instance and execute “&lt;i&gt;sudo yum update&lt;/i&gt;”. I prefer to update it though I don’t know that it's necessary.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-tz1E2nNyv6c/Tu1L19Dt7vI/AAAAAAAAADE/_Sua4h21ZeI/s1600/Image2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="251" src="http://4.bp.blogspot.com/-tz1E2nNyv6c/Tu1L19Dt7vI/AAAAAAAAADE/_Sua4h21ZeI/s400/Image2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;3) Create two new EBS volumes. Mine were 10GB each. Be sure to select the same availability zone the instance is in.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-wJTfFEks9HA/Tu1L3g8wuqI/AAAAAAAAADM/tIjDqKoFgz8/s1600/Image3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="132" src="http://1.bp.blogspot.com/-wJTfFEks9HA/Tu1L3g8wuqI/AAAAAAAAADM/tIjDqKoFgz8/s320/Image3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;4) Name the newly created EBS volumes. I named mine ‘&lt;i&gt;Amazon RAID A&lt;/i&gt;’ and ‘&lt;i&gt;Amazon RAID B&lt;/i&gt;’. My real volumes have names like '&lt;i&gt;Mongo 2 DATA B&lt;/i&gt;'.&lt;br /&gt;&lt;br /&gt;5) Attach the ‘A’ volume to the instance using the device id “&lt;i&gt;/dev/sda2&lt;/i&gt;”.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-4XovTcWhR9U/Tu1L3y26VaI/AAAAAAAAADU/tzO-JYGrUyA/s1600/Image4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="163" src="http://4.bp.blogspot.com/-4XovTcWhR9U/Tu1L3y26VaI/AAAAAAAAADU/tzO-JYGrUyA/s320/Image4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;6) Attach the ‘B’ volume to the instance using the device id “&lt;i&gt;/dev/sda3&lt;/i&gt;”.&lt;br /&gt;&lt;br /&gt;7) Watch the EBS Volumes page on the AWS Management Console to ensure both volumes are successfully attached.&lt;br /&gt;&lt;br /&gt;8) Execute ‘&lt;i&gt;ls /dev/sda*&lt;/i&gt;’ and make sure there are three volumes listed: sda1, sda2, sda3&lt;br /&gt;&lt;br /&gt;9) Execute ‘&lt;i&gt;sudo mdadm --create /dev/md0 --chunk=64 --level=raid0 --raid-devices=2 /dev/sda2 /dev/sda3&lt;/i&gt;’&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-fLfImPKUWjY/Tu1L4KetTKI/AAAAAAAAADc/1hHSq2ECavE/s1600/Image5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="251" src="http://2.bp.blogspot.com/-fLfImPKUWjY/Tu1L4KetTKI/AAAAAAAAADc/1hHSq2ECavE/s400/Image5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;10) Execute ‘&lt;i&gt;sudo yum install xfsprogs&lt;/i&gt;’ to get the XFS formatting utilities (I’m using XFS because that sounded like a best practice for MongoDB).&lt;br /&gt;&lt;br /&gt;11) Execute ‘&lt;i&gt;sudo mkfs.xfs /dev/md0&lt;/i&gt;’&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-7q6f3141CxA/Tu1L4l4fQJI/AAAAAAAAADk/ZIcI_MFMNug/s1600/Image6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="251" src="http://3.bp.blogspot.com/-7q6f3141CxA/Tu1L4l4fQJI/AAAAAAAAADk/ZIcI_MFMNug/s400/Image6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;12) Execute ‘&lt;i&gt;sudo mkdir /mongoData&lt;/i&gt;’. I’m using &lt;i&gt;mongoData &lt;/i&gt;as a mount point, but you could use anything.&lt;br /&gt;&lt;br /&gt;13) Execute ‘&lt;i&gt;sudo mount /dev/md0 /mongoData -o noatime,nouser&lt;/i&gt;’ to mount the new RAID volume. I’m specifying the &lt;i&gt;noatime &lt;/i&gt;and &lt;i&gt;nouser &lt;/i&gt;options as a MongoDB optimization.&lt;br /&gt;&lt;br /&gt;14) Now this is the part I initially messed up. &lt;b&gt;If you reboot now the RAID array will not be reattached&lt;/b&gt;. So we need to setup the RAID array so that it will come back and define the mount point in the /etc/fstab file.&lt;br /&gt;&lt;br /&gt;15) Switch to a root CSH shell by executing ‘&lt;i&gt;sudo csh&lt;/i&gt;’. After you do this you don’t need to run sudo because everything executes as root. I did this because in the next step we have to pipe outut to a file that only root can write to and I don’t know enough about sudo to make this work, so I cheated ;-)&lt;br /&gt;&lt;br /&gt;15) Execute ‘&lt;i&gt;mdadm --detail --scan &amp;nbsp;&amp;gt; /etc/mdadm.conf&lt;/i&gt;’. &amp;nbsp;This will make the RAID array survive a reboot &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-QKbM6G2q2QU/Tu1L4wtHvhI/AAAAAAAAADs/Hw5b0IRSfLg/s1600/Image7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="201" src="http://4.bp.blogspot.com/-QKbM6G2q2QU/Tu1L4wtHvhI/AAAAAAAAADs/Hw5b0IRSfLg/s320/Image7.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;16) Execute ‘&lt;i&gt;cat /proc/mounts&lt;/i&gt;’ to list the current runtime configuration&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-F1UgMyRHBLg/Tu1L5CGrmsI/AAAAAAAAAD0/9oJL38W5Fqk/s1600/Image8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="201" src="http://4.bp.blogspot.com/-F1UgMyRHBLg/Tu1L5CGrmsI/AAAAAAAAAD0/9oJL38W5Fqk/s320/Image8.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;17) Copy the line that includes a reference to your mount point. In my case its this line “&lt;i&gt;/dev/md0 /mongoData xfs rw,noatime,attr2,nobarrier,logbsize=64k,sunit=128,swidth=256,noquota 0 0&lt;/i&gt;”.&lt;br /&gt;&lt;br /&gt;18) Modify the /etc/fstab to include that line. I fixed up some of the spacing&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dYLp8c4WGcQ/Tu1L5bke3VI/AAAAAAAAAD8/uhtEklBeqes/s1600/Image9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="201" src="http://2.bp.blogspot.com/-dYLp8c4WGcQ/Tu1L5bke3VI/AAAAAAAAAD8/uhtEklBeqes/s320/Image9.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;20) Create a file in the &lt;i&gt;/mongoData&lt;/i&gt; directory (this should be saved to the RAID volume).&lt;br /&gt;&lt;br /&gt;21) Reboot instance and execute ‘&lt;i&gt;df&lt;/i&gt;’. This should show the RAID volume and the file created in the /mongoData directory should still exist.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-1FbBo_z2N0U/Tu1L53vkRfI/AAAAAAAAAEE/fBweg0xvw60/s1600/Image10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="201" src="http://2.bp.blogspot.com/-1FbBo_z2N0U/Tu1L53vkRfI/AAAAAAAAAEE/fBweg0xvw60/s320/Image10.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://aws.amazon.com/articles/1074"&gt;http://aws.amazon.com/articles/1074&lt;/a&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;a href="http://www.devil-linux.org/documentation/1.0.x/ch01s05.html"&gt;http://www.devil-linux.org/documentation/1.0.x/ch01s05.html&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;a href="http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/"&gt;http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;a href="http://joslynesser.com/blog/archives/2010/09/28/mongodb-sharding-guide-server-setup-on-ubuntu-ec2/"&gt;http://joslynesser.com/blog/archives/2010/09/28/mongodb-sharding-guide-server-setup-on-ubuntu-ec2/&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4461177963215771820-6585571045910654354?l=www.stevewiggins.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.stevewiggins.com/feeds/6585571045910654354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.stevewiggins.com/2011/12/amazon-web-services-linux-raid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461177963215771820/posts/default/6585571045910654354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461177963215771820/posts/default/6585571045910654354'/><link rel='alternate' type='text/html' href='http://www.stevewiggins.com/2011/12/amazon-web-services-linux-raid.html' title='Amazon Web Services - Linux - RAID'/><author><name>Steve W</name><uri>http://www.blogger.com/profile/12600652696483499467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-8kMh0Mx3kv8/Tu1LxoLH0OI/AAAAAAAAAC8/TPz_2n5ab2A/s72-c/Image1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461177963215771820.post-4292620354065200804</id><published>2009-09-09T21:23:00.000-07:00</published><updated>2011-12-17T20:01:36.938-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>ReSharper</title><content type='html'>&lt;br /&gt;Resharper is amazing! It has changed the way I work, increased my productivity and most importantly improved the quality of my code. I bought it myself and it was worth every penny.&lt;br /&gt;&lt;br /&gt;When it comes to software I'm a minimalist. The more software loaded on a machine the more opportunity for trouble. Trouble can come in the form of software conflicts, performance degradation and security vulnerabilities just to name a few. Plus I can't stand the clutter. Resharper earns its keep every day.&lt;br /&gt;&lt;br /&gt;A few of my favorite features:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Refactoring&lt;/b&gt;&lt;br /&gt;Refactoring tools make it easier to refactor, which means you're more likely to do it. This means cleaner code which is always good.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Test Runner&lt;/b&gt;&lt;br /&gt;The built in test runner is really handy. It makes running tests quick and convenient. They make it really easy to run tests in the debugger which is great.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code Navigation&lt;/b&gt;&lt;br /&gt;There are tons of keyboard shortcuts to help move around code more efficiently.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code Formatting&lt;/b&gt;&lt;br /&gt;ReSharper has a great engine for formatting code. This makes it really easy to keep the formatting consistent and professional looking. I don't want to waste time making sure my property declarations are bundled together and in order or worry about how many lines are after curly braces. I just bang out the code without concern for any formatting then hit CTRL-e, Ctrl-f and let ReSharper apply my formatting rules.&lt;/blockquote&gt;There's a free 30 day trial I highly recommend. I'd encourage anybody to give it a try, its worth the time.&lt;br /&gt;&lt;br /&gt;http://www.jetbrains.com/resharper/&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4461177963215771820-4292620354065200804?l=www.stevewiggins.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.stevewiggins.com/feeds/4292620354065200804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.stevewiggins.com/2009/09/resharper.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461177963215771820/posts/default/4292620354065200804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461177963215771820/posts/default/4292620354065200804'/><link rel='alternate' type='text/html' href='http://www.stevewiggins.com/2009/09/resharper.html' title='ReSharper'/><author><name>Steve W</name><uri>http://www.blogger.com/profile/12600652696483499467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
