TT Bigdata TT Bigdata
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop-官方组件
    • 专区—Bigtop-扩展组件
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 核心代码

    • 各组件代码
    • 通用代码模板
  • 国产化&其他系统

    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 支持&共建

    • 蓝图愿景
    • 技术支持
    • 合作共建
登陆
GitHub (opens new window)

JaneTTR

数据酿造智慧,每一滴都是沉淀!
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop-官方组件
    • 专区—Bigtop-扩展组件
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 核心代码

    • 各组件代码
    • 通用代码模板
  • 国产化&其他系统

    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 支持&共建

    • 蓝图愿景
    • 技术支持
    • 合作共建
登陆
GitHub (opens new window)
  • Bigtop通用部分

    • Step0-源码获取
    • Step1-构建规范的bom
    • Step2-Redis源代码编译
    • Step3-源代码编译脚本构造
      • 1. 目录与脚本位置说明
      • 2. do-component-build 脚本内容详解
      • 3. 文件结构与位置回顾
    • Step4-buildroot处理
    • Step6-Log-编译细节
    • Step7-Log-安装细节
    • Step8-Log-制品细节
    • Step9-版本适配器
  • Bigtop打包部分

  • Ambari部分

  • J-Redis集成-F
  • Bigtop通用部分
JaneTTR
2025-06-24
目录

Step3-源代码编译脚本构造

在掌握了 Redis 源码手动编译流程后,接下来要完成大数据集成环境下自动化编译链路的关键一环:

编写标准的 do-component-build 脚本,规范组件的自动化编译流程。

# 1. 目录与脚本位置说明

首先,需要在 bigtop 工程源码下,进入通用组件目录:

bigtop-packages/src/common
1

然后为 Redis 组件新建专属文件夹:

bigtop-packages/src/common/redis
1

在该目录下,新建一个关键脚本:

do-component-build
1

image-20250624173248318

提示

此脚本作为 bigtop 编译系统的入口点,主要负责驱动 Redis 源码的自动化编译,是后续 RPM 打包和集成流程的核心环节。

# 2. do-component-build 脚本内容详解

脚本内容如下所示,推荐直接采用如下标准格式:

#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

. `dirname $0`/bigtop.bom

# 编译redis
make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
关键说明
  • set -ex:表示遇到任何命令失败立即退出,并输出详细命令行日志,方便排错。
  • . \dirname $0`/bigtop.bom`:自动加载当前组件对应的 BOM 环境变量文件,保证编译环境的统一性和可控性。
  • make:核心编译指令,直接执行 Redis 源码的标准编译流程。

# 3. 文件结构与位置回顾

目录结构示意如下:

bigtop-packages/
├── src/
│   └── common/
│       └── redis/
│           └── do-component-build
1
2
3
4
5
#Redis#bigtop#BOM文件#编译集成
Step2-Redis源代码编译
Step4-buildroot处理

← Step2-Redis源代码编译 Step4-buildroot处理→

最近更新
01
bigtop-select 打包缺 compat 报错修复 deb
07-16
02
bigtop-select 打包缺 control 文件报错修复 deb
07-16
03
首次编译-环境初始化 必装
07-16
更多文章>
Theme by Vdoing | Copyright © 2017-2025 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式