TT Bigdata TT Bigdata
首页
  • 部署专题

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

    • 安装指导
    • 开启 Kerberos
    • 魔改分享
  • 版本专题

    • 更新说明
    • BUG临时处理
  • 实验室

    • VIEW插件
    • JIRA速查
  • Ambari-Env

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

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

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

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

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

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

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

    • Kylin V10系列
    • Rocky系列
    • Ubuntu系列
  • Grafana监控方案

    • Ambari-Metrics插件
    • Infinity插件
  • 支持&共建

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

JaneTTR

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

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

    • 安装指导
    • 开启 Kerberos
    • 魔改分享
  • 版本专题

    • 更新说明
    • BUG临时处理
  • 实验室

    • VIEW插件
    • JIRA速查
  • Ambari-Env

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

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

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

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

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

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

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

    • Kylin V10系列
    • Rocky系列
    • Ubuntu系列
  • Grafana监控方案

    • Ambari-Metrics插件
    • Infinity插件
  • 支持&共建

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

    • not set for current OS

      • 解读-不支持操作系统解读
      • 解决-增加系统支持范围(一)
      • 解决-增加系统支持范围(二)
      • 解决-增加系统支持范围(三)
        • 一、背景与目标
        • 二、修改位置与作用
        • 三、为什么是 kylin10?
        • 四、完整配置参考
        • 五、常见问题与错误分析
          • 1. family 名称能否随意填写?
          • 2. 是否支持通配符或逗号分隔?
          • 3. 为什么 agent 注册时报错?
        • 六、匹配流程原理解析
      • 解决-增加系统支持范围(四)
    • 解决-TLS1.3导致依赖下载失败终极办法
  • SYS-Kylin V10
  • 通用部分
  • not set for current OS
JaneTTR
2025-10-16
目录

解决-增加系统支持范围(三)

repoinfo 专题

本章节修改的代码位置如下:

ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/repos/repoinfo.xml

# 一、背景与目标 镜像源植入

在前两节中,我们已经完成:

  1. OSCheck 模块 —— 识别 Kylin 系统类型;
  2. os_family.json —— 建立 Kylin 与 RedHat 的继承关系。

但 Ambari 的“家族识别”只是基础。
要让安装界面真正出现 Kylin 10 的镜像源,还需要修改仓库定义文件:
repoinfo.xml。

image-20251015155001876

# 二、修改位置与作用

