Package: zc.zkzopeserver
zc.zkzopeserverprovides a wrapper for the zope.server WSGI runner
that registers with ZooKeeper.  By registering with ZooKeeper, you can
let the operating system assign ports and have clients find your
server by looking in ZooKeeper.Basic UsageThe wrapper is used in a past-deploy configuration file:[server:main]
use = egg:zc.zkzopeserver
zookeeper = zookeeper.example.com:2181
path = /fooservice/providersThe wrapper supports the following options:zookeeperrequired ZooKeeper connection stringpathrequired path at which to register your serverYour server is registered by adding a ZooKeeper ephemeral node as a
child of the path with the server address as the name.hosthost name or ip to listen on, defaulting to ‘’portThe port to listen on, defaulting to 0session_timeoutA ZooKeeper session timeout in millisecondsthreadsThe size of the thread pool, defaulting to 1monitor_serverAzc.monitorserver address.The value is an address of the form HOST:PORT.  SeeMonitor
serverbelow. (Host can be empty to listen on all interfaces.)loggersLogging configuration.This can be one of:A logging level name (CRITICAL, ERROR, WARNING, INFO, or DEBUG),
orA ZConfig loggers-definition string.If the configuration includes format strings, you’ll need to use
double dollar signs rather than %, as in:format $$(message)sThis is necessary due to the use of string formats in the Paste
Deployment configuration syntax.Monitor serverThezc.monitorpackage
provides a simple extensible command server for gathering monitoring
data or providing run-time control of servers.  Ifzc.monitoris
in the Python path,zc.zkzopeservercan start a monitor server
and make it’s address available as themonitorproperty of a
server’s ephemeral port.  To see how this works, let’s update the
earler example:[server:main]
use = egg:zc.zkzopeserver
zookeeper = zookeeper.example.com:2181
path = /fooservice/providers
monitor_server = 127.0.0.1:0When our web server is running, the/fooservice/providersnode
would look something like:/providers
  /1.2.3.4:61181
    monitor = u'127.0.0.1:61182'
    pid = 4525Some notes on the monitor server:A monitor server won’t be useful unless you’ve registered some
command plugins.zc.monitorisn’t a dependency ofzc.zkzopeserverand won’t
be in the Python path unless you install it.zc.zservertracslogintegrationThe packagezc.zservertracelogextends zope.server to provide
support for “trace” logs that have multiple log entries per web
request as a request goes through various stages.If you want to usezc.zservertraeslogwithzc.zkzopeserver,
make surezc.zservertracelogis in your Python path and include
thezservertracelogoption in your server section:[server:main]
use = egg:zc.zkzopeserver
zookeeper = zookeeper.example.com:2181
path = /fooservice/providers
monitor_server = 127.0.0.1:0
zservertracelog = trueChange History0.3.0 (2012-02-02)Added logging-configuration support.Fixed: servers were registered with the host information returned by
socket.getsockname(), which was unhelpful.Fixed: Killing a server (with SIGTERM) didn’t shut down the
ZooKeeper connection cleanly, causing a delay in removing registered
ephemeral nodes.0.2.0 (2012-01-18)Added optional support for using zc.zservertracelog to generate trace logs.0.1.0 (2011-12-11)Initial release