gearman的安裝


#gearman服務的安裝與使用
#date:2017-11-29

set -x
set -e

#安裝開發依賴庫
yum install gcc gcc-c++  make automake  glibc libgomp libstdc++-devel boost-devel* libevent-devel* libuuid-devel gperf*  mysql-devel -y

#下載安裝gearman
#官方下載,請到https://launchpad.net/gearmand。
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
tar zxvf gearmand-1.1.12.tar.gz
cd gearmand-*
./configure       #建議直接默認./configure,不要指定路徑等
make && make install



#啓動gearman
/usr/local/sbin/gearmand --job-retries 10 --keepalive --protocol http --port 4730 --http-port 8080 --mysql-host xx.xx.xx.xx --mysql-port 3306 --mysql-user gearmand --mysql-password 123456 --mysql-db DB_Gearmand --mysql-table Tbl_GearmanQueue --log-file=/mnt/logs/gearman/gearmand.log --listen xx.xx.xx.xecho "end at `date`" 鏈接到mysql的數據信息 (數據庫名和表名能夠更改) CREATE DATABASE `DB_Gearman` /*!40100 DEFAULT CHARACTER SET utf8mb4 */
use
DB_Gearman

CREATE TABLE `Tbl_Queue` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`unique_key` char(64) NOT NULL DEFAULT '',
`function_name` char(255) NOT NULL DEFAULT '',
`priority` int(11) NOT NULL DEFAULT '0',
`data` longblob NOT NULL,
`when_to_run` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_key__function_name` (`unique_key`,`function_name`(128))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
相關文章
相關標籤/搜索