tags:

views:

43

answers:

1

I have 2 machines running same workers. One machine shoud be "primary" as it is very powerful, and the other machine should server as a backup for when primary machine goes down or crashes. When primary machine is up and running, all jobs should default to the primary machine for as long as there are available workers.

From my tests, I've noticed that gearmanD randomly picks a machine to send the job to. Is there any way at all to prioritize the machines to send jobs to?

Example:

Primary machine running 8 instasnces of the same worker Backup machine running 1 instance

Do: Use primary machine until it no more available workers are there to fullfill the job queue, then continue onto backup machine.

Any way of accomplishing this?

Thanks everyone!

A: 

I don't think this is possible with the current API. You could run 2 gearmand's though, one on each of your worker servers and set them both in the client, the powerful machine's first. This way, at least current versions of the client APIs I'm aware of, will first use the first gearmand and its workers and if that isn't available, it will switch to the second, which has the less powerful machine's workers...

mjy