当前位置: 首页 > news >正文

详细介绍:【Kylin V10】Ambari3.0.0 安装 Unexpected error Ambari repo file path not set for current OS 报错解决

在这里插入图片描述
在这里插入图片描述
我们计划近期上线kylin 版本的 Ambari+Bigtop。尽情期待!

也可以看这里 https://doc.janettr.com/install/manual/

一、先看结论

通过在代码中增加对 Kylin V10 的识别逻辑,
Ambari 已能正确识别系统为 RedHat 家族,并顺利执行 ambari-server setup

验证输出如下:

family = redhat
is_redhat_family = True

执行结果:

改造成功图

二、问题现象

在 Kylin V10 环境执行 Ambari 初始化命令时:

ambari-server setup --java-home /usr/jdk64/jdk17 --stack-java-home /usr/jdk64/jdk1.8

屏幕输出如下:

image-20250929160542690

Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? n
ERROR: Unexpected error Ambari repo file path not set for current OS.
ERROR: Exiting with exit code 1.
REASON: Failed to create user. Exiting.
expect: spawn id exp5 not open
while executing
"expect "Enter advanced database configuration""
Authorized users only. All activities may be monitored and reported.

报错说明
Ambari 无法识别当前系统的 repo 管理器类型(yum/apt/zypper),
因此无法定位 ambari.repo 的路径,导致安装初始化中断。

三、源码追踪:异常触发位置

查看堆栈日志与源码,可发现错误来自:

image-20251014173322727

关键函数如下:

def get_ambari_repo_file_full_name():
if OSCheck.is_ubuntu_family():
ambari_repo_file = "/etc/apt/sources.list.d/ambari.list"
elif OSCheck.is_redhat_family():
ambari_repo_file = "/etc/yum.repos.d/ambari.repo"
elif OSCheck.is_suse_family():
ambari_repo_file = "/etc/zypp/repos.d/ambari.repo"
elif OSCheck.is_windows_family():
ambari_repo_file = os.path.join(
os.environ[ChocolateyConsts.CHOCOLATEY_INSTALL_VAR_NAME],
ChocolateyConsts.CHOCOLATEY_CONFIG_DIR,
ChocolateyConsts.CHOCOLATEY_CONFIG_FILENAME,
)
else:
raise Exception("Ambari repo file path not set for current OS.")
return ambari_repo_file

由此可见,当 is_redhat_family() 返回 False 时,Ambari 就会直接抛出此异常。

四、根因剖析:OSCheck 未识别 Kylin 系统

Ambari 的 OSCheck 模块用于判断系统属于哪个发行版家族:

  • 仅识别 redhat、centos、rhel、ubuntu、suse、debian 等主流;
  • Kylin V10(中科麒麟)虽然基于 RHEL,但其 /etc/os-release 中标识为:

/etc/os-release(Kylin V10)

NAME="Kylin Linux Advanced Server"
VERSION="V10 (Lance)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Lance)"

因此,Ambari 的 get_os_family() 返回值为 unknown
从而导致 repo 路径无法确定,抛出异常。

五、修复思路:让 Ambari 识别 Kylin 属于 RedHat 家族

温馨提示
由于改造的地方较多,需要重新编译生效,纯改python不会生效,请继续阅读 not set for current OS 其他章节,跟着步骤解决 戳我查看

在这里插入图片描述

六、验证与改造结果

输出结果如下:

dist = ('kylin', 'V10', 'Halberd')
type = kylin
family = redhat
is_redhat_family = True

改造后输出结果图

此时 ambari-server setup 已可顺利执行,
系统被识别为 RedHat 系列,Ambari 初始化阶段恢复正常。

http://www.jsqmd.com/news/38490/

相关文章:

  • TCP和UDP区别
  • python异步协程
  • 设计QQ,网络协议如何设计
  • 实战干货:Apache DolphinScheduler 参数使用与优化总结
  • 代码随想录Day8_字符串
  • 实用指南:Rust Slint实现列表式消息提示(Notification Dialog)源码分享
  • 软件工程团队作业2
  • 逆向基础--数据传输指令xlat push pop lea-lds-les (11)
  • RED 状态
  • EMS4100N芯祥科技USB3.1高速双向模拟开关芯片资料,可pin对pin替代ASW3410
  • Chromium扩展策略绕过漏洞CVE-2025-12436安全分析
  • 让AI替你写用例!Dify+RAG工作流,一键生成覆盖率达90%的测试方案
  • 2025年脱硫除臭菌实力厂家权威推荐榜单:微生物除臭剂/硝化细菌/氨氮去除菌源头厂家精选
  • 图库函数集
  • 国产水质检测仪厂家推荐:采购COD检测仪/总氮/总磷/余氯检测仪的注意事项
  • V4L2的pad连接
  • 2025年11月全自动红外测油仪采购推荐:国产全自动红外测油仪品牌推荐,哪家好?
  • aws的iam
  • 10分钟搞懂!化学人刚需的6大核心期刊
  • 2025-2026年水质测定仪品牌推荐:总磷/总氮/氨氮/COD测定仪哪个品牌好?
  • 副本分片重建
  • 2025年空化液体电辅供热机组定制厂家权威推荐榜单:电锅炉/工业电锅炉/水分子物化供热机组源头厂家精选
  • 详细介绍:STM32 GPIO-------设置成51单片机模式输出
  • 2025高压加速老化/HAST/PCT/热流仪厂家推荐伟煌试验设备,专业可靠!
  • PK6500无源探头在5G基站射频模块测试中的应用方案
  • 2025开窗器/链条/机芯/配件厂家推荐湖州万荣,专业制造品质保障
  • 画图
  • 2025膜结构车棚/景观/体育看台/污水池加盖厂家推荐潍坊乾多,专业建造,品质保障
  • 2025 年 11 月配电柜/配电箱/开关柜厂家推荐排行榜,智能配电系统,低压配电柜,高压开关柜,户外配电箱公司推荐
  • 2025年11月学习平板推荐!学而思凭 AI功能成家长首选