Installing a Silva ZEO cluster
- Choose where to install the cluster:
PREFIX=$HOME/silva-cluster SRC=$PREFIX/src CLUSTER=$PREFIX/silva INST1=$CLUSTER/instance-1 INST2=$CLUSTER/instance-2 ZEO_SERVER=$CLUSTER/zeo-server SHARED_PRODUCTS=$CLUSTER/products mkdir -p $SRC $CLUSTER $SHARED_PRODUCTS
- Download and install Python 2.3:
cd $SRC wget http://www.python.org/ftp/python/2.3.6/Python-2.3.6.tgz tar xzfv Python-2.3.6.tgz cd Python-2.3.6 ./configure --prefix=$PREFIX make install
- Download and install libxml2:
cd $SRC wget ftp://ftp.xmlsoft.org/libxml2/libxml2-2.6.27.tar.gz tar xzfv libxml2-2.6.27.tar.gz cd libxml2-2.6.27 ./configure --prefix=$PREFIX --with-python=$PREFIX/bin/python make install
- Download and install libxslt2:
cd $SRC wget ftp://ftp.xmlsoft.org/libxml2/libxslt-1.1.19.tar.gz tar xzfv libxslt-1.1.19.tar.gz cd libxslt-1.1.19 ./configure --prefix=$PREFIX \ --with-libxml-prefix=$PREFIX \ --with-python=$PREFIX/bin/python make install - Download and install Python Imaging Library:
cd $SRC wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz tar xzfv Imaging-1.1.6.tar.gz cd Imaging-1.1.6 $PREFIX/bin/python setup.py install --home=$PREFIX
- Download and install Zope 2.8:
cd $SRC wget http://www.zope.org/Products/Zope/2.8.9.1/Zope-2.8.9.1-final.tgz tar xzfv Zope-2.8.9.1-final.tgz cd Zope-2.8.9.1-final ./configure --prefix=$PREFIX --with-python=$PREFIX/bin/python make install
- Create two Zope instances. These will be the ZEO clients. They
share one Products directory:
UNAME_PWD=mgr:mgrpw for CLIENT in $INST1 $INST2; do $PREFIX/bin/mkzopeinstance.py --dir $CLIENT --user $UNAME_PWD; rm -rf $CLIENT/Products ln -s $SHARED_PRODUCTS $CLIENT/Products done - Create the ZEO server:
$PREFIX/bin/mkzeoinstance.py $ZEO_SERVER
- Download and install Silva Products:
mkdir $SRC/Silva-1.5.10-all cd $SRC/Silva-1.5.10-all wget http://www.infrae.com/download/Silva/1.5.10/Silva-1.5.10-all.tgz tar xzfv Silva-1.5.10-all.tgz ln -s $PWD/* $SHARED_PRODUCTS/
- Configure both the clients and the server.
- Visit both $INST1/etc/zope.conf and $INST2/etc/zope.conf. In
both of them:
- Remove the # comments from the example of the 'zeo-client-name' directive, so that it is active.
- Remove the # comments from the 'zodb_db main' section under 'ZEO client storage:'. Remove (or comment out) the existing 'zodb_db main' section.
- In $INST2/etc/zope.conf remove the # comments from the example of the 'port-base' directive. Now $INST2 will serve on port 9080.
- Visit both $INST1/etc/zope.conf and $INST2/etc/zope.conf. In
both of them:
- Install your favourite load balancer. As an example, we're going
to install the Python Redirector load balancer:
cd $SRC wget http://surfnet.dl.sourceforge.net/sourceforge/pythondirector/pydirector-1.0.0.tar.gz tar xzfv pydirector-1.0.0.tar.gz cd pydirector-1.0.0 $PREFIX/bin/python setup.py install
- Configure the load balancer by creating a file called
$PREFIX/etc/pydir.xml. Look at the example in
$SRC/pydirector-1.0.0/doc/configure.txt and adjust it so that
the load balancer points to localhost:8080 and localhost:9080.
Look at the load balancer's documentation for more configuration options.
- Start all services:
$ZEO_SERVER/bin/zeoctl start $INST1/bin/zopectl start $INST2/bin/zopectl start $PREFIX/bin/pydir.py $PREFIX/etc/pydir.xml