
目录
[一、上传 Redis 安装包并解压缩](#一、上传 Redis 安装包并解压缩)
一、上传 Redis 安装包并解压缩
tar -zxvf redis-6.0.2.tar.gz

二、编译
1、安装gcc,不然后面编译报错
sudo apt-get install gcc

2、开始编译
make

中间过程的截图省略......

三、生成后台服务
上一步编译之后多了文件夹 utils

进入 utils ,修改install_server.sh文件,注释掉以下代码:
1. #bail if this system is managed by systemd
2. #_pid_1_exe="$(readlink -f /proc/1/exe)"
3. #if [ "${_pid_1_exe##*/}" = systemd ]
4. #then
5. # echo "This systems seems to use systemd."
6. # echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
7. # exit 1
8. #fi
执行install_server.sh,注意填写 redis-server.sh 的路径

四、修改配置文件
修改 /etc/redis/6379.conf 配置文件
1、设置密码

2、设置后台启动

五、启动服务
systemctl start redis_6379.service:启动服务
systemctl status redis_6379.service:查看服务状态

