cd opt
wget http://download.redis.io/releases/redis-2.8.5.tar.gz
tar -zxf redis-2.8.5.tar.gz
cd redis-2.8.5
make
sudo make install
make 完成后,Src目录下的redis-server和redis-cli两个命名就是redis服务端和客户端的应用程序,这两个命令可以直接调用。
可以通过redis源代码里utils/install_server下的脚本简化配置工作
cd utils
sudo ./install_server.sh
install_server.sh在问你几个问题后会把redis安装为开机启动的服务。
相关安装提示信息如下:
[iyunv@localhost utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
s#^port [0-9]{4}$#port 6379#;s#^logfile .+$#logfile /var/log/redis_6379.log#;s#^dir .+$#dir /var/lib/redis/6379#;s#^pidfile .+$#pidfile /var/run/redis_6379.pid#;s#^daemonize no$#daemonize yes#;
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
./install_server.sh: line 178: update-rc.d: command not found
exists, process is already running or crashed
Installation successful!