Gearman Install on Ubuntu

gearman 在ubuntu 上不知哪個版本已無提供libdrizzlea模組.
導致要使用myql作為資料源已無法使用.
以下是自行編譯安裝方式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ sudo -s
$ add-apt-repository ppa:gearman-developers/ppa
$ apt-get update
$ apt-get install libevent-dev gearman libgearman4 libgearman-dev libdrizzle0 libboost-program-options-dev libboost1.46-dev libboost-program-options-dev uuid-dev g++ libmemcache-dev libcloog-ppl0
$ wget https://launchpad.net/ubuntu/lucid/+source/libdrizzle/0.7-1/+files/libdrizzle_0.7.orig.tar.gz
$ tar zxvf libdrizzle_0.7.orig.tar.gz
$ cd libdrizzle-0.7/
$ ./configure
$ make
$ make install
$ cd..
$ wget http://launchpad.net/gearmand/trunk/0.14/+download/gearmand-0.14.tar.gz
$ tar zxvf gearmand-0.14.tar.gz
$ cd gearmand-0.14/
 
$ ./configure libdrizzle_CFLAGS="-I/usr/local/include" libdrizzle_LIBS="-L/usr/local/lib -ldrizzle"
$ make
$ make install
$ cd ..
$ wget http://pecl.php.net/get/gearman-0.8.0.tgz
$ pecl install gearman-0.8.0.tgz
$ vi /etc/php5/conf.d/gearman.ini
==== 加入 ====
extension=gearman.so
$ vi /etc/init.d/gearman-job-server
=====編輯====
prefix=/usr/local
PARAMS="--queue-type=libdrizzle --libdrizzle-host=mysql主機ip --libdrizzle-user=mysql帳號 --libdrizzle-password=mysql主機ip --libdrizzle-db=gearman --libdrizzle-table=gearman_queue --libdrizzle-mysql"
====加上註解====
#test -f /etc/default/gearman-job-server && . /etc/default/gearman-job-server
========================
DB gearman  要自行在mysql新增 資料表他自行會建立
$ service gearman-job-server start

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *