HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] hylafax dual-server failover/load balanced



John,

You're looking to do something which is possible, with a couple *big*
caveats, but you're going to have to be a expert NFS + Linux admin if
you want to do it write.  If you are, he's a basic outline of what
you're going to have to do (and why).

Make sure that you never *start* faxq with jobs in the queue.  You can
share your "queue filesystem", but you can still only let 1 faxq have
a job at a time.  Once your HylaFAX is running, each hfaxd will talk
to it's local faxq FIFO, and faxq will never "scan all sendq
directory", so jobs will stay with the faxq that thinks it's operating
on it.  But you won't have an easy way to know which job is in which
server (unless you look at logs), and for instance, and restarting a
faxq on a server for some reason becomes a carefull process of
stopping both, reemoving all qfiles, tsarting them, and then
hand-feeding q-files back in to individual faxqs.

You're going to need your NFS mount to be visible (mounted) somewhere
under /var/spool/hylafax.  Because parts of HylaFAX are chrooted.

You giong to have to make a shared directory structure in your shared
root similar to the normal HylaFAX spool, and then symlink the local
directories into your shared NFS directores.  At a minimum, you'll
need:
    sendq
    recvq
    doneq
    log
    docq
    pollq
    tmp

You'll need all of those, because HylaFAX expects to be able to
hard-link files between directories, and have them work.  That means
they have to be on the same filesystem (i.e. all in your NFS)

You're gong to need to make sure you have reliable NFS locking, and
that everyting (statd/lockd) are always running when the shared NFS is
mounted/used by HylaFAX.

You're going to have to make sure that you compile HylaFAX using your
reilable NFS locking scheme.  See configure and port/flock.  You may
need to "emulate" the flock using your fcntl.  Test, test, and double
test.  Getting your locking wrong, and youre HylaFAX will dual with
eachother and nothing will get done.

Again, HylaFAX over NFS works as long as your NFS implementation is
such that everything works.  Everything being real locking, and
hard-links.  But even if HylaFAX over NFS works, you've got to do all
the work to make sure that jobs are "owned" by only 1 of the servers.
They can't share the *jobs* though, in theory, they can share the
filesystem under the jobs.


All in all, I think you're probably much better running 2 seperate
HylaFAX servers, independantly, in tandem, and preparing a "recovery"
process that you use when a server breaks to import it's queued jobs
into the still-available server.


a.


On Wed, Nov 10, 2010 at 4:32 AM, Johan Viviers <johan.viviers@xxxxxxxxxx> wrote:
> Hi
>
>
>
> We are trying to run two hylafax servers in a load balanced setup, using the
> same jobid.
>
> The servers run Redhat linux 5 with hylafax 6.0.4.
>
>
>
> Please let me know if there is a recommended way of doing this, or if you’ve
> had any success in load balancing two servers.
>
>
>
> What I’ve done so far:
>
>
>
>  I have tried to replace the ‘sendq/seqf’ file with a symbolic link to a
> seqf file on an NFS mount shared between the servers, but hylafax returns
> the following error:
>
>
>
> “503 Unable to open sequence number file sendq/seqf; No such file or
> directory..”
>
>
>
> Permission and ownership of the seqf file is correct.
>
> The other option is to share the entire sendq directory or hylafax home
> between the servers.
>
> I’m not sure if this is possible as it will cause other complications with
> config etc.
>
>
>
> Thank you
>
> Johan Viviers
>
>
>
>



-- 
Aidan Van Dyk                                             Create like a god,
aidan@xxxxxxxxxxx                                       command like a king,
http://www.highrise.ca/                                   work like a slave.


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions