[root@redis ~]# yum install gcc gcc-c++ make -y [root@redis ~]# cd /opt[root@redis opt]# tar zxvf redis-5.0.7.tar.gz '//redis源码包解压'[root@redis opt]# cd /redis-5.0.7/[root@redis redis-5.0.7]# make '//直接进行make'[root@redis redis-5.0.7]# make PREFIX=/usr/local/redis/ install '//指定redis目录并安装'[root@redis redis-5.0.7]# cd /usr/local/redis/[root@redis redis]# ls
bin
[root@redis redis]# cd bin/[root@redis bin]# ls
total 32768
-rwxr-xr-x. 1 root root 4366184 Nov 3 04:35 redis-benchmark
-rwxr-xr-x. 1 root root 8125808 Nov 3 04:35 redis-check-aof
-rwxr-xr-x. 1 root root 8125808 Nov 3 04:35 redis-check-rdb
-rwxr-xr-x. 1 root root 4807368 Nov 3 04:35 redis-cli ###'redis-cli是连接终端'
lrwxrwxrwx. 1 root root 12 Nov 3 04:35 redis-sentinel -> redis-server
-rwxr-xr-x. 1 root root 8125808 Nov 3 04:35 redis-server
2.3:执行redis配置文件脚本
[root@redis bin]# cd /opt/redis-5.0.7/utils/ '//回到redis源码包解压目录'[root@redis 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]'//选择redis默认接口,直接回车'
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]'//选择redis默认配置文件名称,直接回车'
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]'//选择默认redis日志文件名称,直接回车'
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/redis/bin/redis-server '//选择redis可执行文件路径,需要手动输入此路径:/usr/local/redis/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/redis/bin/redis-server
Cli Executable : /usr/local/redis/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!