-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
# recipes go here. | ||
require 'pp' | ||
# | ||
# Cookbook Name:: ultrasphinx | ||
# Recipe:: default | ||
# | ||
#if_app_needs_recipe("ultrasphinx") do |app,data,index| | ||
|
||
# Make sure that we only run this on an app instance and not on a database server. | ||
# The "node" information will be provided by the server, that's why you won't see | ||
# it defined anywhere in this repository. | ||
if ['solo', 'app', 'app_master'].include?(node[:instance_role]) | ||
|
||
# This is the name of your application as Flex/Solo knows it. | ||
run_for_app("<app_name>") do |app_name, data| | ||
|
||
directory "/var/run/sphinx" do | ||
owner node[:owner_name] | ||
group node[:owner_name] | ||
mode 0755 | ||
end | ||
|
||
directory "/var/log/engineyard/sphinx/#{app_name}" do | ||
recursive true | ||
owner node[:owner_name] | ||
group node[:owner_name] | ||
mode 0755 | ||
end | ||
|
||
# This will create a remote file by copying a local file from ./files | ||
remote_file "/etc/logrotate.d/sphinx" do | ||
owner "root" | ||
group "root" | ||
mode 0755 | ||
source "sphinx.logrotate" | ||
action :create | ||
end | ||
|
||
# This will create a remote file using a local template. See the file in | ||
# ./templates to get a feel for what's going on here. | ||
template "/etc/monit.d/sphinx.#{app_name}.monitrc" do | ||
source "sphinx.monitrc.erb" | ||
owner node[:owner_name] | ||
group node[:owner_name] | ||
mode 0644 | ||
variables({ | ||
:app_name => app_name, | ||
:user => node[:owner_name] | ||
}) | ||
end | ||
|
||
template "/data/#{app_name}/shared/config/sphinx.yml" do | ||
owner node[:owner_name] | ||
group node[:owner_name] | ||
mode 0644 | ||
source "sphinx.yml.erb" | ||
variables({ | ||
:app_name => app_name, | ||
:user => node[:owner_name] | ||
}) | ||
end | ||
|
||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
check process sphinx_<%= @app_name %>_3312 | ||
with pidfile /var/run/sphinx/<%= @app_name %>.pid | ||
start program = "/engineyard/bin/ultrasphinx_searchd <%= @app_name %> start" as uid <%= @user %> and gid <%= @user %> | ||
stop program = "/engineyard/bin/ultrasphinx_searchd <%= @app_name %> stop" as uid <%= @user %> and gid <%= @user %> | ||
group sphinx_<%= @app_name %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# stuff goes here. | ||
<%= @node[:environment][:framework_env] %>: | ||
searchd_log_file: /var/log/engineyard/sphinx/<%= @app_name %>/searchd.log | ||
query_log_file: /var/log/engineyard/sphinx/<%= @app_name %>/query.log | ||
pid_file: /var/run/sphinx/<%= @app_name %>.pid | ||
address: localhost | ||
port: 3312 | ||
mem_limit: 32 | ||
config_file: /data/<%= @app_name %>/current/config/ultrasphinx/<%= @node[:environment][:framework_env] %>.sphinx.conf | ||
searchd_file_path: /var/log/engineyard/sphinx/<%= @app_name %>/indexes |