目前REDIS已经升级到3.0.5为最稳定版本,但很多系统源没有更新,所以在这里进行编译安装
适合所有系统
#wget http://download.redis.io/redis-stable.tar.gz#tar xvf redis-stable#cd redis-stable#make #make install安装后我们进行配置#cd utils#./install_server.sh这里会根据需要进行配置,我的配置如下:端口:6379配置路径:/etc/redis/redis.conf数据存放路径:/var/lib/redis/注册服务:redis-serverWelcome to the redis service installerThis script will help you easily set up a running redis serverPlease select the redis port for this instance: [6379] Selecting default: 6379Please select the redis config file name [/etc/redis/6379.conf] /etc/redis/redis.confPlease select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.logPlease select the data directory for this instance [/var/lib/redis/6379] /var/lib/redis/Please select the redis executable path [/usr/local/bin/redis-server] Selected config:Port : 6379Config file : /etc/redis/redis.confLog file : /var/log/redis_6379.logData dir : /var/lib/redis/Executable : /usr/local/bin/redis-serverCli Executable : /usr/local/bin/redis-cliIs this ok? Then press ENTER to go on or Ctrl-C to abort.Copied /tmp/6379.conf => /etc/init.d/redis_6379Installing service...insserv: warning: script 'K01redis' missing LSB tagsinsserv: warning: script 'redis' missing LSB tagsinsserv: warning: script 'haproxy' missing LSB tagsinsserv: Default-Start undefined, assuming default start runlevel(s) for script `haproxy'insserv: Service network is missed in the runlevels 4 to use service redis_6379redis_6379 0:off 1:off 2:on 3:on 4:on 5:on 6:offSuccessfully added to chkconfig!insserv: warning: script 'K01redis' missing LSB tagsinsserv: warning: script 'redis' missing LSB tagsinsserv: warning: script 'haproxy' missing LSB tagsinsserv: Default-Start undefined, assuming default start runlevel(s) for script `haproxy'insserv: warning: script 'K01redis' missing LSB tagsinsserv: warning: script 'redis' missing LSB tagsinsserv: warning: script 'haproxy' missing LSB tagsinsserv: Default-Start undefined, assuming default start runlevel(s) for script `haproxy'insserv: Service network is missed in the runlevels 4 to use service redis_6379Successfully added to runlevels 345!Starting Redis server...Installation successful!将redis注册为redis-server服务#mv /etc/init.d/redis{_6379,-server}测试下:# service redis-server restartStarting Redis server...#redis-cli -vredis-cli 3.0.5#redis-cli PINGPONG
以上完成编译安装Redis Stable最新版本