Cups Failover

Michael Sweet mike at easysw.com
Wed Sep 20 12:13:09 PDT 2006


Ricky wrote:
> Hello,
> 
> I am wondering can cups do failover? I want to have two print
> servers... ServerA and ServerB, both servers hosting same print jobs,
> that way if ServerA goes out I will still have ServerB up and running
> print jobs. How would I go about setting this up? Will I just do the
> exact same configuration on both servers? Also how will one server
> know the other have failed? Will I have to do binding; if so what
> will I have to bind?

Short answer:

Yes, absolutely!  Just setup 2 or more servers sharing the same set
of printers and the clients will automatically round-robin and fail-
over if a server goes down.

Long answer:

CUPS has always offered automatic load-balancing and fail-safe
printing since v1.0.  The way it is implemented is simple: clients
manage a list of available printers on the network that are being
shared by a server.  If 2 or more servers share the same printer
(CUPS just compares the printer names), then the clients will join
these queues into an "implicit" class.  Users then only see the
implicit class and the client's cupsd program will switch among the
available servers when sending print jobs to the class.  If one of
the servers/printers in the class goes down, the job is resubmitted
on the next server/printer in the class.

The same functionality is provided by ordinary classes as well, so
you can setup classes of similar printers that don't share the same
name and still get the same functionality.

The easiest way to set this up is to create all of the printers on
one server and then copy the /etc/cups/printers.conf and
/etc/cups/ppd/*.ppd files from one server to the others.  You'll
want to stop the cupsd program on the other servers before doing
the copies and then restart the cupsd program afterwards.  You'll
also need to enable printer sharing on each server (part of the
/etc/cups/cupsd.conf file), which can be done on the web admin
page with a couple clicks.

If the clients are on the same subnet as the servers, that is all
you need to do (with the standard CUPS configuration).  If not,
you'll also need to add BrowsePoll and BrowseRelay lines to the
cupsd.conf file on a few clients on each subnet with:

     BrowsePoll server1
     BrowsePoll server2
     ...
     BrowsePoll serverN
     BrowseRelay 127.0.0.1 @LOCAL

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com




More information about the cups mailing list