how to use load balancing and failsafe operation?

angelb angelb at bugarin.us
Sat May 20 00:59:32 PDT 2006


> If so, is there a way to copy the list and definition of the printers on server to another?  And how do I keep them synchronized if I need to modify the configuration of a printer?
>

One way I am able to sync our printers between our two servers is to
force admin users and myself to use the script which I created. The
script is basically a menu system, "CUPS Administration Menu", which
allows the admin to add, delete, change, etc on one server and it will
automagically do the same process to the other server(regardless of
which server it was initiated from) by means of a remote ssh command.

Using a scripted menu, you can really customize it and keep it
relatively secured. With over 1100 printers, I'd say it has been working
pretty well. The menu I have looks something like this:

                          CUPS Administration Menu


                                MAIN MENU


           1. ADD a printer queue       5. DELETE a printer queue
           2. TEST a printer queue      6. MODIFY a printer queue
           3. START a printer queue     7. DISPLAY queue status
           4. STOP a printer queue      8. CHECK servers synced status


           Audit Logs
           ----------
           /etc/opt/TWWfsw/cups1123/printers.basis:
           Contains printer informations, IP address, Location, etc.

           /var/log/cups/user_log:
           Contains printer changes, add, delete, etc.


Options [1-8] or (e)xit:


It's nothing fancy but simple to use and very effective. I'm sure you
can do something simillar. The following is a piece of the function(not quite finished) I used for Option 8:

function syncServers
{
    # Check servers printer configurations to see that they
    # are in sync'd.
    #
    print "\n"
    if [[ $(hostname -s) == "stlpr500" ]]
    then
       scp stlpr502:$printerslist $tmp > /dev/null 2>&1
       print "\nRetrieving second server's printers list..."
       print "\nNow making comparisons... <=stlpr500  stlpr502=>"
    else
       scp stlpr500:$printerslist $tmp > /dev/null 2>&1
       print "\nRetrieving second server's printers list..."
       print "\nNow making comparisons... <=stlpr502  stlpr500=>"
    fi
       diff $printerslist $tmp/printers.conf
}

I'm working on porting it to Python using curses... :)

Good luck!

Angel






More information about the cups mailing list