<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Ruby Fun -- Aaron Qian's Blog: Tag boss</title>
    <link>http://aaron.aaron033.com/articles/tag/boss</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Aaron Qian's Blog about Ruby on Rails and Merb</description>
    <item>
      <title>Boohoo, My Site is Down!! -- Got Capistrano?</title>
      <description>&lt;h2&gt;Servers DO Fail&amp;#8212;Get Real&lt;/h2&gt;


	&lt;p&gt;About three days after my failed attempt in persuading my contractor  FooBy Company (for privacy reasons, the name is not real) to setup automatic deployment solutions for their rails online shopping service, I got a call from them and was informed that the website is down, and they can&amp;#8217;t seems to get the site back up. I have just started working with them. Without the knowledge of the internals of the server structure, I ssh into their server(a little nervous), read their poorly written bash scripts, hack around. After about one and half hours of frustration, 2 server reboots, a dozen &lt;code&gt;mongrel_rails cluster::start&lt;/code&gt;, a few undeleted pids, and countless French. I finally brought the site back from oblivion.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Total downtime: 3 hours 23 minutes&amp;#8230;&lt;/strong&gt;&lt;/p&gt;


	&lt;h2&gt;A Better Solution Than French&lt;/h2&gt;


	&lt;p&gt;Someone as smart as you might wonder, there must be a better solution to this. Yes, if you ask any creditable rails developer, usually you will get &lt;a href="http://www.capify.org/"&gt;Capistrano&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;As you probably already know, &lt;a href="http://www.capify.org/"&gt;Capistrano&lt;/a&gt; is a automatic server deployment solution that ease the complexity of rails/merb deployment. You can find out more on their website.&lt;/p&gt;


	&lt;h2&gt;How long does it take to setup Capistrano?&lt;/h2&gt;


	&lt;ol&gt;
	&lt;li&gt;&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;sudo gem install capistrano&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
		&lt;li&gt;&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;cd /YOUR_APP_ROOT; capify .&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
		&lt;li&gt;&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;mate config/deploy.rb&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; and modify to your liking&lt;/li&gt;
		&lt;li&gt;&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;cap deploy:setup&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
		&lt;li&gt;ssh into your server, create directories, create config files&lt;/li&gt;
		&lt;li&gt;&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;cap deploy:cold&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;&lt;strong&gt;Setup time: 20 minutes.&lt;/strong&gt;
&lt;strong&gt;Deployment time: 1minute.&lt;/strong&gt; (Just run &lt;code&gt;cap deploy&lt;/code&gt;)&lt;/p&gt;


	&lt;h2&gt;Do it right =&amp;gt; Do it fast&lt;/h2&gt;


	&lt;p&gt;From my own experience in working with managers and CEOs, I have concluded some commonalities.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Speed is everything.&lt;/li&gt;
		&lt;li&gt;Short term benefit is always greater than long term benefits.&lt;/li&gt;
		&lt;li&gt;We should do it right, but we should do it later, because it cost too much&lt;/li&gt;
		&lt;li&gt;Don&amp;#8217;t fix/change/optimize it if it works now.&lt;/li&gt;
		&lt;li&gt;We know there are potential problems, let&amp;#8217;s fix it when the problem arises&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h2&gt;No No No!&lt;/h2&gt;


	&lt;p&gt;&lt;b style="color:red;"&gt;Do it right, and do it once!!&lt;/b&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jun 2008 16:26:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:217abdb6-8a1b-490b-b540-1483da5459c7</guid>
      <author>Aaron Qian</author>
      <link>http://aaron.aaron033.com/articles/2008/06/26/boohoo-my-site-is-down-got-capistrano</link>
      <category>capistrano</category>
      <category>story</category>
      <category>ruby</category>
      <category>rails</category>
      <category>merb</category>
      <category>boss</category>
      <trackback:ping>http://aaron.aaron033.com/articles/trackback/1</trackback:ping>
    </item>
  </channel>
</rss>
