kestrel小记

本文介绍如何从源码安装配置Kestrel消息队列系统,并演示了基本的队列操作流程,包括创建队列、写入数据、读取数据等。通过实例展示了Kestrel的分布式特性及数据持久化方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.
 git clone git://github.com/robey/kestrel.git && cd kestrel/

2.
wget http://simple-build-tool.googlecode.com/files/sbt-launch-0.7.4.jar

3. vim sbt
java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar `dirname $0`/sbt-launch.jar "$@"

:wq
4.
./sbt clean update package-dist
(for now,only work with sbt0.74 and scala 2.7.7;a bug may occur about persistentqueue test case,just comment it)
5.
mkdir /var/log/kestrel && chmod -R 777 /var/log/kestrel

6.
mkdir /var/spool/kestrel && chmod -R 777 /var/spool/kestrel

7.
./dist/kestrel/scripts/devel.sh

8. open another terminal
telnet localhost 22133
set mytest 0 0 3
aaa

9. open another terminal
telnet localhost 22133
get mytest

10. repeat step 8,then shutdown the kestrel servie.
vim /var/spool/kestrel/mytest
:%!xxd
// hex edit it to aab
:%!xxd -r
:wq

11.
./dist/kestrel/scripts/devel.sh

12. in another terminal:
telnet localhost 22133
get mytest
(you should see aab here)

keynotes:
1. kestrel store items in journal file(/var/spool/kestrel/queuename)
2. A cluster of kestrel servers is like a memcache cluster: the servers don't
know about each other, and don't do any cross-communication, so you can add as
many as you like. Clients have a list of all servers in the cluster, and pick
one at random for each operation. In this way, each queue appears to be spread
out across every server, with items in a loose ordering.
3. kestrel doesn't enforce any
restrictions other than the name can't contain slash (`/`) because that can't
be used in filenames, squiggle (`~`) because it's used for temporary files,
plus (`+`) because it's used for fanout queues, and dot (`.`) because it's
reserved for future use
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值