Delta Indexing of Sphynx Depression Doesn't Work

This is what I have defined:

  • Delta indexing works great in development
  • Delta indexing doesn't work when I click on the production server and no activity is logged to searchd.log
  • I am running Phusion Passenger and, as recommended in the basic troubleshooting guide , have confirmed that:
    • WWW data has permission to run rake indexing tasks (run from command line manually)
    • correct index path and searchd (/ usr / local / bin)
    • there are no errors in production.log.

What could I have lost? I am running Ruby Enterprise 1.8.6, Rails 2.3.4, Sphinx 0.9.8.1 and Thinking Sphinx 1.2.11.

Thank!

+2


source to share


6 answers


Last night, when I was asleep, it hit me. Unsurprisingly it was a silly bad configuration issue, although I'm pretty surprised it gave the results it did. I guess I'm not very good at Thinking Sphinx internals.

I recently migrated the servers. sphinx.yml looked like this:

production:
  bin_path: '/usr/local/bin'
  host: mysql.mysite.com

      



On the new server, MySQL was just a local service, but I forgot to remove this line. Interestingly, manually re-indexing the rake still worked fine. I am intrigued that Thinking Sphinx did not throw an error when trying to reload the delta since mysql.mysite.com no longer exists, although that is clearly the source of the problem.

Thanks for your help, and sorry for causing such a stupid problem.

+1


source


Are there any hints in the Apache / Nginx error log?



0


source


Following is the next troubleshooting step. Open the file for the delta indexing strategy you are (presumably lib/thinking_sphinx/deltas/default_delta.rb

) using . Find the line where it actually generates the index command. In mine (v1.1.6) this is line 20:

output = `#{config.bin_path}indexer --config #{config.config_file} #{rotate} #{delta_index_name model}`

      

Change this so that you can log this command yourself and possibly log the output as well:

command = `#{config.bin_path}indexer --config #{config.config_file} #{rotate} #{delta_index_name model}`
RAILS_DEFAULT_LOGGER.info(command)
output = `#{command}`
RAILS_DEFAULT_LOGGER.info(output)

      

Expand this to production and run the log on delta indexed model changes. Hope this actually shows you the problem. Of course, there might be a problem elsewhere in the code and you won't even get to this point, but I'll start with it.

0


source


I had this problem and found the "bin_path" solution mentioned above. When that didn't work, it took me a while to realize that I pasted the example code for "production" when I was testing a "static" environment. Problem solved!

This was done after making sure the rake tasks that configure, index and run sphinx are running as the same user as your passenger instance. If you log into the server with administrator rights to perform these tasks, they will work in the console, but not through a passenger.

0


source


I had the same problem. Works on the command line, not in the application.

It turns out we still had a slave database that we used for indexing, but the slave was not updated.

0


source


As above, the same problems were on our side on two machines. The first one we had was a mysql problem that was shown in the apache2 log. This seemed to affect the local OSX machine ..

The second time we deployed to an Ubuntu server, we had the same problem. The c rails were fine, no errors, bla bla bla.

Done problem with permissions. Couldn't figure it out as there were no problems, although I assume I am doing this as root.

Using capistrano and a passenger, we did this:

  • Create a passenger and add him to the www-data group li>
  • Changed user in deploy.rb to be a passenger.
  • Manually changed all / current files belonging to above
  • Enrolled as a passenger.
  • Ran rake ts: rebuild RAILS_ENV = "production"

Worked for us ...

Good luck.

0


source







All Articles