Error building ambari 2.7.5 Centos 7 (fails at ambari-admin step)

纵饮孤独 提交于 2020-06-26 06:14:52

问题


I am trying to build ambari 2.7.5 on Centos 7 per these instructions, which is relatively straightforward.

However, when the build gets to ambari-admin, it fails. There are several posts out there that describe a supposed solution to this- which is editing "...ambari-admin/pom.xml" and setting the node and npm versions to match the versions installed on the server.

Sadly, this does not work for me. And I have tried the versions of node/npm that come with Centos(EPEL), I have tried the LATEST node/npm versions from apache, and I've tried older versions. I edit the pom.xml file to match.

In the end, it is always the exact same failure regardless of the dozens of attempts using the above.

mvn -B clean install rpm:rpm -DnewVersion=2.7.5.0.0 -DbuildNumber=5895e4ed6b30a2da8a90fee2403b6cab91d19972 -DskipTests -Dpython.ver="python >= 2.6"


[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:05 min
[INFO] Finished at: 2020-06-11T15:43:05-05:00
[INFO] Final Memory: 43M/2151M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (Bower install) on project ambari-admin: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (Bower install) on project ambari-admin: Command execution failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
        ... 22 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :ambari-admin

Lastly, I've ALSO tried downgrading what I am building- trying 2.7.4, 2.7.3,.. and same thing.

Clearly, it appears I am missing something basic but I have no idea what.

Here is the typical setup I do before executing the above mvn build command:

export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export M2_HOME=/usr/local/apache-maven-3.3.9
export MAVEN_HOME=/usr/local/apache-maven-3.3.9
export PATH=${M2_HOME}/bin:${PATH}
export _JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"


# npm -v
3.10.10
# node -v
v6.17.1
# mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_252, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1127.8.2.el7.x86_64", arch: "amd64", family: "unix"

cd /usr/local/src
wget https://www-eu.apache.org/dist/ambari/ambari-2.7.5/apache-ambari-2.7.5-src.tar.gz
tar xfvz apache-ambari-2.7.5-src.tar.gz
cd apache-ambari-2.7.5-src
mvn versions:set -DnewVersion=2.7.5.0.0

pushd ambari-metrics
mvn versions:set -DnewVersion=2.7.5.0.0
popd

回答1:


The solution you are looking for is to edit

ambari-admin/pom.xml

You will need to update your version of npm/node. For example in my build today:

<nodeVersion>v10.21.0</nodeVersion>
<npmVersion>6.14.4</npmVersion>

Those versions are in the build and the build environment. I had to go backwards from node14 to node 10 in order to get dependencies to work all way through to the next bower/angular conflict.

Depending on your build environment you may also need to edit

ambari-admin/src/main/resources/ui/admin-web/bower.json

For example in my build today:

{
  "name": "adminconsole",
  "private": true,
  "dependencies": {
    "bootstrap": "3.3.7",
    "angular": "1.3.0",
    "angular-route": "1.3.0",
    "angular-bootstrap": "0.11.0",
    "underscore": "1.7.0",
    "restangular": "1.4.0",
    "angular-bootstrap-toggle-switch": "0.5.1",
    "angular-animate": "1.3.0",
    "angular-translate": "~2.8.1",
    "font-awesome": "4.2.0"
  },
  "devDependencies": {
    "angular-mocks": "1.3.0",
    "commonjs": "0.2.0",
    "chai": "1.8.0",
    "mocha": "1.14.0",
    "sinon": "1.10.3"
  }
}

You may also need to get maven 3.6.3:

    5 wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
    6  tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
    7  ln -s /opt/apache-maven-3.6.3 /opt/maven
    8  nano /etc/profile.d/maven.sh
    9  chmod +x /etc/profile.d/maven.sh
   10  source /etc/profile.d/maven.sh
   11  mvn -v

You can find more info on this post:

Ambari 2.7.5 installation failure on CentOS 7



来源:https://stackoverflow.com/questions/62333719/error-building-ambari-2-7-5-centos-7-fails-at-ambari-admin-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!