2012-02-02 104 views
6

我嘗試開始思考我的服務器上的獅身人面像,但它不想工作。思維獅身人面像不啓動 - 「無法啓動searchd守護進程」

我做的:

$ 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 

配置/ 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 

回答

14

我解決它。我有獅身人面像的過程在後臺,所以我只是把它打死了:

$ 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 

然後我就開始斯芬克斯:

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

嗨,我收到這個問題,當我做耙思考_sphinx:開始....我得到以下錯誤無法啓動searchd守護進程。檢查/home/user/newsvn/alumnicell/log/searchd.log。 無法啓動searchd守護進程。檢查/home/user/newsvn/alumnicell/log/searchd.log 請務必運行think_sphinx:index之前thinking_sphinx:開始 我該怎麼辦 – NJF 2012-05-28 08:43:04

+0

我認爲你應該問一個關於stackoverflow的問題。 – ExiRe 2012-05-31 14:11:45

+0

或者,您可以使用「pgrep searchd」來查找正在運行的進程。 – Stone 2012-12-12 01:13:21

5

這聽起來像初始化已經開始綁定到端口9312的searchd實例。

有幾個解決方案:

  1. searchd的的系統實例:sudo service sphinxsearch stop
  2. 修改config/sphinx.yml並告訴Sphinx在生產中使用不同的端口。 (如果您使用的是TS 3.x,則爲config/thinking_sphinx.yml
  3. 配置服務器在系統啓動時不啓動searchd。在Ubuntu 14.04上,您可以編輯/etc/defaults/sphinxsearch並設置START=no

我們的服務器運行Ubuntu,我從Sphinx網站上的Debian package上安裝了Sphinx。

0

在我來說,我檢查這個文件:../yourdirectory/log/searchd.log,它被寫了:/usr/local/var/data/binlog.002: No such file or directory我只能這樣做:

touch /usr/local/var/data/binlog.002

做,做工精細。