当前位置: 首页 > 工具软件 > Gearmand > 使用案例 >

gearmand

壤驷升
2023-12-01

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

在mysql创建数据库及对应数据表

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的时候指定扩展类型 扩展对应的端口 用户名 密码 以及数据库

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




 类似资料:

相关阅读

相关文章

相关问答