博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gearmand 持久化队列
阅读量:6708 次
发布时间:2019-06-25

本文共 2625 字,大约阅读时间需要 8 分钟。

1、使用yum安装libdrizzle

sudo yum install libdrizzle libdrizzle-devel

2、安装gearman0.14

wget --no-check-certificate https://launchpad.net/gearmand/trunk/0.14/+download/gearmand-0.14.tar.gztar xzvf gearmand-0.14.tar.gzcd gearmand-0.14./configure --disable-libmemcached --disable-libsqlite3Configuration summary for gearmand version 0.14    * Installation prefix:       /usr/local   * System type:               unknown-linux-gnu   * Host CPU:                  x86_64   * C Compiler:                gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)   * Assertions enabled:        yes   * Debug enabled:             no   * Warnings as failure:       no   * Building with libsqlite3   no   * Building with libdrizzle   yes   * Building with libmemcached no   * Building with libpq        no   * Building with tokyocabinet no

3、在mysql中为gearman添加用户以及数据库

create database gearmand;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`));CREATE USER 'wb-liqiu'@'%';GRANT USAGE ON * . * TO  'wb-liqiu'@'%' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;CREATE DATABASE IF NOT EXISTS  `gearmand` ;grant insert,update,delete,create,select on gearmand.* to 'wb-liqiu';

4、注意mysql没有密码

5、启动程序

/usr/local/sbin/gearmand -d -p 4730 -q libdrizzle --libdrizzle-mysql --libdrizzle-host=vkvm160141.sqa.cm6 --libdrizzle-port=3306 --libdrizzle-user='wb-liqiu' --libdrizzle-db=gearmand --libdrizzle-table=gearman_queue -vvv

INFO Initializing libdrizzle module[wb-liqiu@vkvm160132.sqa.cm6 ~]$  INFO libdrizzle module using table 'gearmand.gearman_queue' INFO Starting up INFO Listening on 0.0.0.0:4730 (7)ERROR Failed to listen on :::4730 INFO Creating wakeup pipe INFO Creating IO thread wakeup pipe INFO libdrizzle replay start INFO Adding event for listening socket (7) INFO Adding event for wakeup pipe INFO Entering main event loop INFO Accepted connection from 10.235.160.137:10307 INFO [   0]  10.235.160.137:10307 Connected gearman启动程序
gearman-server.sh#! /bin/sh## gearman conf#GM_USER=rootGM_PORT=4730 ## mysql conf#MY_HOST=127.0.0.1MY_PORT=3306MY_USER=gearmandMY_DB=gearmandMY_TABLE=queue /usr/local/sbin/gearmand -d -u $GM_USER -p $GM_PORT -q libdrizzle \--libdrizzle-mysql --libdrizzle-host=$MY_HOST \--libdrizzle-port=$MY_PORT --libdrizzle-user=$MY_USER \--libdrizzle-db=$MY_DB --libdrizzle-table=$MY_TABLE \

* 特别要注意drizzle的路径和boost升级

摘自:

 

*特别提醒,使用sqlite更加简单方便 gearmand -q libsqlite3 --libsqlite3-db=main --libsqlite3-table=gearman_queue -d -vvv

6、搞定

转载地址:http://lpalo.baihongyu.com/

你可能感兴趣的文章
JS中的反柯里化
查看>>
使用kubeadm部署k8s1.8
查看>>
再也不学AJAX了!(一)AJAX概述
查看>>
我为什么从Redux迁移到了Mobx
查看>>
解读生产环境为何避免使用console.log
查看>>
高性能MySQL读书笔记 (一)
查看>>
传统Http服务与SpringCloud微服务的整合
查看>>
Anaconda使用总结
查看>>
浅析HTTP/2的多路复用
查看>>
leetcode 530. Minimum Absolute Difference in BST | inorder
查看>>
Lodash 源码分析(三)Array
查看>>
ZooKeeper安装部署
查看>>
从Vue.js源码角度再看数据绑定
查看>>
linux cgroup代码学习(2)——数据结构整理
查看>>
postcss-lazysprite: 一种生成CSS 雪碧图的懒惰姿势
查看>>
SpreadJS 在 Angular2 中支持哪些事件?
查看>>
[LeetCode] Shortest Distance from All Buildings
查看>>
spring-boot 自定义解析器实现参数绑定
查看>>
SegmentFault 官方翻译功能上线
查看>>
Node.js和Socket.IO搭建Web Chat application
查看>>