Skip to content

Commit

Permalink
Rename sphinx config directory, automatically
Browse files Browse the repository at this point in the history
create it, and update readme to note that you
need to symlink it in.
  • Loading branch information
watsonian committed Sep 18, 2010
1 parent 2eee637 commit f2778d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cookbooks/sphinx/README.md
Expand Up @@ -30,6 +30,7 @@ Namely:
* Uncomment the flavor you want to use (thinking_sphinx or ultrasphinx).
* Set the cron_interval to specify how frequently you want to reindex.

Add the following before_migrate.rb [deploy hook](http://docs.engineyard.com/appcloud/howtos/deployment/use-deploy-hooks-with-engine-yard-appcloud):
Add the following before_migrate.rb [deploy hooks](http://docs.engineyard.com/appcloud/howtos/deployment/use-deploy-hooks-with-engine-yard-appcloud):

run "ln -nfs #{shared_path}/config/sphinx #{release_path}/config/sphinx"
run "ln -nfs #{shared_path}/config/sphinx.yml #{release_path}/config/sphinx.yml"
11 changes: 8 additions & 3 deletions cookbooks/sphinx/recipes/default.rb
Expand Up @@ -44,6 +44,13 @@
mode 0755
end

directory "/data/#{app_name}/shared/config/sphinx" do
recursive true
owner node[:owner_name]
group node[:owner_name]
mode 0755
end

remote_file "/etc/logrotate.d/sphinx" do
owner "root"
group "root"
Expand All @@ -60,8 +67,7 @@
mode 0644
variables({
:app_name => app_name,
:user => node[:owner_name],
:flavor => flavor
:user => node[:owner_name]
})
end

Expand All @@ -73,7 +79,6 @@
variables({
:app_name => app_name,
:user => node[:owner_name],
:flavor => flavor.eql?("thinking_sphinx") ? "thinkingsphinx" : flavor,
:flavor => flavor,
:mem_limit => 32
})
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/sphinx/templates/default/sphinx.yml.erb
Expand Up @@ -5,6 +5,6 @@
address: localhost
port: 3312
mem_limit: <%= @mem_limit %>
config_file: /data/<%= @app_name %>/current/config/<%= @flavor %>/<%= @node[:environment][:framework_env] %>.sphinx.conf
config_file: /data/<%= @app_name %>/current/config/sphinx/<%= @node[:environment][:framework_env] %>.sphinx.conf
searchd_file_path: /var/log/engineyard/sphinx/<%= @app_name %>/indexes

0 comments on commit f2778d2

Please sign in to comment.