cap command to install, start, restart , stop elasticsearch in ubuntu server
namespace :elasticsearch do
desc "Install elasticsearch"
task :install do
on roles(:app) do
execute "sudo apt-get update"
execute "sudo apt-get install openjdk-7-jre-headless -y"
execute "cd /tmp"
execute "wget https://download.elasticsearch.org/elasticsearch\
/elasticsearch/elasticsearch-2.3.2.deb"
execute "sudo dpkg -i elasticsearch-2.3.2.deb"
end
end
end
namespace :elasticsearch do
desc "start elasticsearch"
task :start do
on roles(:app) do
execute "sudo service elasticsearch start"
end
end
end
namespace :elasticsearch do
desc "restart elasticsearch"
task :restart do
on roles(:app) do
execute "sudo service elasticsearch restart"
end
end
end
namespace :elasticsearch do
desc "stop elasticsearch"
task :stop do
on roles(:app) do
execute "sudo service elasticsearch stop"
end
end
end
Written by Arvind
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Cap
Authors
arvindvyas
1.631K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#