Skip to content

Instantly share code, notes, and snippets.

@SammyLin
Last active August 29, 2015 14:11
Show Gist options
  • Save SammyLin/cc367a8a2fe552bcbb1f to your computer and use it in GitHub Desktop.
Save SammyLin/cc367a8a2fe552bcbb1f to your computer and use it in GitHub Desktop.
monit configuration for solr and rails project
check process solr-<%= fetch(:application) %> with pidfile <%= "#{shared_path}/pids/sunspot-solr.pid" %>
start program = "/bin/su - deploy -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec sunspot-solr start --port=8983 --data-directory=<%= shared_path %>/solr/data --pid-dir=<%= shared_path %>/pids'"
stop program = "/bin/su - deploy -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec sunspot-solr stop --pid-dir=<%= shared_path %>/pids'"
if failed host 127.0.0.1 port 8983 protocol http and request "/solr" then restart
if 3 restarts within 5 cycles then timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment