ubuntu 安装 Redis
ubuntu 自带的 redis 版本太老了,居然是去年1月的版本。决定自己编译安装新版本。
sudo aptitude install build-essential
sudo aptitude install tcl # 可能需要指定版本
wget http://download.redis.io/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
redis-server Redis 服务器文件.
redis-sentinel 守护程序 (监控和故障转移).
redis-cli 命令行界面工具.
redis-benchmark 基准测试.
redis-check-aof and redis-check-dump 损坏数据修复工具.
手动拷贝文件到需要的地方时一个好主意。
sudo cp src/redis-server /usr/local/bin/
sudo cp src/redis-cli /usr/local/bin/
也可以使用 make install.
测试时出现过下面的错误,原因是内存不足,完整测试大约需要300M内存,加大内存即可。
[err]: Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl
Replication not started.
[ok]: AOF rewrite of list with linkedlist encoding, int data
[ok]: EVAL does not leak in the Lua stack
[ok]: EVAL processes writes from AOF in read-only slaves
[ok]: We can call scripts rewriting client->argv from Lua
[ok]: Call Redis command with many args from Lua (issue #1764)
[ok]: Number conversion precision test (issue #1118)
[ok]: String containing number precision test (regression of issue #1118)
[ok]: Verify negative arg count is error instead of crash (issue #1842)
[ok]: Correct handling of reused argv (issue #1939)
I/O error reading reply
[exception]: Executing test client: I/O error reading reply.
I/O error reading reply
while executing
参考:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis
http://redis.io/topics/quickstart
Redis 命令参考
http://redis.readthedocs.org/en/latest/index.html
持久化(persistence)
http://redis.readthedocs.org/en/latest/topic/persistence.html