久しぶりに日本酒.
- 豊香
- 白岳仙
- 冬華
を飲む.
reverse proxy 兼 laod balancer の Pound をいじってみたのでメモ.
(読みはポンド?パウンド?)
WHAT POUND IS:
1. a reverse-proxy: it passes requests from client browsers to one or more back-end servers.
2. a load balancer: it will distribute the requests from the client browsers among several back-end servers, while keeping session information.
3. an SSL wrapper: Pound will decrypt HTTPS requests from client browsers and pass them as plain HTTP to the back-end servers.
4. an HTTP/HTTPS sanitizer: Pound will verify requests for correctness and accept only well-formed ones.
5. a fail over-server: should a back-end server fail, Pound will take note of the fact and stop passing requests to it until it recovers.
6. a request redirector: requests may be distributed among servers according to the requested URL.
yum --enablerepo=rpmforge install pound
単純な設定(/etc/pound.cfg)
User "nobody"
Group "nobody"
Alive 60
## Main listening ports
ListenHTTP
Address 192.168.74.101
Port 10080
Client 20
End
# 振分け設定
Service
BackEnd
Address 192.168.74.101
Port 80
Priority 5
End
BackEnd
Address 192.168.74.102
Port 80
Priority 5
End
Session
Type Cookie # Cookie でセッション管理
ID "session_id" # session_id の値をみる
TTL 300
End
End
待受 IP アドレス・ポートの組み合わせで振分け先を変更するには
ListenHTTP 内に Service を定義する.
ListenHTTP は複数指定可能.
ListenHTTP
Address 192.168.74.101
Port 10080
Client 20
Service
BackEnd
Address 192.168.74.101
Port 80
Priority 5
End
End
End
セッション管理は
クライアント IP アドレス
Session
Type IP
TTL 300
End
Cookie
Session
Type Cookie
ID "session_id"
TTL 300
End
URL parameter (http://example.com/?id=xxxx)
Session
Type URL
ID "id"
TTL 300
End
HTTP parameter (http://example.com/:parameter)
Session
Type PARM
TTL 300
End
などでセッション管理が可能.
設定は簡単だし,扱いやすいかもしれない.
- Apsis Gmbh
http://www.apsis.ch/pound/