下载安装包
wget http://117.128.6.11/cache/download.redis.io/releases/redis-5.0.5.tar.gz?ich_args2=471-12221607022760_77fbd9dd440d42206c2bc7a761a751dc_10001002_9c89622cd4c7f9d89039518939a83798_8940b2a470aa181b05d09f7a7d8e09ff

tar xf redis-5.0.5.tar.gz
cd redis-5.0.5
编译源码程序
make
cd src
make install PREFIX=/usr/local/redis

添加配置文件
mkdir -p /usr/local/redis/etc
cp redis.conf /usr/local/redis/etc/

修改配置文件

vim redis.conf

bind 0.0.0.0    # 监听地址
port 16379     # 监听端口
daemonize yes   # 后台运行
supervised no    # 是否支持supervised进程管理
pidfile /var/run/redis_16379.pid   # 进程PID
requirepass L**&@2019    # 访问密码

启动redis:
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

查看端口:
[root@node1 bin]# netstat -anptu | grep 16379
tcp 0 0 0.0.0.0:16379 0.0.0.0:* LISTEN 24621/redis-server

测试:使用redis-cli登录

[root@node1 bin]# redis-cli -h 127.0.0.1 -p 16379 -a L**&@2019
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:16379> 

验证成功redis安装完成