TT Bigdata TT Bigdata
首页
GitHub (opens new window)
JaneTTR

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 开发环境

  • Ambari 编译

  • Bigtop 编译

  • Ambari 源码编译

  • 前端开发

  • 后端开发

  • 官方组件编译

  • 扩展组件编译

    • Sqoop编译

    • Ranger编译

    • Phoenix编译

    • Dolphinscheduler编译

    • Doris编译

    • Cloudbeaver编译

    • Atlas编译

      • version-2.4.0

        • Atlas_2.4.0编译
        • [O]Atlas版本适配改造(一)
        • [O]Atlas版本适配改造(二)
          • 背景说明
          • 为什么要把 python3 改成 python?
          • 具体调整内容
            • 修改前后示例
        • [O]Atlas版本适配改造(三)
        • [B]Atlas版本适配改造(一)
    • Superset编译

    • Celeborn编译

    • Ozone编译

    • Impala编译

    • Trino编译

    • Paimon编译

    • Hudi编译

  • 源码编译
  • 扩展组件编译
  • Atlas编译
  • version-2.4.0
JaneTTR
2025-05-06
目录
背景说明
为什么要把 python3 改成 python?
具体调整内容
修改前后示例

[O]Atlas版本适配改造(二)

# 背景说明

提示

在大数据平台适配与运维过程中,经常遇到 Python 解释器软链不一致导致脚本运行失败的问题。特别是在 CentOS、RedHat、Ubuntu 等不同 Linux 发行版下,python 和 python3 的实际指向经常不同,极易踩坑。为此,本轮适配重点是将所有 Atlas 相关 Python 脚本的 shebang(首行解释器声明)统一,从而提升项目在各类主流系统上的兼容性和一键运维体验。

# 为什么要把 python3 改成 python?系统兼容性

  • CentOS 7/8、RedHat 等系统,python 通常指向 Python2,且未必自带 python3 命令。
  • Ubuntu 20.04+、Debian 10+ 等较新系统,python 往往已指向 Python3。
  • 部分 CI/CD、云主机、企业运维镜像,更是只有 python,没有 python3 的软链或命令。

# 具体调整内容

本轮 shebang 规范化操作,需把下图所示的所有 Python 文件的首行由 python3 改为 python,以提升兼容性。

image-20250518175214139

# 修改前后示例

  • 原始写法:

    #!/usr/bin/env python3
    
    1
  • 统一为:

    #!/usr/bin/env python
    
    1
#Atlas#Bigtop#源码编译#版本适配#Python
[O]Atlas版本适配改造(一)
[O]Atlas版本适配改造(三)

← [O]Atlas版本适配改造(一) [O]Atlas版本适配改造(三)→

最近更新
01
当前版本 2026/08
08-29
02
把 Ambari Server HA 稳稳地跑起来
08-17
03
从一次启用操作追到主备就绪
08-17
更多文章>
Theme by Vdoing | Copyright © 2017-2026 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式