ruby-on-rails-3.1 – 思考sphinx无法启动 – “无法启动searchd守护进程”

前端之家收集整理的这篇文章主要介绍了ruby-on-rails-3.1 – 思考sphinx无法启动 – “无法启动searchd守护进程”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试着开始在我的服务器上思考sphinx,但它不想工作.

我做:

  1. $rake thinking_sphinx:index && rake thinking_sphinx:start

我得到:

  1. Generating Configuration to /vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf
  2. Sphinx 2.0.3-release (r3043)
  3. Copyright (c) 2001-2011,Andrew Aksyonoff
  4. Copyright (c) 2008-2011,Sphinx Technologies Inc (http://sphinxsearch.com)
  5.  
  6. using config file '/vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf'...
  7. indexing index 'micropost_core'...
  8. WARNING: collect_hits: mem_limit=0 kb too low,increasing to 13568 kb
  9. collected 0 docs,0.0 MB
  10. total 0 docs,0 bytes
  11. total 0.008 sec,0 bytes/sec,0.00 docs/sec
  12. skipping non-plain index 'micropost'...
  13. indexing index 'user_core'...
  14. WARNING: collect_hits: mem_limit=0 kb too low,0 bytes
  15. total 0.012 sec,0.00 docs/sec
  16. skipping non-plain index 'user'...
  17. total 2 reads,0.000 sec,0.0 kb/call avg,0.0 msec/call avg
  18. total 10 writes,0.0 msec/call avg
  19. Failed to start searchd daemon. Check /vol/www/apps/ror_tutorial/releases/20120202111730/log/searchd.log.
  20. Failed to start searchd daemon. Check /vol/www/apps/ror_tutorial/releases/20120202111730/log/searchd.log
  21. Be sure to run thinking_sphinx:index before thinking_sphinx:start

我的服务器系统是Ubuntu 10.04.此外,在我的本地机器(Mac OS X)上,它完美无缺.

我的sphinx.yml:

  1. development:
  2. bin_path: "/usr/local/bin"
  3. searchd_binary_name: searchd
  4. indexer_binary_name: indexer
  5.  
  6. test:
  7. bin_path: "/usr/local/bin"
  8. searchd_binary_name: searchd
  9. indexer_binary_name: indexer

配置/ deploy.rb

  1. #Add RVM's lib directory to the load path.
  2. $:.unshift(File.expand_path('./lib',ENV['rvm_path']))
  3.  
  4. #Load RVM's capistrano plugin.
  5. require "rvm/capistrano"
  6. require 'bundler/capistrano'
  7. #require 'thinking_sphinx/deploy/capistrano'
  8.  
  9. set :rvm_ruby_string,'1.9.3-head' #This is current version of ruby which is uses by RVM. To get version print: $rvm list
  10. set :rvm_type,:root #Don't use system-wide RVM,use my user,which name is root.
  11.  
  12. set :user,"root" #If you log into your server with a different user name than you are logged into your local machine with,you’ll need to tell Capistrano about that user name.
  13. set :rails_env,"production"
  14.  
  15. set :application,"ror_tutorial"
  16. set :deploy_to,"/vol/www/apps/#{application}"
  17.  
  18. set :scm,:git
  19. set :repository,"git://github.com/Loremaster/sample_app.git"
  20. set :branch,"master"
  21. set :deploy_via,:remote_cache
  22. default_run_options[:pty] = true #Must be set for the password prompt from git to work#Keep cash of repository locally and with ney deploy get only changes.
  23.  
  24.  
  25. server "188.127.224.136",:app,# This may be the same as your `Web` server
  26. :web,:db,:primary => true # This is where Rails migrations will run
  27.  
  28.  
  29. # If you are using Passenger mod_rails uncomment this:
  30. namespace :deploy do
  31. task :start do ; end
  32. task :stop do ; end
  33. task :restart,:roles => :app,:except => { :no_release => true } do
  34. run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  35. end
  36. end
  37.  
  38.  
  39. desc "Prepare system"
  40. task :prepare_system,:roles => :app do
  41. run "cd #{current_path} && bundle install --without development test && bundle install --deployment"
  42. end
  43.  
  44. after "deploy:update_code",:prepare_system

解决方法

解决了我在背景中有狮身人面像的过程,所以我就把它杀死了:
  1. $ps -efa | grep sphinx
  2. root 23823 1 0 14:12 ? 00:00:00 searchd --pidfile --config /vol/www/apps/ror_tutorial/releases/20120202111104/config/production.sphinx.conf
  3. root 27069 20413 0 14:49 pts/1 00:00:00 grep sphinx
  4. $kill 23823

然后我开始狮身人面像:

  1. $rake ts:start RAILS_ENV=production
  2. Started successfully (pid 27097).

猜你在找的Ruby相关文章