1,使用linux wget命令
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
2,将redis-3.0.0.tar.gz拷贝到/usr/local下
cp redis-3.0.0.tar.gz /usr/local
3,解压源码
tar -zxvf redis-3.0.0.tar.gz
4,进入解压后的目录进行编译
cd /usr/local/redis-3.0.0
5,安装到指定目录 如 /usr/local/redis
make PREFIX=/usr/local/redis install
6,源码目录redis.conf文件拷贝到安装目录下
cp /usr/local/redis-3.0.0/redis.conf /usr/local/redis/
7,后端模式启动,修改redis.conf配置文件, daemonize yes 以后端模式启动。如:
################################ GENERAL ##################################### # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize yes
8,删除源码目录
rm -rf redis-3.0.0
8,执行如下命令启动redis
cd /usr/local/redis ./bin/redis-server ./redis.conf
9,测试连接
/usr/local/redis/bin/redis-cli
10,关闭redis
cd /usr/local/redis ./bin/redis-cli shutdown
12,强行终止redis
pkill redis-server
13,让redis开机自启
vim /etc/rc.local //添加 /usr/local/redis/bin/redis-server /usr/local/redis/redis-conf