其中,Redis实例 127.0.0.1:6379 和 Memcache实例 127.0.0.1:11211 127.0.0.1:11212 请预先启动好。
/etc/init.d/redis_6379 start /usr/local/memcached-1.4.20/bin/memcached -d -m 64 -l 127.0.0.1 -p 11211 -u root /usr/local/memcached-1.4.20/bin/memcached -d -m 64 -l 127.0.0.1 -p 11212 -u root
测试
https://github.com/billfeller/billfeller.github.io/blob/master/code/twenproxyTest.php
启动服务:
[root@/usr/local/nutcracker/conf]# nutcracker -c nutcracker.yml [Sun Dec 14 20:59:04 2014] nc.c:187 nutcracker-0.3.0 built for Linux 2.6.32-431.23.3.el6.x86_64 x86_64 started on pid 14359 [Sun Dec 14 20:59:04 2014] nc.c:192 run, rabbit run / dig that hole, forget the sun / and when at last the work is done / don't sit down / it's time to dig another one
执行测试脚本:
[root@~/wade/git/billfeller.github.io/code]# /usr/local/php/bin/php twenproxyTest.php bool(true) string(1) "1" int(1) bool(false) bool(true) int(2) bool(true) int(3) bool(true) bool(false)