关注一下张宴的这篇【利用开源的Gearman框架构建分布式图片处理平台】,网址为:http://blog.s135.com/dips/
正如张宴一开始说的:
如何把这些闲置资源利用起来才是真的。之所以不转载,是因为,我目前还遇不到这类事情,但了解一下总是好的。。。
顺便转载了PPT和一些软件的安装
ksg_xoyo_dips.pdf
附1:Gearman分布式计算框架网址
http://gearman.org/
附2:PHP客户端Gearman扩展安装:
wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
tar zxvf libevent-1.4.12-stable.tar.gz
cd libevent-1.4.12-stable/
./configure --prefix=/usr
make && make install
/sbin/ldconfig
cd ../
wget http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz
tar zxvf gearmand-0.9.tar.gz
cd gearmand-0.9/
./configure
make
make install
/sbin/ldconfig
cd ../
wget http://pecl.php.net/get/gearman-0.5.0.tgz
tar zxvf gearman-0.5.0.tgz
cd gearman-0.5.0
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-gearman
make
make install
cd ../
tar zxvf libevent-1.4.12-stable.tar.gz
cd libevent-1.4.12-stable/
./configure --prefix=/usr
make && make install
/sbin/ldconfig
cd ../
wget http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz
tar zxvf gearmand-0.9.tar.gz
cd gearmand-0.9/
./configure
make
make install
/sbin/ldconfig
cd ../
wget http://pecl.php.net/get/gearman-0.5.0.tgz
tar zxvf gearman-0.5.0.tgz
cd gearman-0.5.0
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-gearman
make
make install
cd ../
php.ini文件中增加:
extension = "gearman.so"
附3:Gearman调度器安装(JOB Server):
wget http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz
tar zxvf gearmand-0.9.tar.gz
cd gearmand-0.9/
./configure
make
make install
/sbin/ldconfig
cd ../
tar zxvf gearmand-0.9.tar.gz
cd gearmand-0.9/
./configure
make
make install
/sbin/ldconfig
cd ../
以守护进程启动:
gearmand -L 192.168.0.1 -p 4730 -u root -d