redis官网: http://redis.io/
redis中文网:http://www.redis.cn/
解压:tar zxvf redis-2.8.19.tar.gz
指定安装路径:make&&make PREFIX=/opt/redis install
配置环境变量:echo ‘PATH=/opt/redis/bin:$PATH’ >> /etc/profile
source /etc/profile
[root@localhost bin]# redis-server –help
Usage: ./redis-server [/path/to/redis.conf] [options]
./redis-server - (read config from stdin)
./redis-server -v or –version
./redis-server -h or –help
./redis-server –test-memory

Examples:
./redis-server (run the server with default conf)
./redis-server /etc/redis/6379.conf
./redis-server –port 7777
./redis-server –port 7777 –slaveof 127.0.0.1 8888
./redis-server /etc/myredis.conf –loglevel verbose

Sentinel mode:
./redis-server /etc/sentinel.conf –sentinel



启动redis:./opt/redis/redis-server
[root@localhost bin]# redis-cli
127.0.0.1:6379> set xiaomi dami
OK
127.0.0.1:6379> get xiaomi
“dami”
127.0.0.1:6379>
一般只需要这则可:



主从复制设置:vim redis.conf 添加 slaveof IP 端口




在主库上操作:


从库读写监控:




Comments

2015-12-06