Más contenido relacionado
La actualidad más candente (20)
Similar a Chef(Server)と AWS OpsWorks(tm)の比較 (20)
Más de Yukihiko SAWANOBORI (20)
Chef(Server)と AWS OpsWorks(tm)の比較
- 9. Chef形態あれこれ
• Server
• Hosted ChefServer
• OpscodeのSaaS
• Private ChefServer
• Opscodeのサービス
• OpenSource ChefServer
• Linux(ほぼUbuntu)にインストールできるChefサーバ
• Client
• Chef-Client: Serverとセットで
• Chef-Solo:単独の簡易版
9
Saturday, July 6, 13
- 54. 他のAWSと連携するので
コンフィグを作る
• before_restartのフックでChefる
• deploy/before_restart.rb
39
aws_configs
=<<__EOL__
production:
access_key_id:
"#{node[:aws_configs][:access_key_id]}"
secret_access_key:
"#{node[:aws_configs][:secret_access_key]}"
__EOL__
file
::File.expand_path('../../shared/config/aws.yml',
release_path)
do
action
:create
content
aws_configs
mode
'0660'
owner
'deploy'
group
'www-‐data'
end
link
::File.join(release_path,
'config/aws.yml')
do
to
::File.expand_path('../../shared/config/aws.yml',
release_path)
owner
'deploy'
end
yamlの文字列作成
sharedの下にファイル設置
最新のアプリコードの下に
リンク作成
Saturday, July 6, 13
- 55. ワーカーデーモンを起動する 1/2
40
• 起動・終了スクリプトを設置するため
before_symlinkあたりのフックでChefる
• deploy/before_symlink.rb
sqs_start_script
=<<__EOL__
#!/bin/bash
export
RAILS_ENV=production
cd
#{::File.expand_path('../../current',
release_path)}
bundle
exec
thor
sqs:start
-‐d
-‐-‐pidfile
tmp/pids/sqs_worker.pid
__EOL__
file
::File.expand_path('../../shared/scripts/sqs_start',
release_path)
do
action
:create
content
sqs_start_script
mode
'0755'
owner
'deploy'
group
'www-‐data'
end
開始スクリプトの
文字列作成
実行権をつけて設置
Saturday, July 6, 13