Mongrel Clusters on Windows

I have set-up mongrel clusters by individual steps. What I mean by this
is that I tried to use mongrel_clusters plugin and failed.

Using mongrel clusters I did:

mongrel_rails cluster::configure -e development \ -p 8200 -N 3 -c
C:\a_public_xyz\webside -a 127.0.0.1

This worked but the next step failed:

mongrel_rails cluster::start

I have read on some posts that mongrel clusters is not supported on
windows (Windows 2000 in my case)

So I have done the following individual steps, and everything works.

mongrel_rails service::install -N app_C1 -c C:\a_public_xyz\webside -p
8201 -e development

I did this for a further 2 ports, 8202 and 8203

Then I started the services manually i.e. net start app_C1

then in my apache httpd.conf file I added:

dont worry about my name wibble.com, it is only on my PC, that is not on
the net.

<Proxy balancer://wibblecluster>
BalancerMember http://127.0.0.1:8201
BalancerMember http://127.0.0.1:8202
BalancerMember http://127.0.0.1:8203

<VirtualHost *:80>
ServerName wibble.com

ProxyPass / balancer://wibblecluster/
ProxyPassReverse / balancer://wibblecluster/
ProxyPreserveHost on

<Location /balancer-manager>
SetHandler balancer-manager

I restart apache, and I can run my rails app 100%

My question is what am I missing from not using mongrel cluster plugin.

Is there any downside to what I have done.

I know that I need to start all the mongrel and apache services
automatically when windows starts.

At the moment windows is my only option, I don’t want *nix, unless I am
really forced to it.

I read on a post that mongrel clusters after version 1 will be
deprecated is this correct?

What are the long term plans for having rails served by multiple
servers?

Andrew

Andrew C. wrote:

I have set-up mongrel clusters by individual steps. What I mean by this
is that I tried to use mongrel_clusters plugin and failed.

Using mongrel clusters I did:

mongrel_rails cluster::configure -e development \ -p 8200 -N 3 -c
C:\a_public_xyz\webside -a 127.0.0.1

This worked but the next step failed:

mongrel_rails cluster::start

I have read on some posts that mongrel clusters is not supported on
windows (Windows 2000 in my case)

Yes, mongrel_cluster relies on daemonize functionality, only available
on *nix platforms.

Also, there ins’t a “serviceable” mongrel_cluster (run it as windows
service) so couldn’t be configured to start with windows automatically.

So I have done the following individual steps, and everything works.

mongrel_rails service::install -N app_C1 -c C:\a_public_xyz\webside -p
8201 -e development

I did this for a further 2 ports, 8202 and 8203

Then I started the services manually i.e. net start app_C1

then in my apache httpd.conf file I added:

dont worry about my name wibble.com, it is only on my PC, that is not on
the net.

<Proxy balancer://wibblecluster>
BalancerMember http://127.0.0.1:8201
BalancerMember http://127.0.0.1:8202
BalancerMember http://127.0.0.1:8203

<VirtualHost *:80>
ServerName wibble.com

ProxyPass / balancer://wibblecluster/
ProxyPassReverse / balancer://wibblecluster/
ProxyPreserveHost on

<Location /balancer-manager>
SetHandler balancer-manager

I restart apache, and I can run my rails app 100%

My question is what am I missing from not using mongrel cluster plugin.

Nothing, mongrel_cluster is just a shortcut (on *nix platforms) to do
the same things, also impersonating the process (change user and group,
something know on Windows Log On with Account in Services Manager).

Also, at no cost, you get a lightweight, simple process monitoring that
will respawn each mongrel_service if the ruby process dies (something
that I have seen happens, more than I wanted to).

Is there any downside to what I have done.

Take notice that you’re setting all your mongrels to run in development
mode, unless thats what you want, please use production to get better
results.

Besides that, everything seems ok.

I know that I need to start all the mongrel and apache services
automatically when windows starts.

That is a question? or just a rethoric?

At the moment windows is my only option, I don’t want *nix, unless I am
really forced to it.

I read on a post that mongrel clusters after version 1 will be
deprecated is this correct?

Well, that was part of the idea with Zed, but still no plans when this
will happen.

What are the long term plans for having rails served by multiple
servers?

What do you mean by this? Serve the same application from multiple
computers?

If so, you need to configure your Apache balancer to point secondary
computer IP:PORT for each mongrel running in it.

That isn’t reliable AFAIK, since application code and page/fragment
cache must be shared to get a good performance in production.

Luis,

I was thinking about what I had done last night and came to the
conclusion that it was the process monitoring and the automatic restarts
that I was missing. The example I gave you was my test in a development
environment, obviously I would change for Production.

I am a Windows developer myself, but am thinking of moving to *nix, but
my client is windows so I have to fit in with their systems. But the
lack of a resilient mongrel cluster on windows may force my client to
nix, this is a hard one for me as I had not expected mongrel clusters to
be ‘unavailable’ on windows. Maybe next time I set-up the desired
environment first then develop the system.

Thanks Andrew

Andrew C. wrote:

Luis,

I was thinking about what I had done last night and came to the
conclusion that it was the process monitoring and the automatic restarts
that I was missing. The example I gave you was my test in a development
environment, obviously I would change for Production.

Err, the process monitoring and automatic restart is part of
mongrel_service and not mongrel_cluster I must correct.

On *nix, you need to fall into external monitoring solutions (monit came
to my mind).

I am a Windows developer myself, but am thinking of moving to *nix, but
my client is windows so I have to fit in with their systems. But the
lack of a resilient mongrel cluster on windows may force my client to
nix, this is a hard one for me as I had not expected mongrel clusters to
be ‘unavailable’ on windows. Maybe next time I set-up the desired
environment first then develop the system.

I understand what you feel about this, but I, as windows developer,
deploy most of the time under windows (for the same reason as you).

I created mongrel_service to ease deploying of Rails under Windows, not
to dismiss everyone’s attempts and force them to switch to *nix.

The cluster, by itself is just a wrapper around several mongrel_rails
start -p BASE_PORT + n, where n is the iteration of the cluster member
(2 servers: BASE_PORT + 0, BASE_PORT + 1).

In that escense, don’t differ from mongrel_service.

A few problems around mongrel_cluster came to my mind right now, often
associated with pid files and restarting individual members of the
cluster.

I have plans to provide same functionality of clusters as 1, single
service under service manager, but more important things are priority:

Logging (since no mongrel or service under windows log its results

into log/mongrel.log)

Correct path quotation and command line parsing (since often you

install Ruby into C:\Program Files, which have spaces in the path).

YAML configuration parsing, instad of rely on mongrel_rails (this will

faster cluster functionality for services).

Anyway, nor Windows, Mongrel, mongrel_service or mongrel_cluster are
perfect. If you find something that doesn’t work (or not as expected),
just dig into the code and patch :slight_smile:

Thats the beauty of OSS :slight_smile:

Thanks Andrew

Good luck,

Luis L.
Multimedia systems