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

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 报错解决

    • Ambari 报错
    • Bigtop 报错
      • Hadoop

      • Spark

      • Trino

      • Hudi

      • Paimon

      • Livy

      • Flink

      • Atlas

      • Superset

      • Jsvc

      • Zookeeper

        • ZooKeeper 构建(缺少 hostname 命令)
          • 一、报错现象
          • 二、原因分析
          • 三、解决办法
            • 1、一条命令修复
            • 2、验证是否安装成功
            • 3、构建重新执行
        • cppunit-devel 依赖缺失解决方案
      • Hive

      • Sqoop

      • Cloudbeaver

      • Bigtop-select

      • Knox

      • Hue

  • 系统适配

  • 监控与调优

  • BUG临时处理
  • 实验室

  • 运维资料
  • 报错解决
  • Bigtop 报错
  • Zookeeper
JaneTTR
2025-09-28
目录
一、报错现象
二、原因分析
三、解决办法
1、一条命令修复
2、验证是否安装成功
3、构建重新执行

ZooKeeper 构建(缺少 hostname 命令)Kylin10

# 一、报错现象

在 Kylin v10 环境下执行 ZooKeeper 构建时,日志提示如下:

06:36:28.584 [QUIET] [system.out] [INFO] Apache ZooKeeper ................................... FAILURE [  4.115 s]
06:36:28.584 [QUIET] [system.out] [INFO] Apache ZooKeeper - Documentation ................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Jute ............................ SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Server .......................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Client .......................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Client - C ...................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Recipes ......................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Recipes - Election .............. SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Recipes - Lock .................. SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Recipes - Queue ................. SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Assembly ........................ SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Contrib ......................... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Contrib - Loggraph .............. SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Contrib - Rest .................. SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] Apache ZooKeeper - Contrib - ZooInspector .......... SKIPPED
06:36:28.585 [QUIET] [system.out] [INFO] ------------------------------------------------------------------------
06:36:28.585 [QUIET] [system.out] [INFO] BUILD FAILURE
06:36:28.585 [QUIET] [system.out] [INFO] ------------------------------------------------------------------------
06:36:28.585 [QUIET] [system.out] [INFO] Total time:  4.277 s
06:36:28.585 [QUIET] [system.out] [INFO] Finished at: 2025-09-26T06:36:28Z
06:36:28.585 [QUIET] [system.out] [INFO] ------------------------------------------------------------------------
06:36:28.586 [QUIET] [system.out] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) o
n project parent: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "hostname": error=2,
 No such file or directory
06:36:28.587 [QUIET] [system.out] [ERROR] around Ant part ...<exec outputproperty="host.name" executable="hostname"/>... @ 5:59 i
n /opt/modules/bigtop/build/zookeeper/rpm/BUILD/apache-zookeeper-3.5.9/target/antrun/build-main.xml
06:36:28.587 [QUIET] [system.out] [ERROR] -> [Help 1]
06:36:28.587 [QUIET] [system.out] [ERROR]
06:36:28.587 [QUIET] [system.out] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
06:36:28.587 [QUIET] [system.out] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
06:36:28.587 [QUIET] [system.out] [ERROR]
06:36:28.587 [QUIET] [system.out] [ERROR] For more information about the errors and possible solutions, please read the following
 articles:
06:36:28.587 [QUIET] [system.out] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
06:36:28.605 [QUIET] [system.out]
06:36:28.605 [ERROR] [system.err] error: Bad exit status from /var/tmp/rpm-tmp.UTpWbM (%build)
06:36:28.605 [QUIET] [system.out]
06:36:28.606 [ERROR] [system.err]     Bad exit status from /var/tmp/rpm-tmp.UTpWbM (%build)
06:36:28.606 [QUIET] [system.out] RPM build errors:
06:36:28.608 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED

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

image-20250926143825323

报错关键信息

  • Cannot run program "hostname"
  • error=2, No such file or directory
  • Ant <exec executable="hostname"/> 无法执行

# 二、原因分析

结论先行

这是 系统缺少 hostname 命令 导致的构建失败,而不是 Maven 或 ZooKeeper 源码问题。

  1. ZooKeeper 构建脚本使用 maven-antrun-plugin 调用 Ant,Ant 脚本里通过 <exec executable="hostname"/> 获取主机名;
  2. 在 Kylin v10 的最小化安装环境下,hostname 工具并未默认安装;
  3. 当 Ant 执行时无法找到该二进制文件,直接抛出 java.io.IOException: error=2,最终导致构建失败。

注意

很多企业内网或 CI/CD 容器环境都会遇到类似问题,因为镜像精简后往往缺少常用命令。

# 三、解决办法

# 1、一条命令修复

直接安装缺失的 hostname 工具:

yum install -y hostname
1

安装完成后再次执行构建即可恢复正常。

# 2、验证是否安装成功

which hostname
hostname
1
2

正常情况下会输出 /usr/bin/hostname 路径以及当前机器名。

# 3、构建重新执行

重新运行 ZooKeeper 构建链路:

gradle zookeeper-pkg \
-PparentDir=/usr/bigtop \
-Dbuildwithdeps=true \
-PpkgSuffix

1
2
3
4
5

此时不再报错,ZooKeeper 模块可顺利通过。

#ZooKeeper#Bigtop#错误排查#RPM#Kylin V10
jsvc 依赖缺失导致 rpm 构建失败
cppunit-devel 依赖缺失解决方案

← jsvc 依赖缺失导致 rpm 构建失败 cppunit-devel 依赖缺失解决方案→

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