./configure \これでhttpd -Mとやって
--enable-shared=so \
--enable-so \
--enable-module=all \
--enable-proxy \
--enable-rewrite \
--prefix=/opt/apps/apache2.2
proxy_balancer_moduleがいる事を確認。
### balancer.kapi.jpZope Zeo(ZODBサーバ)zope2.8*をインストール済み前提。
<VirtualHost *:80>
DocumentRoot /opt/www/document_root
ServerAdmin kapi@kapi.jp
ServerName balancer.kapi.jp
<Location /balancer-manager>
SetHandler balancer-manager
Order Deny,Allow
Deny from all
</Location>
ProxyRequests Off
ProxyPass / balancer://mycluster/ lbmethod=byrequests timeout=1
<Proxy balancer://mycluster/>
BalancerMember http://balancer.domain:8080/ loadfactor=10
BalancerMember http://balancer.domain:8081/ loadfactor=10
BalancerMember http://balancer.domain:8082/ loadfactor=10
</Proxy>
CustomLog /var/log/apache/balancer.kapi.jp_access_log combined
</VirtualHost>
./mkzeoinstance.py /opt/www/balancer.kapi.jp/zeoこれで上記パスにZeo環境が出来上がる。
./zeoctl startで起動。
./mkzopeinstance.pyここで作成するクライアントのZODBを使わず、ZeoのZODBを使うよう修正する。
Please choose a directory in which you'd like to install
Zope "instance home" files such as database files, configuration
files, etc.
Directory: /opt/www/balancer.kapi.jp/client1
user:
pass:
>
vi zope.conf同じ事をclient2 client3と行いポートを8081 8082とか作ってく。
...
...
effective-user kapi
...
...
#Productsも共通化したいので修正。
# products /home/chrism/projects/myproducts
products /opt/www/kapi.jp/Products
...
...
<http-server>
# valid keys are "address" and "force-connection-close"
address 8080
# force-connection-close on
</http-server>
...
...
#クライアントのZODB設定をコメントアウト
#<zodb_db main>
# # Main FileStorage database
# <filestorage>
# path $INSTANCE/var/Data.fs
# </filestorage>
# mount-point /
#</zodb_db>
...
...
#zeoのZODBを使うようにコメントを外す
<zodb_db main>
mount-point /
# ZODB cache, in number of objects
cache-size 5000
<zeoclient>
server localhost:8100
storage 1
name zeostorage
var $INSTANCE/var
# ZEO client cache, in bytes
cache-size 20MB
# Uncomment to have a persistent disk cache
#client zeo1
</zeoclient>
</zodb_db>
http://kapi.jp/kapi_blog/203
2009年01月13日
関連カテゴリ Zope