diff --git a/README.md b/README.md index 15da272..c416fa0 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Features: * lua-cjson * redis -> > 注意:建议选用openresty最新版,但是从openresty-1.9.15.1开始,lua-resty-core有些api变更,因此建议先使用openresty-1.9.7.5及以下,原因是:[必读](https://github.com/CNSRE/ABTestingGateway/issues/27#issuecomment-236149255) +> > 注意:建议选用openresty最新版,但是从openresty-1.9.15.1开始,lua-resty-core有些api变更,因此建议先使用openresty-1.9.7.5,原因是:[必读](https://github.com/CNSRE/ABTestingGateway/issues/27#issuecomment-236149255) > > 注意:tengine用户仍然可以使用本项目,只需要从openresty软件包中获取最新的ngx_lua、LuaJIT以及lua-cjson等,并注意:[必读](https://github.com/CNSRE/ABTestingGateway/issues/27#issuecomment-236149255) @@ -72,7 +72,7 @@ repo中的`utils/conf`文件夹中有灰度系统部署所需的最小示例 ```bash 1. git clone https://github.com/SinaMSRE/ABTestingGateway -2. cd /path/to/ABTestingGateway/utils +2. cd /path/to/ABTestingGateway/utils && mkdir logs # 启动redis数据库 3. redis-server conf/redis.conf diff --git a/lib/abtesting/adapter/policy.lua b/lib/abtesting/adapter/policy.lua index b3333a1..1325535 100644 --- a/lib/abtesting/adapter/policy.lua +++ b/lib/abtesting/adapter/policy.lua @@ -106,7 +106,7 @@ _M.del = function(self, id) local database = self.database local baseLibrary = self.baseLibrary - local policyLib = baseLibrary .. ':' .. id + local policyLib = baseLibrary .. ':' .. id .. ':' local keys, err = database:keys(policyLib..'*') if not keys then diff --git a/utils/conf/default.conf b/utils/conf/default.conf index 1fc91bc..6de632a 100644 --- a/utils/conf/default.conf +++ b/utils/conf/default.conf @@ -21,7 +21,7 @@ server { set $redis_host '127.0.0.1'; set $redis_port '6379'; - set $redis_uds '/tmp/redis.sock'; + set $redis_uds '/var/run/redis.sock'; set $redis_connect_timeout 10000; set $redis_dbid 0; diff --git a/utils/conf/redis.conf b/utils/conf/redis.conf index 4b99b22..f8154ab 100644 --- a/utils/conf/redis.conf +++ b/utils/conf/redis.conf @@ -33,7 +33,7 @@ port 6379 # incoming connections. There is no default, so Redis will not listen # on a unix socket when not specified. # -unixsocket /tmp/redis.sock +unixsocket /var/run/redis.sock unixsocketperm 766 # Close the connection after a client is idle for N seconds (0 to disable) diff --git a/utils/conf/vhost.conf b/utils/conf/vhost.conf index 564b41d..8868bf1 100644 --- a/utils/conf/vhost.conf +++ b/utils/conf/vhost.conf @@ -17,7 +17,7 @@ server { set $redis_host '127.0.0.1'; set $redis_port '6379'; - set $redis_uds '/tmp/redis.sock'; + set $redis_uds '/var/run/redis.sock'; set $redis_connect_timeout 10000; set $redis_dbid 0; set $redis_pool_size 1000; diff --git a/utils/stop-all-nginx.sh b/utils/stop-all-nginx.sh new file mode 100644 index 0000000..f2e3133 --- /dev/null +++ b/utils/stop-all-nginx.sh @@ -0,0 +1,8 @@ +rm *temp -rf + +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/nginx.conf -s stop +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/stable.conf -s stop +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/beta1.conf -s stop +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/beta2.conf -s stop +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/beta3.conf -s stop +/usr/local/nginx/sbin/nginx -p `pwd` -c conf/beta4.conf -s stop