ambari生成インストール手記

9187 ワード

psutils-compileエラー


buildの時にエラーを報告しました:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (psutils-compile) on project ambari-metrics-host-monitoring: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ..."true" dir="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap">... @ 4:275 in /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/antrun/build-psutils-compile.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (psutils-compile) on project ambari-metrics-host-monitoring: An Ant BuildException has occured: exec returned: 1
around Ant part ..."true" dir="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap">... @ 4:275 in /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/antrun/build-psutils-compile.xml

このエラー情報に基づいてxmlファイルを開きます.

<project name="maven-antrun-" default="psutils-compile"  >
<target name="psutils-compile">
  <exec failonerror="true" dir="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap">
    <arg value="setup.py"/>
    <arg value="build"/>
    <arg value="--build-platlib"/>
    <arg value="/root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_build"/>
  exec>
target>
project>

パラメータを付けてwrapを実行しました.
[root@bluejoe0 apache-ambari-2.4.2-src]# /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/uniython-wrap setup.py build --build-platlib /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_build
/usr/bin/python2: can't open file 'setup.py': [Errno 2] No such file or directory
[root@bluejoe0 apache-ambari-2.4.2-src]# cd /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil
[root@bluejoe0 psutil]# /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap setup.py build --build-platlib /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_build
running build
running build_py
running build_ext
building '_psutil_linux' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.6/psutil/_psutil_linux.o
psutil/_psutil_linux.c:12:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:23:
psutil/_psutil_linux.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:50: warning: implicit declaration of function ‘syscall’

このようなエラーは、python-develバージョンのインストールが必要だとネットで調べたので、次のようにします.
yum install python-devel.x86_64

そして再びbuildをして、問題は消えました!!

buildNumber問題

ambari-agent start
/usr/sbin/ambari-agent: line 23: buildNumber: unbound variable

個人的にこれがインストーラのバグだと判断し、ambari-agentスクリプトを開き、${buildNumber}を2.4.0.0の数字に変えればいい.