1.下载redis5.0源码包
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
2.检查是否安装过之前的历史版本
rpm -qa|grep -i redis
如果之前已经安装过,先卸载:
rpm -e RPM软件包名(该名字是上一个命令查出来的名字)
3.进行全新安装,解压redis-5.0.5.tar.gz,切换到redis-5.0.5目录
tar zxf redis-5.0..tar.gz
cd redis-5.0./
4.阅读README.md
ls
-RELEASENOTES CONTRIBUTING deps Makefile README.md runtest runtest-moduleapi sentinel.conf tests
BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster runtest-sentinel src utils
vim README.md
5.编译安装
make && make install
6.redis二进制文件会被默认安装到/usr/local/bin
ls /usr/local/bin
composer redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
7.初始化配置
# cd utils/
# ls
build-static-symbols.tcl corrupt_rdb.c generate-command-help.rb hashtable install_server.sh redis-copy.rb redis_init_script.tpl releasetools whatisdoing.sh
cluster_fail_time.tcl create-cluster graphs hyperloglog lru redis_init_script redis-sha1.rb speed-regression.tcl
# ./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: []
Selecting default:
Please select the redis config file name [/etc/redis/.conf]
Selected default - /etc/redis/.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/]
Selected default - /var/lib/redis/
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port :
Config file : /etc/redis/.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels !
Starting Redis server...
Installation successful!
8.安装成功之后,查看端口与进程使用情况
# netstat -anp|grep
tcp 127.0.0.1: 0.0.0.0:* LISTEN /redis-server
# ps aux|grep redis
root 0.2 0.2 ? Ssl : : /usr/local/bin/redis-server 127.0.0.1:
root 0.0 0.0 pts/ S+ : : grep --color=auto redis
# ps -ef|grep redis
root : ? :: /usr/local/bin/redis-server 127.0.0.1:
root : pts/ :: grep --color=auto redis