PyBal

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(CVS)
(multiple services, dryrun)
Line 18: Line 18:
  
 
Configuration is in <tt>/etc/pybal/</tt>. <tt>pybal.conf</tt> defines the LVS service parameters, <tt>squids</tt> defines the list of real Squid servers. The format should be fairly self explanatory; they're both more or less using Python assignment / dictionary syntax.
 
Configuration is in <tt>/etc/pybal/</tt>. <tt>pybal.conf</tt> defines the LVS service parameters, <tt>squids</tt> defines the list of real Squid servers. The format should be fairly self explanatory; they're both more or less using Python assignment / dictionary syntax.
 +
 +
PyBal supports multiple LVS services through a single instance and configuration file <tt>pybal.conf</tt>, e.g.:
 +
<pre>
 +
[text]
 +
protocol = tcp
 +
ip = 145.97.39.155
 +
port = 80
 +
scheduler = wlc
 +
config = file:///etc/pybal/text-squids
 +
 +
[images]
 +
protocol = tcp
 +
ip = 145.97.39.156
 +
port = 80
 +
scheduler = wlc
 +
config = file:///etc/pybal/img-squids
 +
</pre>
 +
 +
'''Beware''', the code as checked out from Subversion has '''<tt>DryRun = True</tt>''' set in <tt>ipvs.py</tt>, meaning that it will not modify any actual IPVS state but only show the commands for debugging. This should be changed to a commandline option, but for now edit that file to <tt>DryRun = False</tt>.

Revision as of 22:36, 19 August 2006

PyBal is a LVS monitoring script quite similar to lvsmon. It's written in Python using the Twisted framework.

At this moment, just a few features distinguish it from lvsmon:

  • It's using asynchronous communication, and thus runs all checks in parallel instead of sequentially
  • It has an extra monitoring method called IdleConnection, which keeps an idle connection open to all squids, and therefore notices immediately when the Squid processes are shut down / crashing
  • It can fetch server lists over HTTP as well as from the local filesystems

...but I intend to polish it more, and extend it with useful things.

The script is in MediaWiki CVS, module pybal.

-- Mark

Setup

PyBal is currently installed on Pascal, in directory /usr/local/pybal/, and runs in a screen using the command:

# python /usr/local/pybal/pybal.py

(but it will be a proper daemon soon)

Configuration is in /etc/pybal/. pybal.conf defines the LVS service parameters, squids defines the list of real Squid servers. The format should be fairly self explanatory; they're both more or less using Python assignment / dictionary syntax.

PyBal supports multiple LVS services through a single instance and configuration file pybal.conf, e.g.:

[text]
protocol = tcp
ip = 145.97.39.155
port = 80
scheduler = wlc
config = file:///etc/pybal/text-squids

[images]
protocol = tcp
ip = 145.97.39.156
port = 80
scheduler = wlc
config = file:///etc/pybal/img-squids

Beware, the code as checked out from Subversion has DryRun = True set in ipvs.py, meaning that it will not modify any actual IPVS state but only show the commands for debugging. This should be changed to a commandline option, but for now edit that file to DryRun = False.

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox