1.下载编译安装
cd /usr/src
wget http://download.redis.io/releases/redis-3.2.3.tar.gz
tar -xf redis-3.2.3.tar.gz
cd redis-3.2.3
make && make install
2.创建redis节点
mkdir -p /redis_node_test/{6382,6383,6384}
cp /usr/src/redis-3.2.3/redis.conf /redis_node_test/6382
vim /redis_node_test/6382/redis.conf
daemonize yes //redis后台运行
pidfile /var/run/redis_6382.pid //pidfile文件对应6382
port 6382 //端口
appendonly yes //aof日志开启 有需要就开启,它会每次写操作都记录一条日志
redis-server /redis_node_test/6382/redis.conf //启动redis节点进程
ps -ef|grep redis
root 20961 1 0 09:46 ? 00:00:00 redis-server 127.0.0.1:6382
redis-cli -p 6382 //redis客户端登录redis实例
127.0.0.1:6382> //出现这个界面表示登录成功
127.0.0.1:6382> set name wang
OK
127.0.0.1:6382> get name
"wang"
redis-cli -p 6382 shutdown //关闭redis进程