Linux系统:CentOS 6.3
一、下载源码包
wget http://Redis.googlecode.com/files/redis-2.2.12.tar.gz
二、安装
1、解压:
[root@localhost ~]# tar -zxvf redis-2.2.12.tar.gz
2、安装:
[root@localhost ~]# cd redis-2.2.12
[root@localhost redis-2.2.12]# make PREFIX=/usr/local/redis install
3、建立需要的目录
mkdir -p /usr/local/redis/etc
mkdir -p /usr/local/redis/var
mkdir -p /usr/local/redis/bin
4、cp文件
cp redis-server redis-cli redis-benchmark redis-stat /usr/local/redis/bin/
cp redis.conf /usr/local/redis/etc/
5、配置文件
[root@localhost redis-2.2.12]# cat /data/app/redis/etc/redis.conf
daemonize yes
pidfile /usr/local/redis/redis.pid
port 6379
bind 10.10.0.78
#unixsocket /tmp/redis.sock
timeout 120
#loglevel verbose
#logfile stdout
#logfile /tmp/redis_6379.log
databases 16
save 1800 1
#save 300 10
#save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /usr/local/redis/var/
slave-serve-stale-data yes
maxclients 12800
slaveof 10.10.0.157 6379
appendonly no
appendfsync no
no-appendfsync-on-rewrite no
slowlog-log-slower-than 10000
Slowlog-max-len 1024
vm-enabled no
vm-swap-file /tmp/redis.swap
vm-max-memory 0
vm-page-size 32
vm-pages 134217728
vm-max-threads 4
hash-max-zipmap-entries 512
hash-max-zipmap-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
activerehashing yes
########配置文件结束#########
三、启动服务
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf