By Neil
Hi,
I have a small VPS running my Rails app which is a personal website. I use SearchKick and that in turn uses ElasticSearch.
I find that ElasticSearch appears to fall over. I notice it mainly after a deploy. I had a similar issue with Delayed Job and was told I could set up a Capistrano task to restart that after each deploy. Code for that is below. That works fine but I don’t think I can do the same for ElasticSearch (I have tried and it didn’t work).
Anyone have any ideas as to how I can ensure ES is running properly after a deploy?
The code to restart Delayed Job is:
namespace :delayed_job do
def args
fetch(:delayed_job_args, "")
end
def delayed_job_roles
fetch(:delayed_job_server_role, :app)
end
desc 'Stop the delayed_job process'
task :stop do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', :stop
end
end
end
end
desc 'Start the delayed_job process'
task :start do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', args, :start
end
end
end
end
desc 'Restart the delayed_job process'
task :restart do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', args, :restart
end
end
end
end
end
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @rctneil,
Do you see any errors in the log? Also is there any additional information your syslog?
You can take a look at this tutorial here on How To Use Journalctl to View and Manipulate Systemd Logs.
Feel free to share the output of the logs here as well.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.