1、使用yum安裝libdrizzle
sudo yum install libdrizzle libdrizzle-devel
2、安裝gearman0.14
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[[email protected] ~]$ 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
forwakeup 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=root
gm_port=4730
## mysql conf
#my_host=127.0.0.1
my_port=3306
my_user=gearmand
my_db=gearmand
my_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、搞定
gearmand 持久化佇列
1 使用yum安裝libdrizzle sudo yum install libdrizzle libdrizzle devel 2 安裝gearman0.14 3 在mysql中為gearman新增使用者以及資料庫 create database gearmand create table gea...
redis持久化 AOF持久化
1.aof持久化原理 aof持久化會將被執行的寫命令寫到aof檔案的末尾。在恢復的時候,redis只要從頭到尾重新執行一次aof檔案包含的所有寫命令 2.配置選項 固態硬碟禁用always選項,在某些情況頻繁讀寫會大大降低固態硬碟的壽命 4.aof檔案的重寫和壓縮 aof檔案裡面記錄了所有的命令而不...
redis持久化之AOF持久化
aof與rdb持久化通過儲存資料庫中的鍵值對來記錄資料庫狀態不同,aof持久化是通過儲存redis伺服器所執行的寫命令來記錄資料庫狀態的。被寫入aof檔案的所有命令都是以redis的命令請求協議格式儲存的。當aof持久化功能處於開啟狀態,伺服器在執行完乙個寫命令之後,會以協議格式將被執行的寫命令追加...