`
waenwj
  • 浏览: 4803 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

Plone ZEO 与 Nginx的配置

阅读更多
plone安装时执行: ./install.sh zeo 
plone运行执行: ./bin/plonectl start

默认有2个client,自己手动加了一个:
Plone/zeocluster/base.cfg中添加
[client3]
# a copy of client1, except adjusted address and var location
<= client1  #竟然有这种语法太方便了,
http-address = ${buildout:client3-address}
event-log = ${buildout:directory}/var/client3/event.log
z3-log    = ${buildout:directory}/var/client3/Z3.log
pid-file  = ${buildout:directory}/var/client3/client3.pid
lock-file = ${buildout:directory}/var/client3/client3.lock

Plone/zeocluster/buildout.cfg中添加配置:
# Zope client 1  本来就有
http-address = 8080
# Zope client 2  本来就有
client2-address = 8081
# Zope client 3  手动加到
client3-address = 8082 

好了,buildout下 ./bin/buildout
下面不用重启整个plone,可以运行 ./bin/restartclients 它会一个一个到重启clients保证服务可以,以后正式发布后到修改可以用到。

-------------------------后台服务-----好了----------------------------
安装nginx。。。。。Finish。。。。

nginx.conf 中修改部分
http {
    upstream backend {
        # ip_hash;   NOTE1
        server 127.0.0.1:8080;
        server 127.0.0.1:8081;
        server 127.0.0.1:8082;
    }
    server {
        listen       80;
        server_name  localhost;
        charset utf-8;
    location / {
	rewrite ^(.*)$ /VirtualHostBase/http/$http_host:80/VirtualHostRoot$1 break;  #NOTE2
	proxy_pass   http://backend;
	proxy_set_header X-Real-IP $remote_addr;
    }
}

NOTE1: ip_hash; 按照ip不同分配执行server 。。刚开始配置的时候,傻傻得加了这句话,结果用httperf测试没变化..  因为,因为我都是在本地测试,ip只有一个,nginx把所有请求都发一个server了。。。
NOTE2:没有这句还真不行,想来一下,其实就是Zope开了个接口说:你来骗我吧。 nginx说:看了下接口规则说哦,这么骗啊,知道了。       就有了这句rewrite。

创建一个site默认的 http://localhost/Plone。

httperf测试:
测nginx: httperf --client=0/1 --server=localhost --port=80 --uri=/Plone --rate=100 --send-buffer=4096 --recv-buffer=16384 --num-conns=2000 --num-calls=1
测单个client:httperf --client=0/1 --server=localhost --port=8080 --uri=/Plone --rate=100 --send-buffer=4096 --recv-buffer=16384 --num-conns=2000 --num-calls=1
只有端口号到区别。。

测试结果: 还行吧,没有期望到那么好。 后面加上cache再试。

ps: yum install openssl-devel
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics