如果碰上这个bug,redis进程会挂掉。我下午已经在官网上提交bug,作者很有效率,说正在writing a fix.

经过我的测试,redis 2.4.6是正常的,redis 2.4.7及2.4.8未测试,

作者的解释:

Hey, this is what happens:

SORT lookup keys for the “GET” option using a stack allocated robj structure, however this object in the current 2.4.x implementation is no longer a “read only” object, to propagate the expire to the slave we use it to compose the protocol that we send to the slave. But this object can’t be shared, as will be destroyed after the function returns. Hence everything crashes apart ;)

Writing a fix. Thanks.

阅读全文

发现网上的Redis管理脚本基于Ubuntu 的发行版上的,在Centos linux 5.x上并不能用,所以自己写了一个。

用这个脚本管理之前,需要先配置下面的内核参数,否则Redis脚本在重启或停止redis时,将会报错,并且不能自动在停止服务前同步数据到磁盘上:

# vim /etc/sysctl.conf
vm.overcommit_memory = 1

然后应用生效:

# sysctl -p

阅读全文

redis 复制功能测试

redis有一个类似mysql 高级复制的功能,可以让一台主redis上的数据实时同步到一台备redis上。

主redis:192.168.20.23

备redis:192.168.20.24

我们先看主redis上有哪些key:

阅读全文

redis是一个带存储功能的键值数据库,类似日本的Tokyo Tyrant / Tokyo Cabinet 项目。下面是官方的介绍:

Redis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All this data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth. Redis supports different kind of sorting abilities.

这里有篇国外的人对redis,memcached,tokyo tyrant等做的对测试:

http://www.ruturaj.net/redis-memcached-tokyo-tyrant-mysql-comparison

可以看出redis的性测非常出色。

另外redis对数据结构的支持也非常丰富,什么队列,栈,哈希等等都支持,而memcached只支持K-V。

阅读全文

作者的图片

阿辉

容器技术及容器集群等分布式系统研究

容器平台负责人

上海