ruby-on-rails-3.1 - 思考 sphinx 无法启动 - "Failed to start searchd daemon"

标签 ruby-on-rails-3.1 sphinx thinking-sphinx ruby-1.9.3

我尝试开始在我的服务器上考虑 sphinx,但它不想工作。

我愿意:

$ rake thinking_sphinx:index && rake thinking_sphinx:start

我得到:

Generating Configuration to /vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf
Sphinx 2.0.3-release (r3043)
Copyright (c) 2001-2011, Andrew Aksyonoff
Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf'...
indexing index 'micropost_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 13568 kb
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.008 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'micropost'...
indexing index 'user_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 13568 kb
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.012 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'user'...
total 2 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 10 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
Failed to start searchd daemon. Check /vol/www/apps/ror_tutorial/releases/20120202111730/log/searchd.log.
Failed to start searchd daemon. Check /vol/www/apps/ror_tutorial/releases/20120202111730/log/searchd.log
Be sure to run thinking_sphinx:index before thinking_sphinx:start

我的服务器系统是Ubuntu 10.04。另外,在我的本地计算机(Mac OS X)上它运行得很好。

我的sphinx.yml:

development:
  bin_path: "/usr/local/bin"
  searchd_binary_name: searchd
  indexer_binary_name: indexer

test:
  bin_path: "/usr/local/bin"
  searchd_binary_name: searchd
  indexer_binary_name: indexer

config/deploy.rb

#Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))

#Load RVM's capistrano plugin.    
require "rvm/capistrano"
require 'bundler/capistrano'
#require 'thinking_sphinx/deploy/capistrano'

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 
set :rvm_type, :root                                                          #Don't use system-wide RVM, use my user, which name is root.

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.
set :rails_env, "production"

set :application, "ror_tutorial"
set :deploy_to, "/vol/www/apps/#{application}"

set :scm, :git
set :repository,  "git://github.com/Loremaster/sample_app.git"
set :branch, "master"
set :deploy_via, :remote_cache
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.


server "188.127.224.136", :app,                                               # This may be the same as your `Web` server
                          :web,
                          :db, :primary => true                               # This is where Rails migrations will run


# If you are using Passenger mod_rails uncomment this:
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
end


desc "Prepare system"
  task :prepare_system, :roles => :app do
    run "cd #{current_path} && bundle install --without development test && bundle install --deployment"
  end

  after "deploy:update_code", :prepare_system

最佳答案

我解决了。我在后台有 sphinx 进程,所以我就把它杀掉了:

$ ps -efa | grep sphinx
root     23823     1  0 14:12 ?        00:00:00 searchd --pidfile --config /vol/www/apps/ror_tutorial/releases/20120202111104/config/production.sphinx.conf
root     27069 20413  0 14:49 pts/1    00:00:00 grep sphinx
$ kill 23823 

然后我开始了sphinx:

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

关于ruby-on-rails-3.1 - 思考 sphinx 无法启动 - "Failed to start searchd daemon",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9111638/

相关文章:

ruby-on-rails - favicon.ico 被呈现为查询参数的一部分;可能的路线问题

ruby-on-rails - 如何仅在一天中的某些时间之间向 Ruby 中的日期时间添加 15 分钟?

ruby-on-rails - Elastic Search 与 Sunspot 的功能比较

mysql - CMS 的搜索引擎

ruby-on-rails - Thinking-Sphinx-Raspell 配置

ruby-on-rails-3.1 - Rails 3.1,从 Assets 管道中排除 JS 文件

php - 如何在 sphinx 中动态设置权重/分数

mysql - 如何构建与 sphinx 一起使用的 mysql 数据库?

mysql - RoR - rake rs :index fails with NameError on Rails 4. 0.4(4.1.7),思考狮身人面像 3.1.1

mysql - 是否可以在动态条件下使用 Sphinx 搜索?