Redis 安装,主从配置及Sentinel配置自动Failover

2014-11-24 17:41:34 · 作者: · 浏览: 1

1、安装redis


--------------------------------------------------------------------------------


首页地址:http://redis.io/
下载地址:http://download.redis.io/ 下载最新的源码包(当前最新稳定版2.6.16)
#wget http://download.redis.io/releases/redis-2.6.16.tar.gz
#tar xzf redis-2.6.16.tar.gz
#cd redis-2.6.16
#make
#make install
#cp redis.conf /etc/


--------------------------------------------------------------------------------
2、运行


--------------------------------------------------------------------------------
#redis-server /etc/redis.conf & (加载配置文件并后台运行)


#redis-cli (命令行工具)


--------------------------------------------------------------------------------
3、测试


--------------------------------------------------------------------------------
# redis-benchmark --help 获取帮助信息,其中包含压力测试命令样例


Examples:
Run the benchmark with the default configuration against 127.0.0.1:6379:
$ redis-benchmark


Fill 127.0.0.1:6379 with about 1 million keys only using the SET test:
$ redis-benchmark -t set -n 1000000 -r 100000000


[root@php1 ~]# redis-benchmark -t set -c 20 -n 1000000 -r 100000000
====== SET ======
1000000 requests completed in 8.92 seconds
20 parallel clients
3 bytes payload
keep alive: 1



100.00% <= 0 milliseconds
112095.06 requests per second



推荐阅读: