1.gearmand-1.1.12.tar.gz 解压编译即用
报错及解决:
1)configure: error: could not find boost
yum install boost-devel*
2)configure: error: could not find gperf
yum install gperf*
3)configure: error: Unable to find libevent
yum install libevent-devel*
4)configure: error: Unable to find libuuid
yum install libuuid-devel
启动: gearmand -d -L 0.0.0.0 &
停止: killall gearmand
2.lsof |grep gearmand查看gearmand的连接情况
3.gearmand的持久化处理
在系统中要先装mysql,再装gearmand时才会适配mysql的持久话
解决libmysqlclient.so.18: cannot open shared object file: no such file or directory failed问题
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib
1
2
3
4
5
6
7
8
|
create database gearman
create table `gearman_queue` (
`unique_key` varchar(
64
) NOT NULL,
`function_name` varchar(
255
) NOT NULL,
`priority`
int
(
11
) NOT NULL,
`data` LONGBLOB NOT NULL,
`when_to_run`
INT
, PRIMARY KEY (`unique_key`)
)
|
gearmand --queue-type=MySQL --mysql-host=localhost --mysql-port=3306 --mysql-user=gearman --mysql-password=qianhai1406 --mysql-db=gearman --mysql-table=gearman_queue -L 0.0.0.0 &
启动日志
/usr/local/var/log/gearmand.log