redis 2.8 安装 centos6.3
wget http://download.redis.io/releases/redis-2.8.17.tar.gz
tar -zxvf redis-2.8.17.gz
安装环境依赖的工具
yum -y install openssh-clients gcc-c++ vim make gcc unzip wget subversion openssh zlib zlib-devel
<pre name="code" class="html">cd redis-2.8.17
make
make test & make install
<pre name="code" class="html">mkdir -p /usr/local/redis/conf
mkdir -p /usr/local/redis/run
mkdir -p /usr/local/redis/db
cp redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server mkreleasehdr.sh /usr/local/redis/
<pre name="code" class="html"> cd ../
cp redis.conf /usr/local/redis/conf/
vi redis.conf
编辑redis.conf
aof持久化
daemonize yes
port 6379
pidfile /usr/local/redis/run/redis.pid
appendonly yes
appendfsync everysec
dir /usr/local/redis/db
启动
./redis-server conf/redis-cache.conf netstat -tnlp | grep 6379
master 配置完毕
slave 安装
mkdir -p /usr/local/redis/conf
mkdir -p /usr/local/redis/run
mkdir -p /usr/local/redis/db
scp -r root@*:/usr/local/redis/* /usr/local/redis/
vi redis.conf
添加
slaveof * 6379
启动./redis-server conf/redis-126-slave.conf
如果要在相同主机上起多实例
则可以
cp redis.conf redis-cache.conf 修改port
再次启动即可