<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fabric on 小惡魔 - AppleBOY</title><link>https://blog.wu-boy.com/tags/fabric/</link><description>Recent content in Fabric on 小惡魔 - AppleBOY</description><generator>Hugo</generator><language>en-us</language><managingEditor>appleboy.tw@gmail.com (Appleboy)</managingEditor><webMaster>appleboy.tw@gmail.com (Appleboy)</webMaster><lastBuildDate>Thu, 25 Apr 2013 16:35:37 +0000</lastBuildDate><atom:link href="https://blog.wu-boy.com/tags/fabric/feed.xml" rel="self" type="application/rss+xml"/><item><title>Fabric 管理多台 Linux 機器的 command tool</title><link>https://blog.wu-boy.com/2013/04/fabric-ssh-for-deploy-or-systems-administration/</link><pubDate>Thu, 25 Apr 2013 16:35:37 +0000</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2013/04/fabric-ssh-for-deploy-or-systems-administration/</guid><description>&lt;div style="margin:0 auto; text-align:center"&gt;
 &lt;a href="https://www.flickr.com/photos/appleboy/8679381967/" title="python-logo-master-v3-TM by appleboy46, on Flickr"&gt;&lt;img src="https://i0.wp.com/farm9.staticflickr.com/8123/8679381967_75cee4e0e9_n.jpg?resize=320%2C108&amp;#038;ssl=1" alt="python-logo-master-v3-TM" data-recalc-dims="1" /&gt;&lt;/a&gt;
&lt;/div&gt; 相信 Administrator 管理過兩台以上的 Linux Server 都一定會找 tool 讓多台機器同時執行指令，這也應用在 Deploy 任何 application 到多台機器或者是同時更新系統套件…等，網路上有蠻多套 command line tool 像是 
&lt;p&gt;&lt;a href="https://github.com/capistrano/capistrano" target="_blank"&gt;capistrano&lt;/a&gt;、&lt;a href="http://docs.fabfile.org" target="_blank"&gt;Fabric&lt;/a&gt;、&lt;a href="http://code.google.com/p/parallel-ssh/" target="_blank"&gt;pssh&lt;/a&gt;、&lt;a href="http://packages.debian.org/search?keywords=dsh" target="_blank"&gt;dsh&lt;/a&gt;…等都，本篇會以 &lt;a href="http://www.python.org/" target="_blank"&gt;Python&lt;/a&gt; 所推的 Fabric 來做介紹。另外 Ruby 所寫的 capistrano tool 也是不錯的選擇，這兩套其實大同小異，可以將 Deploy 的邏輯寫成單一 file 再透過 task 定義來決定執行的工作。當然你也可以透過此 tool 來管理 local 端動作，但是這有點多此一舉，因為基本的 Shell 就可以完成了，如果熟悉 Python 則選 fabric，如果喜歡寫 &lt;a href="http://www.ruby-lang.org/en/" target="_blank"&gt;Ruby&lt;/a&gt; 則可以試試看 capistrano。&lt;/p&gt;
&lt;h3 id="安裝方式installation-如果是"&gt;安裝方式(Installation) 如果是&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://www.centos.org/" target="_blank"&gt;CentOS&lt;/a&gt; 系列可以透過 yum 套件管理，&lt;a href="http://www.ubuntu.com/" target="_blank"&gt;Ubuntu&lt;/a&gt; 或 &lt;a href="http://www.debian.org/" target="_blank"&gt;Debian&lt;/a&gt; 則是透過 aptitude 方式安裝。 Yum&lt;/p&gt;
&lt;pre class="brush: bash; title: ; notranslate" title=""&gt;# install python pip tool and fabric command
yum -y install python-pip
pip-python install fabric&lt;/pre&gt; APT 
&lt;pre class="brush: bash; title: ; notranslate" title=""&gt;# install python easy_install
aptitude -y install python-pip
# install fabric command
pip install fabric&lt;/pre&gt; 安裝 capistrano 可以透過 Ruby gem。 
&lt;pre class="brush: bash; title: ; notranslate" title=""&gt;$ gem install capistrano&lt;/pre&gt;</description></item></channel></rss>