Forum: Rails deployment Mongrel & multiple config files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fd55097df71dadea1288210b457eb33b?d=identicon&s=25 Chris Lilley (chrisl)
on 2007-06-15 15:54
I'm deploying a rails app to separate production and staging
environments using Capistrano. They're basically running as two apps on
the same machine, so I want to make them available on different ports,
and may also want to have different numbers of mongrels in the clusters.

My plan was to build a config file name based on the RAILS_ENV setting -
something like ..../config/mongrel/staging.yml or
..../config/mongrel/production.yml and then set :mongrel_conf in the
deploy.rb so that the standard deployment recipes would pick it up. The
effect of that would be that they would run:

mongrel_rails cluster::start -C ..../config/mongrel/staging.yml

When I tried it it seemed to make no difference at all which config file
I specified, it would always try and start 2 mongrels on ports 3000 and
3001.

I tried running the mongrel_rails command on the server by hand and
exactly the same thing happened. Am I barking up the wrong tree?
mongrel_rails cluster::start -h seems to imply that this should work:

Usage: mongrel_rails <command> [options]
    -C, --config PATH                Path to cluster configuration file
    -v, --verbose                    Print all called commands and
output.
    -h, --help                       Show this message
        --version                    Show version

Target platform is Ubuntu 7.04/Feisty, Mongrel 1.0.1, Ruby 1.8.5

-Chrisl
8f977c0870d57e52e488dc3546fb7f24?d=identicon&s=25 Raul (Guest)
on 2007-06-15 18:48
(Received via mailing list)
You know I had the same problem.  I'm no Linux guru so I'll just explain
to
the best of my ability how I overcame it.

I'm running Centos (Redhat) so I needed to set up the service so that my
mongrel_cluster will autostart my mongrels. I just made sure the symlink
in
the init.d folder on the production servers points to my production yml
file
since when I deploy it pushes both development and production yml files.

I don't know if that helps but after trying a bunch of stuff with the
app
configs and not being able to get it working I gave up and approached it
from outside the application and it works like a charm.



----- Original Message -----
From: "Chris Lilley" <ruby-forum-incoming@andreas-s.net>
To: <rubyonrails-deployment@googlegroups.com>
Sent: Friday, June 15, 2007 6:54 AM
Subject: [Rails-deploy] Mongrel & multiple config files
Fd55097df71dadea1288210b457eb33b?d=identicon&s=25 Chris Lilley (chrisl)
on 2007-06-18 15:52
Raul wrote:
> You know I had the same problem.  I'm no Linux guru so I'll just explain
> to
> the best of my ability how I overcame it.
>
> I'm running Centos (Redhat) so I needed to set up the service so that my
> mongrel_cluster will autostart my mongrels. I just made sure the symlink
> in
> the init.d folder on the production servers points to my production yml
> file
> since when I deploy it pushes both development and production yml files.
>
> I don't know if that helps but after trying a bunch of stuff with the
> app
> configs and not being able to get it working I gave up and approached it
> from outside the application and it works like a charm.

Thanks, Raul. For the time being I've backed off to using a single
mongrel instance rather than a cluster, but that's not ideal for
production, and will only become less and less so as traffic increases.
At the moment I have both staging and production environments running on
the same box, but I could probably arrange something like this as
they're obviously in completely separate directories.

I can't believe I'm unique in experiencing this. Anyone else?

-Chrisl
00b63fcbee806bb355d09853f4df9717?d=identicon&s=25 Paul H (Guest)
on 2007-06-23 08:33
(Received via mailing list)
>From the sound of it, I am having the same experience. I am running
both a staging and production environment all on one server. I have a
mongrel cluster for each environment. What I am finding is that
Capistrano is deploying everything right and restarting the cluster
for either staging or production but for some reason only one rails
app is actually running at a time. Its getting old. I can make a
requyest from either staging or production and I see both of the
request in the production log. I am stumped.

Paul

On Jun 18, 6:52 am, Chris Lilley <ruby-forum-incom...@andreas-s.net>
Fd55097df71dadea1288210b457eb33b?d=identicon&s=25 Chris Lilley (chrisl)
on 2007-06-29 11:05
(Received via mailing list)
On Jun 23, 7:32 am, Paul H <phepwo...@gmail.com> wrote:
> >From the sound of it, I am having the same experience. I am running
>
> both a staging and production environment all on one server. I have a
> mongrel cluster for each environment. What I am finding is that
> Capistrano is deploying everything right and restarting the cluster
> for either staging or production but for some reason only one rails
> app is actually running at a time. Its getting old. I can make a
> requyest from either staging or production and I see both of the
> request in the production log. I am stumped.

Y'know, I've just gone back to this and tried it again, and well, darn
it, it works perfectly.
The only thing that I've changed is that I've supplied the path to the
config file in full, and
not as a relative path. This is in the light of some problems I had
elsewhere, when I assumed
that Capistrano was running the remote processes in the deployment
directory, but it turned
out it was running them in /

I was mulling this over as I was going to sleep last night (as one
does) and wondered if that
had been the root of my problems. Looks like it might have been.

-Chrisl
8f977c0870d57e52e488dc3546fb7f24?d=identicon&s=25 Raul (Guest)
on 2007-06-29 16:28
(Received via mailing list)
hmm, thanks for the update.  I may give the full path route a try and
see if
it will work.  Then I can remove my symlink hack and scrap any
extraneous
documentation for server setup!

Raul

----- Original Message -----
From: "Chrisl" <chris.lilley@blackpepper.co.uk>
To: "Deploying Rails" <rubyonrails-deployment@googlegroups.com>
Sent: Friday, June 29, 2007 2:05 AM
Subject: [Rails-deploy] Re: Mongrel & multiple config files
This topic is locked and can not be replied to.