Gearman安装及测试

1、本地环境安装html

服务器环境: Ubuntu 14.04python

 

1. 获取gearmand安装包git

> wget https://launchpad.net/gearmand/1.0/1.0.1/+download/gearmand-1.0.1.tar.gz服务器

> tar xzvf gearmand-1.0.1.tar.gz 测试

 

2. 配置ui

> cd gearmand.net

> ./configure --prefix=/usr/local/gearmandhtm

 

3. 解决包依赖问题【若是2执行出错,根据错误提示分别安装如下依赖包】get

configure: error: could not find boost 错误解决 源码

> apt-get install libboost-all-dev 

 

configure: error: could not find gperf 错误解决  

> apt-get install gperf

 

configure: error: Unable to find libevent 错误解决  

> apt-get install libevent-dev

 

configure: error: Unable to find libuuid 错误解决  

> apt-get install libuuid-devel

 

4.  Make

> make

> make install

 

5. 启动

> /usr/local/gearmand/sbin/gearmand -d -l /home/gearmandlogs/access.log

 

2、测试代码编写[Python]

Python 2.7

1. Python安装Gearman支持

>easy_install gearman

 

2. worker.py

图-2-001 worker.py

3. client.py

图-2-002 client.py

4. 执行效果截图

图-2-003 worker.py

图-2-004 client.py

3、源码地址

http://git.oschina.net/alan.h/Gearman-Python

4、参考资料

http://gearman.org/getting-started/

https://pythonhosted.org/gearman/library.html

相关文章
相关标签/搜索