1

I am trying to get mongrel cluster working on my Ubuntu Server Karmic box in preparation to setup Capistrano. I've been trying to get the two to work all day and finally decided to completely remove Capistrano and see if I can just get Mongrel Cluster to work.

I ran this to install mongrel cluster:

gem install mongrel mongrel_cluster

Everything installed fine, when I change into my app's directory...

# mongrel_rails
-bash: mongrel_rails: command not found

I can run it from its install location:

# /var/lib/gems/1.8/bin/mongrel_rails               
Usage: mongrel_rails <command> [options]
Available commands are:
...

It lets me build the cluster configuration file fine, but when I run the clister:start command:

# /var/lib/gems/1.8/bin/mongrel_rails cluster::start                               
starting port 8000
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8000 -P tmp/pids/mongrel.8000.pid -l log/mongrel.8000.log

starting port 8001
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8001 -P tmp/pids/mongrel.8001.pid -l log/mongrel.8001.log

starting port 8002
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8002 -P tmp/pids/mongrel.8002.pid -l log/mongrel.8002.log

It seems it isnt calling it from the right directory after that command, what can I do to fix this? I tried setting the path previously when trying to set up Capistrano, but the path didnt stay set when Capistrano used ssh to run the commands.

trobrock
  • 227
  • 2
  • 9

1 Answers1

0

Please try this symlink:

ln -s /var/lib/gems/1.8/bin/mongrel_rails /usr/lib/ruby/1.8/rubygems/mongrel_rails
iainlbc
  • 2,694
  • 18
  • 19
  • 1
    I did something similar, but linked it into the /usr/local/bin instead, and it is working now. Now I am trying to figure out why the rewrite conditions are not sending traffic to the proxy_balancer in apache. RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f :::: RewriteRule ^/(.*)$ balancer://my_cluster%{REQUEST_URI} [P,QSA,L] :::: if anyone was curious those are the two lines not redirecting traffic. – trobrock May 04 '10 at 21:17
  • The Rewrite condition and Rule look fine, Have you restarted apache? – iainlbc May 04 '10 at 21:30
  • you could add rewrite logging to the virtual host to get some info: RewriteLog logs/rewrite_log ::::: RewriteLogLevel 9 – iainlbc May 04 '10 at 21:34
  • I did it with RewriteLogLevel 3 and it looks like it is redirecting properly to balancer://my_cluster but I am not getting anything from it, when I go to a single instance of mongrel in my browser I can get the page, but the Proxy doesnt seem to be forwarding to the mongrel instance. – trobrock May 04 '10 at 22:53
  • hey trobrock did you figure it out yet? what does your proxy_cluster.conf look like? Hmm... – iainlbc May 04 '10 at 23:53
  • 1
    Just thought I would say, I fixed this by adding this satement in the Proxy balancer section of my conf file 'Allow from localhost' to allow the local server to make calls to the balancer, other wise it denies all by default – trobrock May 04 '10 at 23:54