YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web serviceKazuho Oku
?
The talk describes the architecture of Pathtraq, one of Japan's largest web access statistics service, covering from database compression techniques to embedded SQL in perl.
30. tomahawkの特徴
kuwano@kuwano03:~$ tomahawk-rsync -f webserver.list -l -m push -u kuwano_akihiro ?
/src/test.txt /dst/test.txt
Enter a password for ssh authentication:PASSWORD
% rsync -av /src/test.txt kuwano_akihiro@192.168.100.146:/dst/test.txt
building file list ... done
test.txt
sent 2674 bytes received 42 bytes 1810.67 bytes/sec
total size is 2547 speedup is 0.94
% rsync -av /src/test.txt kuwano_akihiro@192.168.100.147:/dst/test.txt
building file list ... done
test.txt
sent 2674 bytes received 42 bytes 1810.67 bytes/sec
total size is 2547 speedup is 0.94
kuwano@kuwano03:~$
30
36. chef の実?例
レシピ実?例
yumのRPMインストール
# web-server
if node[:user_attr][:socket_server_type] == "web" then
# 必要パッケージのインストール
%w{httpd java}.each do |package_name|
package package_name do
action :install
end
end
# db-server
elif node[:user_attr][:socket_server_type] == "db" then
# 必要パッケージのインストール
%w{mysql-server mysql-client}.each do |package_name|
package package_name do
action :install
end
end
end
36
38. chef の実?例
レシピ実?例
Hostsファイルの変更(本番とステージングで
異なるファイルにする)
# hostsのコピー
# - ステージング環境の場合
if node[:user_attr][:product] == "stging" then
template "/etc/hosts" do
source "hosts_stagins.erb"
mode "644"
end
# - 本番環境の場合
elif node[:user_attr][:product] == "product" then
template "/etc/hosts" do
source "hosts_product.erb"
mode "644"
end
end
38