Thanks for the reply. I ended up getting it working. I needed to bypass the 
stop solr task if it failed in case sunspot was not yet running.

On Wednesday, April 24, 2013 8:54:56 AM UTC-4, Drew Sheneman wrote:
>
> I am trying to deploy Sunspot Solr with Capistrano. I have been setting 
> this up based on this gist: https://gist.github.com/doitian/1795439.
>
> **deploy.rb**
>
>     namespace :deploy do
>       task :start do ; end
>       task :stop do ; end
>       task :restart, :roles => :app, :except => { :no_release => true } do
>         run "#{try_sudo} touch 
> #{File.join(current_path,'tmp','restart.txt')}"
>       end
>     
>       desc "Migrate Database"
>       task :migrate_db do
>         run "cd #{current_path} && rake db:migrate RAILS_ENV=production"
>         run "touch #{current_path}/tmp/restart.txt"
>       end
>     
>       desc "Create Solr Directory"
>       task :setup_solr_data_dir do
>         run "mkdir -p #{shared_path}/solr/data"
>       end
>     end
>     
>     namespace :solr do
>       desc "start solr"
>       task :start, :roles => :app, :except => { :no_release => true } do
>         run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec 
> sunspot-solr start --port=8983 --data-directory=#{shared_path}/solr/data 
> --pid-dir=#{shared_path}/pids"
>       end
>       desc "stop solr"
>       task :stop, :roles => :app, :except => { :no_release => true } do
>         run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec 
> sunspot-solr stop --port=8983 --data-directory=#{shared_path}/solr/data 
> --pid-dir=#{shared_path}/pids"
>       end
>       desc "reindex the whole database"
>       task :reindex, :roles => :app do
>         stop
>         run "rm -rf #{shared_path}/solr/data"
>         start
>         run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake 
> sunspot:solr:reindex"
>       end
>     end
>
>     after "deploy", "deploy:cleanup", "deploy:migrate_db", 
> 'deploy:setup_solr_data_dir', 'solr:stop', 'solr:reindex', 'solr:start'
>
> I have set the IP for my internal server which is hosting my production 
> app in sunspot.yml:
>
>     production:
>       solr:
>         hostname: [My Server IP]
>         port: 8983
>         log_level: WARNING
>         # read_timeout: 2
>         # open_timeout: 0.5
>
> When I try to run **cap deploy**, I get the following error:
>
>   
>
>     * 2013-04-24 08:28:04 executing `solr:stop'
>       * executing "cd /home/username/apps/appname/current && 
> RAILS_ENV=production bundle exec sunspot-solr stop --port=8983 
> --data-directory=/home/username/apps/appname/shared/solr/data 
> --pid-dir=/home/datacomm/apps/appname/shared/pids"
>         servers: ["0.0.0.0"]
>         [0.0.0.0] executing command
>      ** [out :: 0.0.0.0] java version "1.7.0_15"
>      ** [out :: 0.0.0.0] 
>      ** [out :: 0.0.0.0] OpenJDK Runtime Environment (IcedTea7 2.3.7) 
> (7u15-2.3.7-0ubuntu1~12.04.1)
>      ** [out :: 0.0.0.0] 
>      ** [out :: 0.0.0.0] OpenJDK 64-Bit Server VM (build 23.7-b01, mixed 
> mode)
>      ** [out :: 0.0.0.0] 
>      ** [out :: 0.0.0.0] *No PID file at 
> /home/username/apps/appname/shared/pids/sunspot-solr.pid*
>      ** [out :: 0.0.0.0] 
>         command finished in 990ms
>     failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3' -c 'cd 
> /home/username/apps/appname/current && RAILS_ENV=production bundle exec 
> sunspot-solr stop --port=8983 
> --data-directory=/home/username/apps/appname/shared/solr/data 
> --pid-dir=/home/username/apps/appname/shared/pids'" on 0.0.0.0
>
> What am I missing? Any help is appreciated. 
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to