kestrel小记1. git clone git://github.com/robey/kestrel.git && cd kestrel/2. wget http://simple-buil
kestrel小记
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 22133set mytest 0 0 3aaa
9. open another terminal
telnet localhost 22133get 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 22133get 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