repoinfo.xml 是 Ambari 在 选择操作系统镜像源 时的关键配置文件。
它定义了每个 OS 家族与对应仓库的映射关系。
例如:

    
    <reposinfo>
        <os family="redhat7">
            <repo>
                <baseurl>http://your-repo/</baseurl>
                <repoid>BIGTOP-3.2.0</repoid>
                <reponame>bigtop</reponame>
            </repo>
        </os>
        <os family="redhat8">
            <repo>
                <baseurl>http://your-repo/</baseurl>
                <repoid>BIGTOP-3.2.0</repoid>
                <reponame>bigtop</reponame>
            </repo>
        </os>
        <os family="ubuntu22">
            <repo>
                <baseurl>http://your-repo/</baseurl>
                <repoid>BIGTOP-3.2.0</repoid>
                <reponame>bigtop</reponame>
            </repo>
        </os>
    </reposinfo>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    <reposinfo>
        ...
        <os family="kylin10">
            <repo>
                <baseurl>http://your-repo/</baseurl>
                <repoid>BIGTOP-3.2.0</repoid>
                <reponame>bigtop</reponame>
            </repo>
        </os>
    </reposinfo>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    // Make sure to add code blocks to your code group

    新增的 os family="kylin10" 节点告诉 Ambari: 当检测到系统类型为 Kylin 10 时,从该节点读取镜像配置。

    # 三、为什么是 kylin10?源自 Python 层识别

    这个 family 值并不是随便写的。 它来自于我们在 Python 层中 OSCheck.get_os_type() 与 get_os_version() 的拼接逻辑:

    return OSCheck.get_alias(OSCheck._get_os_type(), OSCheck._get_os_version())[0]
    
    1

    示例结果:

    os_type = kylin
    os_version = 10
    family = kylin10
    
    1
    2
    3

    所以,这里 <os family="kylin10"> 必须与 Python 输出完全一致,否则前端不会识别到镜像源。

    # 四、完整配置参考

      <?xml version="1.0"?>
      <!--
         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.
      -->
      <reposinfo>
          <os family="redhat7">
              <repo>
                  <baseurl>http://your-repo/</baseurl>
                  <repoid>BIGTOP-3.2.0</repoid>
                  <reponame>bigtop</reponame>
              </repo>
          </os>
          <os family="redhat8">
              <repo>
                  <baseurl>http://your-repo/</baseurl>
                  <repoid>BIGTOP-3.2.0</repoid>
                  <reponame>bigtop</reponame>
              </repo>
          </os>
          <os family="ubuntu22">
              <repo>
                  <baseurl>http://your-repo/</baseurl>
                  <repoid>BIGTOP-3.2.0</repoid>
                  <reponame>bigtop</reponame>
              </repo>
          </os>
          <os family="kylin10">
              <repo>
                  <baseurl>http://your-repo/</baseurl>
                  <repoid>BIGTOP-3.2.0</repoid>
                  <reponame>bigtop</reponame>
              </repo>
          </os>
      </reposinfo>
      
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      // Make sure to add code blocks to your code group

      核心逻辑

      Ambari 前端会根据 server 返回的 os_family 值, 自动从 repoinfo.xml 匹配相同 family 节点,渲染镜像配置页面。

      # 五、常见问题与错误分析

      # 1. family 名称能否随意填写?

      ❌ 不行。 family 名称必须与 OSCheck 输出保持一致,否则无法匹配。

      # 2. 是否支持通配符或逗号分隔?

      ❌ 不支持。 Ambari 读取时会严格进行字符串匹配,不支持模式匹配。

      # 3. 为什么 agent 注册时报错?

      在安装 Agent 阶段,如果出现如下错误:

      image-20251015162021704

      Cannot register host with not supported os type serverOsType= agentOsType=
      
      1

      说明 服务端与 Agent 的系统家族识别不一致。

      • serverOsType 来源于 ambari.properties;
      • agentOsType 来自心跳注册时发送的主机系统信息。

      image-20251015163503949

      服务端通过 OSCheck 比对两者,一旦不匹配,就会拒绝注册。

      解决建议

      确保 server 和 agent 端的 os_family、os_type 均为 "kylin", 并在 repoinfo.xml 中定义了对应的 family="kylin10" 节点。

      # 六、匹配流程原理解析 深度理解

      Ambari 在执行系统比对时,会经过以下步骤:

      1. Agent 心跳注册 Agent 调用 register(),上报自身系统信息:

        os_type=kylin
        os_family=kylin
        os_release=10
        
        1
        2
        3
      2. Server 校验 Server 侧从配置中读取 os_family, 并根据 os_family.json 推导出该系统的继承链。

      3. 仓库匹配 Server 返回家族类型 → 前端 UI 读取 repoinfo.xml → 渲染镜像选项。

      4. 注册完成 若匹配成功,则进入安装阶段,否则返回 “unsupported os type”。

      1f5d1104c1cfff73cd44087602b95b4f

      点击展开:匹配过程时序图(简化版)

      Agent ---> Server (register with os_type=kylin, os_release=10)
         ↓
      Server 调用 OSCheck.get_os_family() → kylin
         ↓
      Server 比对 repoinfo.xml 中 family="kylin10"
         ↓
      匹配成功 → 返回镜像信息
      
      1
      2
      3
      4
      5
      6
      7

      下一节预告

      接下来我们将讲解 链接系统版本与metainfo.xml的桥梁。

      #Ambari#Kylin V10#OSCheck#os_family.json#repoinfo.xml#源码修复#镜像源
      解决-增加系统支持范围(二)
      解决-增加系统支持范围(四)

      ← 解决-增加系统支持范围(二) 解决-增加系统支持范围(四)→

      最近更新
      01
      Ambari开启Kerberos认证加密类型错误 Kylin V10
      11-05
      02
      KERBEROS SERVICE CHECK 报错
      11-04
      03
      Test Kerberos Client报错:Failed to kinit
      11-04
      更多文章>
      Theme by Vdoing | Copyright © 2017-2025 JaneTTR | MIT License
      • 跟随系统
      • 浅色模式
      • 深色模式
      • 阅读模式