Ambari 2.7.5 installation failure on CentOS 7

@KonstantinPopov

For the MojoExecutionException errors you are having above, you need to do some additional work inside of your build environment. If you follow the directions exactly, you still have to get correct versions of maven, npm, and nodejs before building the ambari packages with the ambari mvn commands. Also in ambari-admin pom.xml you need to set the versions for Node/NPM. Then it should build correctly.

My full history for Centos 7.4 is as follows:

[root@c7401 apache-ambari-2.7.5-src]# history
    1  yum install wget rsync nano maven java java-devel rpm-build gcc -y
    2  yum install ntp python python-devel rpm-build gcc-c++ java-1.7.0-openjdk java-1.7.0-openjdk-devel git -y
    3  wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
    4  sh setuptools-0.6c11-py2.7.egg
    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
   15  wget https://downloads.apache.org/ambari/ambari-2.7.5/apache-ambari-2.7.5-src.tar.gz
   16  tar xfvz apache-ambari-2.7.5-src.tar.gz
   17  cd apache-ambari-2.7.5-src
   19  cd ambari-admin
   28  yum --enablerepo=extras install epel-release
   29  yum install npm -y
   32  node -v
   33  npm -v
   34  nano pom.xml
   35  cd ..
   36  mvn versions:set -DnewVersion=2.7.5.0.0
   37  pushd ambari-metrics
   38  mvn versions:set -DnewVersion=2.7.5.0.0
   39  popd
   40  mvn -B clean install rpm:rpm -DnewVersion=2.7.5.0.0 -DbuildNumber=5895e4ed6b30a2da8a90fee2403b6cab91d19972 -DskipTests -Dpython.ver="python >= 2.7"
   41  yum install /root/apache-ambari-2.7.5-src/ambari-server/target/rpm/ambari-server/RPMS/x86_64/ambari-server-2.7.5.0-0.x86_64.rpm
   42  yum install /root/apache-ambari-2.7.5-src/ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/ambari-agent-2.7.5.0-0.x86_64.rpm

Contents of maven file:

export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export M2_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}

Change in Ambari Admin Pom File: (Make sure your versions are correct)

           <configuration>
              <nodeVersion>v6.17.1</nodeVersion>
              <npmVersion>3.10.10</npmVersion>
              <workingDirectory>src/main/resources/ui/admin-web/</workingDirectory> 
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
            </configuration>

Leave a Comment