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.5.tar.gz
cd redis-5.0.5/
4.阅读README.md
ls 00-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: [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] Selected config: Port : 6379 Config file : /etc/redis/6379.conf Log file : /var/log/redis_6379.log Data dir : /var/lib/redis/6379 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/6379.conf => /etc/init.d/redis_6379 Installing service... Successfully added to chkconfig! Successfully added to runlevels 345! Starting Redis server... Installation successful!
8.安装成功之后,查看端口与进程使用情况
# netstat -anp|grep 6379 tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 29176/redis-server # ps aux|grep redis root 29176 0.2 0.2 159520 10224 ? Ssl 17:27 0:02 /usr/local/bin/redis-server 127.0.0.1:6379 root 29441 0.0 0.0 112724 988 pts/2 S+ 17:43 0:00 grep --color=auto redis # ps -ef|grep redis root 29176 1 0 17:27 ? 00:00:02 /usr/local/bin/redis-server 127.0.0.1:6379 root 29446 24259 0 17:44 pts/2 00:00:00 grep --color=auto redis
原文:https://www.cnblogs.com/goujian/p/11714509.html