FCUK Ferret 1
life cycle of relationship with ferret…..
STAGE1: First time you come across ferret

OMG its soo cute and it'll make my life so good. happy days
STAGE2: You are having fun with ferret

ferret and me are best buddy....
FINAL STAGE: Then, one day … ferret FCUKs you

your indices are corrupt, crashes under heavy loads....
So, before he gets to you ….. FCUK Ferret. I still love it, but for love of god…… MAKE IT STABLE!!!
For now I love Solr, its stable and just works …. maybe I’m at first stage of relationship life-cycle of Solr ;)
images used here have been taken from random sources on web.
ferret drb server on start gives Errno::ECONNREFUSED: Connection refused - connect(2)
after spending the good half of my day on this issue, i’m pulling my hair and saying to myself
WTF?
and other times
HowTheF*&^
still no solution. I’m using the acts as ferret gem 0.4.3 (latest at time of writing). I’m using ‘ferretstart’ and ‘ferretstop’ scripts with ‘script/runner’
I’ll investigate if using the plugin might be the way to go as someone was saying in his article that a patch has been submitted to acts_as_ferret to fix this issue. [link will go here, once i find it again]
basically the issue is…. In my activerecord i’ve specified the in macro ‘actsas_ferret’ to use remote index. Now when ferret goes to load the models, they think ferret is up and try to connect to it on the port specified in your ferretserver.yml . This should somehow to be suppressed till ferret server comes up.
later in the day….
specifying
FERRET_USE_LOCAL_INDEX=1
should fix my woes, and i truely believed it won’t (following my theory of “believe in failure”)… and to my misfortune, it didn’t. Got this error instead:
runner.rb:45: (eval):21:in `load': wrong number of arguments (0 for 1) (ArgumentError)
Now i’m completely ditching aaf gem and going over to plugin version of aaf. Also it turns out that best way to start drb server is using script/ferret_server
But of course i’ve got no ferretserver in my script dir. HTF?? As it turns out I installed the plugin at early stages of project (when it had ferretstart instead), and then turned to aaf gem. Moment i update my vendor plugin dir , I’ve got what i need!!! ferret_server.
here we go again…
I copied the ferret_server from plugin dir to script, changed permissions and issue this command, hoping that it’ll fail :)
$ script/ferret_server start -e production $ no such file to load -- /usr/bin/../config/environment
WTF??
google to rescue, stumbled upon this post by jens following the post, i changed the servermanager.rb to use FILE instead. issued ferretserver start again …
$ script/ferret_server start -e production $ starting ferret server...
eeeeeeHAAAAA……. Finally :)
Improvements
Since i’m running it on live server, i prefer starting processes with lower permissions. i’ve made a simple script which invoke as root and spawn the ferret server as lower privilege.
--------------script ferret_start-------------------- #!/bin/sh FERRET_USE_LOCAL_INDEX=1 script/ferret_server start -e production -------------------end of script---------- $ sudo -u www-data ./ferret_start