Building Ambari 2.7.5 on CentOS 7 from source, Worked 2 weeks ago, now fails

假如想象 提交于 2020-07-09 11:54:49

问题


Followed instructions here: Ambari 2.7.5 installation failure on CentOS 7

I followed the exact same instructions and am now getting this from ambari-admin section of the build:

[INFO] --- exec-maven-plugin:1.2.1:exec (Bower install) @ ambari-admin ---
bower angular-route#*           
bower angular-route#*         
bower underscore#1.7.0        
bower underscore#1.7.0        
bower bootstrap#3.3.7         
bower bootstrap#3.3.7         
bower angular-mocks#*         
bower angular-mocks#*         
bower angular#*               
bower angular#*               
bower font-awesome#4.2.0      
bower font-awesome#4.2.0      
bower angular-translate#*     
bower angular-translate#*     
bower chai#1.8.0              
bower chai#1.8.0              
bower mocha#1.14.0            
bower mocha#1.14.0            
bower angular-animate#*       
bower angular-animate#*       
bower angular-bootstrap-toggle-switch#0.5.1         
bower angular-bootstrap-toggle-switch#0.5.1         
bower restangular#1.4.0                             
bower restangular#1.4.0                             
bower commonjs#0.2.0                                
bower commonjs#0.2.0                                
bower sinon#1.10.3                                  
bower sinon#1.10.3                                  
bower angular-bootstrap#0.11.0                      
bower angular-bootstrap#0.11.0                      
bower angular#>=1.2.26 <1.8                         
bower angular#>=1.2.26 <1.8                         
bower lodash#>=1.3.0 <2.5.0                         
bower lodash#>=1.3.0 <2.5.0                         
bower angular#>=1                                   
bower angular#>=1                                   
bower jquery#1.9.1 - 3                              
bower jquery#1.9.1 - 3                              
bower ECONFLICT Unable to find suitable version for angular    

I can supply the entire stack if necessary.

Questions I have are: 1. Why did the project build 2 weeks ago and with absolutely no changes now fails with the above stack? 2. What to do to fix this?

Really appreciate any input or help.

As requested, here are the steps that I followed:

1. Using lxc to create centOS 7 x86_64 environment:
     lxc launch images:centos/7/amd64 cent7

2. Attach to that kernal, this logs you in as root in a bash shell
     lxc exec cent7 bash

3. Install necessary packages
    yum install -y which
    yum install -y wget
    yum install -y rpm-build*
    yum install -y gcc*
    yum install -y git*
    yum install -y python-devel*
    yum install -y maven 
       (This installs an old version,3.0.5, but takes care of all dependencies such as java)

    Get latest version of maven, Ambari build needs at least 3.3.9
      mkdir /maven363 ; cd /maven363
      wget http://mirror.cogentco.com/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
      tar zxf apache-maven-3.6.3-bin.tar.gz
      ## Setup paths to this maven in .bashrc file
      vi ~/.bashrc
        export PATH=/maven363/apache-maven-3.6.3/bin:$PATH
        export _JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"
      ## Instantiate the above .bashrc changes
         . ~/.bashrc

    Get python tools for python 2.7
        mkdir /PythonTools ; cd /PythonTools/
        wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea

        sh setuptools-0.6c11-py2.7.egg

4. Get the Ambari source code
       mkdir /Ambari275 ; cd /Ambari275
       wget https://www-eu.apache.org/dist/ambari/ambari-2.7.5/apache-ambari-2.7.5-src.tar.gz

5. Untar the file
    tar zxf apache-ambari-2.7.5-src.tar.gz 

6. Fix the ambari-admin pom.xml file to load the correct versions of npm and node.js (This module had compilation errors),
   Found fix information here:
      https://stackoverflow.com/questions/61542102/ambari-2-7-5-installation-failure-on-centos-7

   cd /Ambari275/apache-ambari-2.7.5-src/ambari-admin
   vi pom.xml

     From:
         <nodeVersion>v4.5.0</nodeVersion>
         <npmVersion>2.15.0</npmVersion>
     To:
        <nodeVersion>v6.17.1</nodeVersion>
        <npmVersion>3.10.10</npmVersion>

7. Now follow all instructions here:
    https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.7.5

回答1:


Q1: Something must have changed in your build environment. Either way, if the versions in the build environment are not ideal, the dependencies deeper in the entire project have conflicts.

Q2: The solution you are looking for is to modify the following file:

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

The contents should be:

{
  "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"
  }
}

And the build environment has the following versions:

npm -v
    6.14.4
node -v
    v10.21.0
python -V
    Python 2.7.18
mvn -v
    Apache Maven 3.6.3 

You may need to play around with the angular version(s). The snippet I posted above is one that worked for me today in a different operating system (SUSE / openSUSE). I do not get this error in centos. I have authored and participated in some of the recent SO threads on it so getting pretty deep in Ambari 2.7.5 from Source.



来源:https://stackoverflow.com/questions/62251610/building-ambari-2-7-5-on-centos-7-from-source-worked-2-weeks-ago-now-fails

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