安装
下载文件到该目录
cd /usr/home/
wget http://download.redis.io/releases/redis-3.0.1.tar.gz
解压
tar xzf redis-3.0.1.tar.gz
进入目录编译安装
cd redis-3.0.1
make
make test
make install
wget网络不稳定时会报错,多试几次
make test时会有报“You need tcl 8.5 or newer in order to run the Redis test”错误的
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
安装tcl即可解决
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
cd /usr/local/tcl8.6.1/unix/
sudo ./configure
sudo make
sudo make install
简单配置
mkdir /etc/redis
cp redis.conf /etc/redis/
vi /etc/redis/redis.conf
进入实际使用的redis.conf
把daemonize设置为yes,后台启动
取消requirepass注释,并设置访问密码
启动
./redis-server /etcredis//redis.conf