Windows绿色版与Linux源码编译两种部署方式
纲要
本文完整演示 Redis 在两个平台上的安装过程。Windows 是解压即用的绿色版,Linux 则是典型的源码编译安装 ,需要 gcc 编译环境。
- 安装包获取
- Windows 版本托管于
GitHub,版本3.2.100,提供MSI与ZIP两种形态 - Linux 版本从
Redis官网https://redis.io/download获取,课程使用4.0.0
- Windows 版本托管于
- Linux 安装五步
- 上传安装包
tar -zxvf解压至/usr/localyum install gcc-c++安装编译环境make编译 C 源码make install安装
- 产物说明
src/redis-server:服务端启动程序src/redis-cli:命令行客户端redis.conf:配置文件
- Windows 安装
- 绿色软件,解压即可,免安装
安装包获取
Redis 针对不同平台提供了不同的分发形式。
| 平台 | 下载地址 | 课程版本 | 安装包形态 |
|---|---|---|---|
| Windows | GitHub(microsoftarchive/redis) |
3.2.100 |
Redis-x64-3.2.100.msi / .zip |
| Linux | https://redis.io/download |
4.0.0 |
redis-4.0.0.tar.gz |
Windows 版本提供两种安装包:
| 形态 | 说明 | 推荐度 |
|---|---|---|
.msi |
安装版,需走安装向导,会写入注册表 | 一般 |
.zip |
绿色版(免安装),解压即可使用 | 推荐 |
课程统一使用 .zip 绿色版,与其他软件的安装方式保持一致。
Linux 下源码编译安装
Linux 版 Redis 以源码工程 形式发布,这是标准的源码编译安装 方式------下载到的是 C 语言源码,必须在本地编译后才能运行。
#mermaid-svg-352FHIFWF8Yhmj7r{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-352FHIFWF8Yhmj7r .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-352FHIFWF8Yhmj7r .error-icon{fill:#552222;}#mermaid-svg-352FHIFWF8Yhmj7r .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-352FHIFWF8Yhmj7r .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-352FHIFWF8Yhmj7r .marker{fill:#333333;stroke:#333333;}#mermaid-svg-352FHIFWF8Yhmj7r .marker.cross{stroke:#333333;}#mermaid-svg-352FHIFWF8Yhmj7r svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-352FHIFWF8Yhmj7r p{margin:0;}#mermaid-svg-352FHIFWF8Yhmj7r .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-352FHIFWF8Yhmj7r .cluster-label text{fill:#333;}#mermaid-svg-352FHIFWF8Yhmj7r .cluster-label span{color:#333;}#mermaid-svg-352FHIFWF8Yhmj7r .cluster-label span p{background-color:transparent;}#mermaid-svg-352FHIFWF8Yhmj7r .label text,#mermaid-svg-352FHIFWF8Yhmj7r span{fill:#333;color:#333;}#mermaid-svg-352FHIFWF8Yhmj7r .node rect,#mermaid-svg-352FHIFWF8Yhmj7r .node circle,#mermaid-svg-352FHIFWF8Yhmj7r .node ellipse,#mermaid-svg-352FHIFWF8Yhmj7r .node polygon,#mermaid-svg-352FHIFWF8Yhmj7r .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-352FHIFWF8Yhmj7r .rough-node .label text,#mermaid-svg-352FHIFWF8Yhmj7r .node .label text,#mermaid-svg-352FHIFWF8Yhmj7r .image-shape .label,#mermaid-svg-352FHIFWF8Yhmj7r .icon-shape .label{text-anchor:middle;}#mermaid-svg-352FHIFWF8Yhmj7r .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-352FHIFWF8Yhmj7r .rough-node .label,#mermaid-svg-352FHIFWF8Yhmj7r .node .label,#mermaid-svg-352FHIFWF8Yhmj7r .image-shape .label,#mermaid-svg-352FHIFWF8Yhmj7r .icon-shape .label{text-align:center;}#mermaid-svg-352FHIFWF8Yhmj7r .node.clickable{cursor:pointer;}#mermaid-svg-352FHIFWF8Yhmj7r .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-352FHIFWF8Yhmj7r .arrowheadPath{fill:#333333;}#mermaid-svg-352FHIFWF8Yhmj7r .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-352FHIFWF8Yhmj7r .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-352FHIFWF8Yhmj7r .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-352FHIFWF8Yhmj7r .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-352FHIFWF8Yhmj7r .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-352FHIFWF8Yhmj7r .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-352FHIFWF8Yhmj7r .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-352FHIFWF8Yhmj7r .cluster text{fill:#333;}#mermaid-svg-352FHIFWF8Yhmj7r .cluster span{color:#333;}#mermaid-svg-352FHIFWF8Yhmj7r div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-352FHIFWF8Yhmj7r .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-352FHIFWF8Yhmj7r rect.text{fill:none;stroke-width:0;}#mermaid-svg-352FHIFWF8Yhmj7r .icon-shape,#mermaid-svg-352FHIFWF8Yhmj7r .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-352FHIFWF8Yhmj7r .icon-shape p,#mermaid-svg-352FHIFWF8Yhmj7r .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-352FHIFWF8Yhmj7r .icon-shape .label rect,#mermaid-svg-352FHIFWF8Yhmj7r .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-352FHIFWF8Yhmj7r .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-352FHIFWF8Yhmj7r .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-352FHIFWF8Yhmj7r :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 1. 上传 redis-4.0.0.tar.gz
2. tar -zxvf 解压至 /usr/local
3. yum install gcc-c++
安装 C 语言编译环境
4. 进入 redis 根目录执行 make
编译 C 源码
5. 进入 src 目录执行 make install
完成安装
产物:redis-server / redis-cli
第一步:上传安装包
使用 SSH 工具将 redis-4.0.0.tar.gz 上传至 Linux(如上传至 /root 目录)。
bash
cd /root
ll
# -rw-r--r--. 1 root root 1713990 ... redis-4.0.0.tar.gz
第二步:解压
bash
tar -zxvf redis-4.0.0.tar.gz -C /usr/local
cd /usr/local
ll
# drwxrwxr-x. 6 root root 4096 ... redis-4.0.0
第三步:安装编译环境
解压后的目录内是 Redis 的 C 语言源码(src 目录下大量 .c 与 .h 文件)。要编译它们,必须先安装 gcc 编译器。
bash
yum install -y gcc-c++
该包约 25 MB,安装过程会自动下载并处理依赖。
为什么必须安装
gcc:Redis用C语言开发,源码不能被直接执行,必须由编译器翻译成机器码。gcc-c++即 GNU 编译器集合中用于编译 C/C++ 的部分。若跳过此步直接make,会报command not found或编译错误。
第四步:编译源码
bash
cd /usr/local/redis-4.0.0
make
make 会依据 Makefile 逐个编译源码文件。源码文件数量较多,编译需要一定时间,期间终端会滚动输出大量编译信息。
第五步:安装
bash
cd /usr/local/redis-4.0.0/src
make install
编译完成后安装非常快,瞬间即可完成。
安装产物
安装完成后,src 目录下会出现关键的可执行文件:
bash
cd /usr/local/redis-4.0.0/src
ll
| 文件 | 作用 |
|---|---|
redis-server |
服务端启动程序 ,用于启动 Redis 服务 |
redis-cli |
命令行客户端 (cli = client),用于连接并操作 Redis |
redis-benchmark |
性能测试工具 |
redis-sentinel |
哨兵程序,用于高可用 |
redis-check-rdb |
RDB 文件检测修复工具 |
redis-check-aof |
AOF 文件检测修复工具 |
其中 redis-server 与 redis-cli 是日常使用频率最高的两个。
配置文件
回到 Redis 根目录,可以看到配置文件:
bash
cd /usr/local/redis-4.0.0
ll
# -rw-rw-r--. 1 root root 57765 ... redis.conf
redis.conf 是 Redis 服务的核心配置文件,端口、后台运行、密码、远程连接等全部在此配置。
Windows 下安装
Windows 版本是绿色软件,无需任何安装步骤,解压即用。
#mermaid-svg-IwWjZ40QXNTfadae{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-IwWjZ40QXNTfadae .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-IwWjZ40QXNTfadae .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-IwWjZ40QXNTfadae .error-icon{fill:#552222;}#mermaid-svg-IwWjZ40QXNTfadae .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-IwWjZ40QXNTfadae .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-IwWjZ40QXNTfadae .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-IwWjZ40QXNTfadae .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-IwWjZ40QXNTfadae .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-IwWjZ40QXNTfadae .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-IwWjZ40QXNTfadae .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-IwWjZ40QXNTfadae .marker{fill:#333333;stroke:#333333;}#mermaid-svg-IwWjZ40QXNTfadae .marker.cross{stroke:#333333;}#mermaid-svg-IwWjZ40QXNTfadae svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-IwWjZ40QXNTfadae p{margin:0;}#mermaid-svg-IwWjZ40QXNTfadae .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-IwWjZ40QXNTfadae .cluster-label text{fill:#333;}#mermaid-svg-IwWjZ40QXNTfadae .cluster-label span{color:#333;}#mermaid-svg-IwWjZ40QXNTfadae .cluster-label span p{background-color:transparent;}#mermaid-svg-IwWjZ40QXNTfadae .label text,#mermaid-svg-IwWjZ40QXNTfadae span{fill:#333;color:#333;}#mermaid-svg-IwWjZ40QXNTfadae .node rect,#mermaid-svg-IwWjZ40QXNTfadae .node circle,#mermaid-svg-IwWjZ40QXNTfadae .node ellipse,#mermaid-svg-IwWjZ40QXNTfadae .node polygon,#mermaid-svg-IwWjZ40QXNTfadae .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-IwWjZ40QXNTfadae .rough-node .label text,#mermaid-svg-IwWjZ40QXNTfadae .node .label text,#mermaid-svg-IwWjZ40QXNTfadae .image-shape .label,#mermaid-svg-IwWjZ40QXNTfadae .icon-shape .label{text-anchor:middle;}#mermaid-svg-IwWjZ40QXNTfadae .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-IwWjZ40QXNTfadae .rough-node .label,#mermaid-svg-IwWjZ40QXNTfadae .node .label,#mermaid-svg-IwWjZ40QXNTfadae .image-shape .label,#mermaid-svg-IwWjZ40QXNTfadae .icon-shape .label{text-align:center;}#mermaid-svg-IwWjZ40QXNTfadae .node.clickable{cursor:pointer;}#mermaid-svg-IwWjZ40QXNTfadae .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-IwWjZ40QXNTfadae .arrowheadPath{fill:#333333;}#mermaid-svg-IwWjZ40QXNTfadae .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-IwWjZ40QXNTfadae .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-IwWjZ40QXNTfadae .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IwWjZ40QXNTfadae .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-IwWjZ40QXNTfadae .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IwWjZ40QXNTfadae .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-IwWjZ40QXNTfadae .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-IwWjZ40QXNTfadae .cluster text{fill:#333;}#mermaid-svg-IwWjZ40QXNTfadae .cluster span{color:#333;}#mermaid-svg-IwWjZ40QXNTfadae div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-IwWjZ40QXNTfadae .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-IwWjZ40QXNTfadae rect.text{fill:none;stroke-width:0;}#mermaid-svg-IwWjZ40QXNTfadae .icon-shape,#mermaid-svg-IwWjZ40QXNTfadae .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IwWjZ40QXNTfadae .icon-shape p,#mermaid-svg-IwWjZ40QXNTfadae .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-IwWjZ40QXNTfadae .icon-shape .label rect,#mermaid-svg-IwWjZ40QXNTfadae .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IwWjZ40QXNTfadae .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-IwWjZ40QXNTfadae .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-IwWjZ40QXNTfadae :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Redis-x64-3.2.100.zip
解压到任意目录
redis-server.exe
双击启动服务
redis-cli.exe
双击打开客户端
redis.windows.conf
配置文件
解压后的目录内容:
| 文件 | 作用 |
|---|---|
redis-server.exe |
服务端,双击即启动服务 |
redis-cli.exe |
命令行客户端 |
redis.windows.conf |
配置文件(命令行启动方式使用) |
redis.windows-service.conf |
配置文件(注册为 Windows 服务时使用) |
两种
.conf的存在是为了区分使用场景:直接双击redis-server.exe时加载前者;若通过redis-server --service-install注册为系统服务,则使用后者。启动时也可显式指定加载哪个配置文件。
目录结构说明
Linux 安装目录
txt
/usr/local/redis-4.0.0/
├── redis.conf # 核心配置文件
├── Makefile # 编译规则文件
├── README.md
├── deps/ # 依赖的第三方库源码
│ ├── hiredis/
│ ├── jemalloc/
│ └── lua/
├── src/ # 源码与编译产物
│ ├── redis-server # 服务端(make install 后生成)
│ ├── redis-cli # 客户端(make install 后生成)
│ ├── redis-benchmark
│ ├── redis-sentinel
│ ├── redis-check-rdb
│ ├── redis-check-aof
│ └── *.c / *.h # C 语言源码
└── utils/ # 运维工具脚本
├── redis_init_script # 服务启停脚本模板
└── install_server.sh
Windows 解压目录
txt
Redis-x64-3.2.100/
├── redis-server.exe
├── redis-cli.exe
├── redis.windows.conf
├── redis.windows-service.conf
└── dump.rdb # 持久化文件(运行后生成)
完整可运行代码
Linux 一键安装脚本
bash
#!/bin/bash
# ============================================================
# 功能:Linux 下源码编译安装 Redis 4.0.0
# 用法:chmod +x install_redis.sh && ./install_redis.sh
# 前置:redis-4.0.0.tar.gz 已上传至 /root
# ============================================================
set -e
REDIS_VERSION="4.0.0"
REDIS_PKG="redis-${REDIS_VERSION}.tar.gz"
REDIS_HOME="/usr/local/redis-${REDIS_VERSION}"
# 1. 安装 C 语言编译环境
echo "==================== 安装 gcc-c++ 编译环境 ===================="
yum install -y gcc-c++
gcc --version
# 2. 解压源码包
echo "==================== 解压源码包 ===================="
if [ -d "${REDIS_HOME}" ]; then
echo "目录 ${REDIS_HOME} 已存在,跳过解压"
else
tar -zxvf "/root/${REDIS_PKG}" -C /usr/local
fi
# 3. 编译源码
echo "==================== 编译源码 ===================="
cd "${REDIS_HOME}"
make
# 4. 安装
echo "==================== 执行安装 ===================="
cd "${REDIS_HOME}/src"
make install
# 5. 验证产物
echo "==================== 验证安装产物 ===================="
ls -lh "${REDIS_HOME}/src/redis-server"
ls -lh "${REDIS_HOME}/src/redis-cli"
# 6. 备份原始配置文件(后续修改前建议先备份)
if [ ! -f "${REDIS_HOME}/redis.conf.bak" ]; then
cp "${REDIS_HOME}/redis.conf" "${REDIS_HOME}/redis.conf.bak"
echo "已备份原始配置为 redis.conf.bak"
fi
echo "=================================================="
echo "Redis ${REDIS_VERSION} 安装完成"
echo "配置文件:${REDIS_HOME}/redis.conf"
echo "启动命令:${REDIS_HOME}/src/redis-server ${REDIS_HOME}/redis.conf"
Maven 工程引入与连通性验证
java
package com.itheima.test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
/**
* Redis 安装完成后的连通性验证工具。
* 使用 Jedis 连接池连接 Redis,执行 set / get 验证服务可用。
*/
public class RedisInstallChecker {
public static void main(String[] args) {
// 1. 配置连接池
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(10);
poolConfig.setMaxIdle(5);
poolConfig.setMinIdle(2);
// 2. 创建连接池:host、port、超时时间、密码
try (JedisPool jedisPool = new JedisPool(poolConfig, "192.168.138.100", 6379, 3000, "123456");
Jedis jedis = jedisPool.getResource()) {
// 3. ping 命令返回 PONG 即代表服务可达
String pong = jedis.ping();
System.out.println("ping 响应:" + pong);
// 4. 写入并读回,验证读写链路
jedis.set("install:check", "OK");
String value = jedis.get("install:check");
System.out.println("读取到的值:" + value);
// 5. 清理测试数据
jedis.del("install:check");
if ("PONG".equals(pong) && "OK".equals(value)) {
System.out.println("Redis 安装验证通过");
}
} catch (Exception e) {
System.err.println("Redis 连接失败,请检查:服务是否启动、端口是否放行、密码是否正确");
e.printStackTrace();
}
}
}
对应的 pom.xml 依赖:
xml
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
API 速览
| 命令 / 文件 | 作用 | 关键参数 |
|---|---|---|
tar -zxvf |
解压 .tar.gz 源码包 |
-C 指定目标目录 |
yum install -y gcc-c++ |
安装 C/C++ 编译环境 | -y 自动确认 |
make |
依据 Makefile 编译源码 |
在源码根目录执行 |
make install |
安装编译产物 | 在 src 目录执行 |
redis-server |
启动 Redis 服务端 |
后接配置文件路径 |
redis-cli |
命令行客户端 | -h 主机、-p 端口、-a 密码 |
redis-benchmark |
性能压测工具 | -n 请求数、-c 并发数 |
redis.conf |
Redis 主配置文件 |
无 |
redis-server.exe |
Windows 服务端 | 双击或命令行启动 |
redis-cli.exe |
Windows 客户端 | 同上 |
官方文档
- Redis 官方下载页:https://redis.io/download
- Redis 官方安装文档:https://redis.io/docs/getting-started/installation/
- Redis Windows 版本(微软归档):https://github.com/microsoftarchive/redis
- GNU Make 手册:https://www.gnu.org/software/make/manual/
总结
本文对比了 Redis 在两类平台上的安装差异:Windows 版是绿色软件,解压即用,属于二进制发布包安装;Linux 版以源码工程发布,属于源码编译安装,必须依次完成「解压 → 装 gcc-c++ → make 编译 → make install」四步,其中 gcc 环境是编译 C 源码的前提,缺之必然失败。安装产物集中在 src 目录,核心是 redis-server 与 redis-cli 两个可执行文件,而所有运行期行为都由根目录的 redis.conf 控制,这也是后续配置后台运行、密码认证与远程连接的唯一入口。