Apache Ambari 坑
- 事先需要安裝的工具
yum install -y git python-devel rpm-build gcc-c++
倉庫鏡像設(shè)置
https://developer.aliyun.com/mirror/
接著安裝nodejs(實測Yum 安裝的nodejs版本很老,導(dǎo)致打包出問題)
wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.gz
tar xvf node-v10.9.0-linux-x64.tar.gz
ln -s /opt/node-v10.9.0-linux-x64/bin/node /usr/bin/node
ln -s /opt/node-v10.9.0-linux-x64/bin/npm /usr/bin/npm
環(huán)境變量設(shè)置
/etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-2.el8_1.x86_64
export MAVEN_HOME=/opt/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin:/opt/phantomjs-1.9.8-linux-x86_64/bin
export _JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"
phantomjs在打包時會用到,如果在PATH路徑找不到phantomjs會去進行下載,因網(wǎng)速問題提前下載好
安裝 maven, JDK8
下載 python2.7 設(shè)置工具
wget https://files.pythonhosted.org/packages/25/5d/cc55d39ac39383dd6e04ae80501b9af3cc455be64740ad68a4e12ec81b00/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg
- 遇到的報錯
-
Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:yarn (yarn install) on project ambari-web: Failed to run task: 'yarn install --ignore-engines --pure-lockfile' failed.
這個問題最容易出現(xiàn),主要是nodejs會通過 yarn去加載依賴包,解決方式是保證網(wǎng)絡(luò)環(huán)境好
-
Could not extract archive: '/root/.m2/repository/xxxxxxx
有可能是因為網(wǎng)絡(luò)問題包沒有下載完整,我遇到了幾個包都不是完整的,所以直接去外面下載然后覆蓋到倉庫中
-
failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Bower install) on project ambari-admin: Command execution failed. Process exited with an error: 1
安裝git
-
找不到 org.json.simple.JSONAware
ambari-metrics/ambari-metrics-storm-sink-legacy/pom.xml
增加json依賴包<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
-
Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ambari-infra-solr-client: An Ant BuildException has occured: The following error occurred while executing this line:
/opt/apache-ambari-2.7.3-src/ambari-infra/ambari-infra-solr-client/build.xml:39: java.net.UnknownHostException: central.maven.org在ambari-infra模塊中有些pom.xml寫的路徑central.maven.org無法訪問了,需要更換為https://repo1.maven.org
具體方式可以進入ambari-infra搜索哪些文件包含central.maven.org:
find ./ | xargs grep central.maven.org
-
Failed to read artifact descriptor for org.apache.storm:storm-core:jar:0.10.0.2.3.0.0-2557: Could not transfer artifact org.apache.storm:storm-core:pom:0.10.0.2.3.0.0-2557 from/to apache-hadoop (http://nexus-private.hortonworks.com/nexus/content/groups/public): Connect to nexus-private.hortonworks.com:80 [nexus-private.hortonworks.com/54.173.242.72] failed: 連接超時
http://nexus-private.hortonworks.com/nexus/content/groups/public無法訪問,通過修改ambari-metrics的pom.xml替換為https://repo.hortonworks.com/content/groups/public
- /usr/sbin/ambari-server : line 33: buildNumber: unbound variable
vim /usr/sbin/ambari-server, Line 33增加?。篹xport buildNumber=2.7.5.0 這里改為版本號即可
- 注意
有時候無故出現(xiàn)問題可以嘗試
a. 刪除target目錄
b. find /repo/ -name "*.lastUpdated" -exec rm -rf {} ;
c. 重新編譯
為了提升速度把maven倉庫改為aliyun
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
如果有些包無法下載則使用
<mirror>
<id>nexus-hortonworks</id>
<mirrorOf>*</mirrorOf>
<name>Nexus hortonworks</name>
<url>https://repo.hortonworks.com/content/groups/public/</url>
</mirror>
當(dāng)卡在下面代碼的時候背后在默默下載很多依賴包,此時要確保網(wǎng)絡(luò)良好,很有可能會出現(xiàn)failed to run task: 'yarn install --ignore-engines --pure-lockfile' failed
[INFO] Running 'yarn install --ignore-engines --pure-lockfile' in /opt/apache-ambari-2.7.3-src/ambari-web
[DEBUG] Executing command line [/opt/apache-ambari-2.7.3-src/ambari-web/node/yarn/dist/bin/yarn, install, --ignore-engines, --pure-lockfile]
[INFO] yarn install v0.23.2
[ERROR] warning Ambari@2.4.0: No license field
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[ERROR] warning fsevents@0.3.8: The platform "linux" is incompatible with this module.
[ERROR] warning fsevents@1.1.1: The platform "linux" is incompatible with this module.
[INFO] info "fsevents@0.3.8" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[INFO] [4/4] Building fresh packages...