18
0
Bifurcation 0
wiki/HowtoGearman.md

963 B

Cette page a été importée automatiquement de notre ancien wiki mais n'a pas encore été révisée.

Howto Gearman

Installation :

# aptitude install gearman gearman-job-server

Vérification du statut / fonctionnement :

$ telnet 127.0.0.1 4730

STATUS
foo           310     2       2
bar           0       0       1
coin          0       0       1
plop          0       0       1
.

WORKERS
14 127.0.0.1 - :
13 127.0.0.1 - : foo
12 127.0.0.1 - : bar coin plop
11 127.0.0.1 - : foo
.

Utilisation avec PHP :

$ pecl download gearman-1.0.3
$ dh-make-pecl --phpversion 5 --prefix php5- gearman-1.0.3.tgz
$ cd php5-gearman-1.0.3/
$ ./debian/rules binary
# dpkg -i ../php5-gearman_1.0.3-1_amd64.deb

Note : si vous obtenez des erreurs du type PHP Fatal error: Uncaught exception 'GearmanException' with message 'Failed to set exception option

Précisez le HOST et PORT pour la fonction addServer : addServer("127.0.0.1", 4730)