Ambari-2.7.7 ソース コードのコンパイル

0 説明

この記事では、Ambari-2.7.7 バージョンに基づいてソース コードをコンパイルします。必要な編集資料は以下のように統一して提供されます。

链接:https://pan.baidu.com/s/1F2D7zBGfKihxTBArnOilTw 
提取码:8m17 

1 前提条件

1.1 ambari ソース パッケージをダウンロードする

wget https://github.com/apache/ambari/releases/tag/release-2.7.7-rc0/ambari-release-2.7.7-rc0.tar.gz
wget https://www-eu.apache.org/dist/ambari/ambari-2.7.7/apache-ambari-2.7.7-src.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/ambari/ambari-2.7.7/apache-ambari-2.7.7-src.tar.gz

いずれかを選択してダウンロードし、ダウンロードが完了したら解凍してください。

tar -zxvf apache-ambari-2.7.7-src.tar.gz
chown -R root:root apache-ambari-2.7.7-src

1.2 ソフトウェアをインストールする必要がある

ジャワ 1.8.0_201
メイブン Apache Maven 3.8.6
rpm-ビルド rpm-build-4.11.3-48.el7_9.x86_64
gcc-c++ 4.8.5
パイソン 2.7.5
Python-開発 python-devel-2.7.5-92.el7_9.x86_64
ギット 1.8.3.1
ノードjs v4.5.0

注意: ①rpm-buildのインストール

yum install rpm-build -y

rpm-build バージョンの表示
ここに画像の説明を挿入
② python-devel のインストール

yum install python-devel -y

インストールされているバージョンを確認する
ここに画像の説明を挿入
③ノードをインストールする

wget https://nodejs.org/dist/v4.5.0/node-v4.5.0-linux-x64.tar.gz
tar -zxvf node-v4.5.0-linux-x64.tar.gz -C /usr/lib/node

インストールが完了したら、npm および node コマンドが正常であることを確認します
ここに画像の説明を挿入
。 注: npm -v の実行時に次のエラーが発生した場合:

Cannot find module ‘npmlog’ 

解決:

# cd 命令进入nodejs安装目录然后执行如下命令,建立软连接:
ln -s ../lib/node_modules/npm/bin/npm-cli.js

④上記でインストールしたjdk/maven/nodeの環境変数を設定します。

#java environment
export JAVA_HOME=/usr/local/java
export CLASSPATH=.:${JAVA_HOME}/jre:${JAVA_HOME}/lib
export PATH=$PATH:${JAVA_HOME}/bin

#maven environment
export MAVEN_HOME=/usr/local/maven/apache-maven-3.8.6
export M2_HOME=/usr/local/maven/apache-maven-3.8.6
export PATH=$PATH:$MAVEN_HOME/bin

#node
export NODE_HOME=/usr/lib/node-v4.5.0-linux-x64
export PATH=$PATH:$NODE_HOME/bin

1.3 Maven ミラーソース構成

conf/settings.xml 構成ファイルを編集し、次のミラー ソースを追加します。これにより、ambari のコンパイル速度が向上します。

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.conf}/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<settings
	xmlns="http://maven.apache.org/SETTINGS/1.2.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
	<!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
	<localRepository>/usr/local/maven/apache-maven-3.8.6/repository</localRepository>
	<!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->
	<!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->
	<!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
	<pluginGroups>
		<!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
	</pluginGroups>
	<!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
	<proxies>
		<!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy><id>optional</id><active>true</active><protocol>http</protocol><username>proxyuser</username><password>proxypass</password><host>proxy.host.net</host><port>80</port><nonProxyHosts>local.net|some.host.com</nonProxyHosts></proxy>
    -->
	</proxies>
	<!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
	<servers>
		<!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server><id>deploymentRepo</id><username>repouser</username><password>repopwd</password></server>
    -->
		<!-- Another sample, using keys to authenticate.
    <server><id>siteServer</id><privateKey>/path/to/private/key</privateKey><passphrase>optional; leave empty if not used.</passphrase></server>
    -->
	</servers>
	<!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
	<mirrors>
		<!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>
     -->
		<!-- Amabri build mirror source -->
		<mirror>
			<id>huaweicloud</id>
			<name>huaweicloud maven</name>
			<mirrorOf>central</mirrorOf>
			<url>https://repo.huaweicloud.com/repository/maven/</url>
		</mirror>
		<mirror>
			<id>nexus-aliyun</id>
			<mirrorOf>central</mirrorOf>
			<name>Nexus aliyun</name>
			<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
		</mirror>
		<mirror>
			<id>alimaven</id>
			<!-- <mirrorOf>central</mirrorOf> -->
			<mirrorOf>central,apache.snapshots.https,maven2-repository.dev.java.net,maven2-glassfish-repository.dev.java.net,maven2-repository.atlassian,apache.staging.https,oss.sonatype.org,spring-milestones</mirrorOf>
			<name>aliyun maven</name>
			<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
		</mirror>
		<mirror>
			<id>nexus-hortonworks</id>
			<mirrorOf>central</mirrorOf>
			<name>Nexus hortonworks</name>
			<url>https://repo.hortonworks.com/content/groups/public/</url>
		</mirror>
		<mirror>
			<id>HDPReleases</id>
			<name>HDP Releases</name>
			<url>https://repo.hortonworks.com/content/repositories/releases/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>
		<mirror>
			<id>WSO2Releases</id>
			<name>WSO2 Dist Repository</name>
			<url>http://dist.wso2.org/maven2/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>
		<mirror>
			<id>MavenCentralReleases</id>
			<name>Maven Central Repository</name>
			<url>https://repo1.maven.org/maven2/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>
	</mirrors>
	<!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
	<profiles>
		<!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile><id>jdk-1.4</id><activation><jdk>1.4</jdk></activation><repositories><repository><id>jdk14</id><name>Repository for JDK 1.4 builds</name><url>http://www.myhost.com/maven/jdk14</url><layout>default</layout><snapshotPolicy>always</snapshotPolicy></repository></repositories></profile>
    -->
		<!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile><id>env-dev</id><activation><property><name>target-env</name><value>dev</value></property></activation><properties><tomcatPath>/path/to/tomcat/instance</tomcatPath></properties></profile>
    -->
		<profile>
			<id>huaweicloud</id>
			<repositories>
				<repository>
					<id>huawei</id>
					<url>https://repo.huaweicloud.com/repository/maven/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>nexus-aliyun</id>
			<repositories>
				<repository>
					<id>aliyun</id>
					<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>alimaven</id>
			<repositories>
				<repository>
					<id>ali</id>
					<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>nexus-hortonworks</id>
			<repositories>
				<repository>
					<id>hortonworks</id>
					<url>https://repo.hortonworks.com/content/groups/public/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>HDPReleases</id>
			<repositories>
				<repository>
					<id>HDP</id>
					<url>https://repo.hortonworks.com/content/repositories/releases/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>WSO2Releases</id>
			<repositories>
				<repository>
					<id>WSO2</id>
					<url>http://dist.wso2.org/maven2/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
		<profile>
			<id>MavenCentralReleases</id>
			<repositories>
				<repository>
					<id>MavenCentral</id>
					<url>https://repo1.maven.org/maven2/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
		</profile>
	</profiles>
	<activeProfiles>
		<activeProfile>huaweicloud</activeProfile>
		<activeProfile>nexus-aliyun</activeProfile>
		<activeProfile>alimaven</activeProfile>
		<activeProfile>nexus-hortonworks</activeProfile>
		<activeProfile>HDPReleases</activeProfile>
		<activeProfile>WSO2Releases</activeProfile>
		<activeProfile>MavenCentralReleases</activeProfile>
	</activeProfiles>
	<!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles><activeProfile>alwaysActiveProfile</activeProfile><activeProfile>anotherAlwaysActiveProfile</activeProfile></activeProfiles>
  -->
</settings>

1.4 HDP 3.0 および 3.1 ファイルをソース コードにコピーする

HDP3.0/HDP3.1 は次のように接続を取得します。
HDP3.0/HDP3.1 を apache-ambari-2.7.7-src/ambari-server/src/main/resources/stacks/HDP ディレクトリにコピーします。
ここに画像の説明を挿入

1.5 コンパイルの高速化

1.5.1 bower_components をダウンロードする

ambari をコンパイルするときは、apache-ambari-2.7.7-src/ambari-admin/src/main/resources/ui/admin-web/app/ ディレクトリに移動して bower_components コンテンツをダウンロードする必要があります。ネットワーク上の理由により、ダウンロードしてディレクトリに配置し、再コンパイルできます。
ここに画像の説明を挿入
注: この操作を行わないと、4.1 のエラーが報告される可能性があります。

1.5.2 メトリクスのコンパイルに必要な依存関係のダウンロード

ambari-metrics/pom.xml ファイルを変更して、habse、hadoop、phoenix、grafana のダウンロード パスを置き換えます。

<hbase.tar>http://192.168.5.78/compile-ambari/hbase-2.4.2-bin.tar.gz</hbase.tar><hadoop.tar>http://192.168.5.78/compile-ambari/hadoop-3.1.1.tar.gz</hadoop.tar>
<grafana.tar>http://192.168.5.78/compile-ambari/grafana-6.7.4.linux-amd64.tar.gz</grafana.tar>
<phoenix.tar>http://192.168.5.78/compile-ambari/phoenix-hbase-2.4-5.1.2-bin.tar.gz</phoenix.tar>

注: ① ここの 192.168.5.78 は httpd 機能で設定されており、このダウンロード方法で必要な依存パッケージをダウンロードできます。 ② 何も
ここに画像の説明を挿入
変更しないと、コンパイル中に 4.2 に示すエラーが報告されます
。 ③ httpd が構成されていない場合は、ローカル パスとして構成することもできます。例えば:

    <hbase.tar>file:///opt/compile-ambari/hbase-2.4.2-bin.tar.gz</hbase.tar>
    <hbase.folder>hbase-2.4.2</hbase.folder>
    <hadoop.tar>file:///opt/compile-ambari/hadoop-3.1.1.tar.gz</hadoop.tar>
    <hadoop.folder>hadoop-3.1.1</hadoop.folder>
    <grafana.folder>grafana-6.7.4</grafana.folder>
    <grafana.tar>file:///opt/compile-ambari/grafana-6.7.4.linux-amd64.tar.gz</grafana.tar>
    <phoenix.tar>file:///opt/compile-ambari/phoenix-hbase-2.4-5.1.2-bin.tar.gz</phoenix.tar>
    <phoenix.folder>phoenix-hbase-2.4-5.1.2</phoenix.folder>

1.5.3 ambari-infra/ambari-infra-assembly/pom ファイルを変更する

<solr.tar>http://archive.apache.org/dist/lucene/solr/${solr.version}/solr-${solr.version}.tgz</solr.tar>
改为:
<solr.tar>http://192.168.5.78/compile-ambari/solr-${solr.version}.tgz</solr.tar>

注: httpd サービスがインストールされているノードがない場合は、上記のようにローカル パスに設定することもできます。

1.5.4 ambari-infra/ambari-infra-solr-client/pom ファイルを変更する

<lucene6-core.url>https://repo1.maven.org/maven2/org/apache/lucene/lucene-core/${lucene6.version}/${lucene6-core-jar.name}</lucene6-core.url>
<lucene6-backward-codecs.url>https://repo1.maven.org/maven2/org/apache/lucene/lucene-backward-codecs/${lucene6.version}/${lucene6-backward-codecs-jar.name}</lucene6-backward-codecs.url>
改为:
<lucene6-core.url>http://192.168.5.78/compile-ambari/${lucene6-core-jar.name}</lucene6-core.url>
<lucene6-backward-codecs.url>http://192.168.5.78/compile-ambari/${lucene6-backward-codecs-jar.name}</lucene6-backward-codecs.url>

注: httpd サービスがインストールされているノードがない場合は、上記のようにローカル パスに設定することもできます。

1.5.6 Maven リポジトリの依存関係を置き換える

ネットワークが悪い場合は、私が提供する Maven ウェアハウスを直接使用し、依存ライブラリをローカル環境の Maven ウェアハウスに直接解凍してコンパイルすることができます。
ここに画像の説明を挿入

1.5.7 すべての実行権限を付与する

コンパイル プロセス中に実行可能権限によってエラーが発生しないようにするために、コンパイル前にすべての ambari コンパイル ディレクトリ ファイルに実行可能権限を与えることができます。

chmod -R 777 apache-ambari-2.7.7/

注: 上記の操作を実行しない場合、コンパイル中に次のエラーが報告される可能性があります。

[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)

ここに画像の説明を挿入

2 コンパイル

① ambari をコンパイルするときに、カスタム バージョン番号の要件がある場合は、最初に ambari ソース コードに独自に定義したバージョン番号をマークできます。バージョン番号を入力すると、実際には、サブモジュールを含む mvn コマンドを通じて pom.xml ファイル内のバージョン値が自動的に変更されます。
②mvn コマンドで ambari の各モジュールのソースコードをコンパイルし、最終的に hortonworks が公式に提供する ambari 関連の rpm パッケージと同様の、それぞれの rpm パッケージを取得します。

2.1 バージョン番号を入力する

ambari ソース コードにバージョン番号を付けます。バージョン番号はカスタマイズできます。

mvn versions:set -DnewVersion=2.7.7.0.1

ここに画像の説明を挿入

2.2 ambari-metrics モジュール

pushd ambari-metrics

ここに画像の説明を挿入

# 打版本号
mvn versions:set -DnewVersion=2.7.7.0.1

ここに画像の説明を挿入

2.3 ambari-logsearch モジュール

# 返回到ambari根目录
popd
pushd ambari-logsearch
# 打版本号
mvn versions:set -DnewVersion=2.7.7.0.1

ここに画像の説明を挿入

2.4 ambari インフラモジュール

# 返回到ambari根目录
popd
pushd ambari-infra
# 打版本号
mvn versions:set -DnewVersion=2.7.7.0.1

ここに画像の説明を挿入

2.5 すべてのモジュールのコンパイルを開始する

# 返回到ambari根目录
popd
mvn -B -X install rpm:rpm -DnewVersion=2.7.7.0.1 -DbuildNumber=5895e4ed6b30a2da8a90fee2403b6cab91d19972 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true

上記のコマンドをすべてコピーすることをお勧めします。buildNumber は必須です。そうしないと、rpm パッケージのインストール時に buildNumber エラーが報告されます。-Drat.skip=true を指定すると、ライセンスの検証がスキップされます。

正常にコンパイルされました
ここに画像の説明を挿入

3 コンパイル手順

ambari のソースコードは複数のモジュールに分かれており、モジュールのコンパイルに失敗した場合に、そのモジュールからコンパイルを続けたいのですが、どうすればよいでしょうか?
たとえば、ambari-web モジュールがコンパイル時にエラーが発生した場合は、コンパイル コマンドの最後に -rf :ambari-web を追加するだけです。エラーが報告されたときに表示されるモジュール名は、mvn 出力の最後の行に表示されます。

4 コンパイルプロセス中にエラーが報告される

4.1 管理者ビューのエラー報告

具体的なエラー内容

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:yarn (yarn install) on project ambari-admin: Failed to run task: 'yarn install --ignore-engines --pure-lockfile' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:yarn (yarn install) on project ambari-admin: Failed to run task
bower angular-bootstrap#0.11.0                       ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/angular-ui/bootstrap-bower.git", exit code of #128 fatal: unable to access 'https://github.com/angular-ui/bootstrap-bower.git/': Empty reply from server

ここに画像の説明を挿入
これは、ambari をコンパイルするときに、ambari が apache-ambari-2.7.7-src/ambari-admin/src/main/resources/ui/admin-web ディレクトリに移動して bower_components コンテンツをダウンロードする必要があるためです。ネットワークが原因でダウンロードできません。自分でダウンロードしてディレクトリに配置し、再コンパイルすることができます。

4.2 Ambari メトリクス コレクターがエラーを報告する

ここに画像の説明を挿入
解決策:
方法①では
、ambari プロジェクトの pom.xml ファイル内のメトリック モジュールを削除し、再コンパイルする必要があります。
ここに画像の説明を挿入
方法②
では、メトリクスのコンパイルに必要な依存関係パッケージを手動でダウンロードし、メトリクスの pom.xml ファイルを変更します。具体的な変更方法については、1.5.2を参照してください。

4.3 phoenix-core パッケージの欠落

Maven ウェアハウスにアクセスしてjar パッケージをダウンロードし、ダウンロードした jar パッケージを Maven に置きます
ここに画像の説明を挿入

4.4 rpm-build がインストールされていません

[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (default-cli) on project ambari: Unable to build the RPM: Error while executing process. Cannot run program "rpmbuild" (in directory "/root/ambari/apache-ambari-2.7.7-src/target/rpm/ambari/SPECS"): error=2, No such file or directory -> [Help 1]

ここに画像の説明を挿入
解決策: rpm-build をインストールする

yum install -y rpm-build

4.5糸誤差

Could not extract the Yarn archive: Could not extract archive

ここに画像の説明を挿入
解決策:
① https://github.com/yarnpkg/yarn/releases/download/v0.23.2/yarn-v0.23.2.tar.gz を手動でダウンロードします
。 ② ダウンロードが完了したら、手動で com/github/eirslett に配置します。 Maven ウェアハウス /yarn/0.23.2/yarn-0.23.2./ ディレクトリ内

4.6 糸のインストール エラー

[ERROR] 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. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:yarn (yarn install) on project ambari-web: Failed to run task

ここに画像の説明を挿入
解決策: この問題は主に、nodejs が糸を通じて依存関係パッケージをロードするために発生する可能性が高く、解決策は良好なネットワーク環境を確保することです。ネットワーク環境に問題がないことを確認後、コンパイルエラーディレクトリにある*.lockファイルを削除(個人的に対象ディレクトリも一緒に削除)し、再コンパイルしてください。

# find ~/.m2/repository/ -name "*.lastUpdated" -exec rm -rf {} \;

4.7 ambari-admin がエラーを報告する

[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.

ここに画像の説明を挿入
解決策: cd ambari-admin/src/main/resources/ui/admin-web ディレクトリで .bowerrc を編集します。変更された内容は次のとおりです。

{
    
    
    "directory": "app/bower_components",
    "allow_root": true
}

4.8 糸がエラーを報告する

 Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.1.0/yarn-v1.1.0.tar.gz: Connect to objects.githubusercontent.com:443 [objects.githubusercontent.com/127.0.0.1, objects.githubusercontent.com/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused) -> [Help 1]

Githubのポート443にアクセスできません

# 下载
https://github.com/yarnpkg/yarn/releases/download/v1.1.0/yarn-v1.1.0.tar.gz
# 放入maven仓库
repository/com/github/eirslett/yarn/1.1.0/yarn-1.1.0.tar.gz

5 コンピレーションパッケージの手配

Ambari view、ambari-metrics、ambari-logsearch、ambari-solr はすべて正常にコンパイルされています。すべての Ambari ソース コードがコンパイルされたら、Ambari の各モジュールのコンパイル済みパッケージをコンパイルする必要があります。centos7 を例として、コンパイルされた rpm パッケージを要約する必要があります。

5.1 rpm パッケージのマージ

新しいディレクトリ

mkdir ambari-2.7.7

すべての rpm パッケージを要約し、yum ソースを生成する

cp -r ./ambari-server/target/rpm/ambari-server/RPMS/x86_64/ambari-server-2.7.7.0-1.x86_64.rpm ../ambari-2.7.7/
cp -r ./ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/ambari-agent-2.7.7.0-1.x86_64.rpm  ../ambari-2.7.7/

cp -r ./ambari-infra/ambari-infra-assembly/target/rpm/ambari-infra-solr/RPMS/noarch/ambari-infra-solr-2.7.7.0-1.noarch.rpm  ../ambari-2.7.7/
cp -r ./ambari-infra/ambari-infra-assembly/target/rpm/ambari-infra-solr-client/RPMS/noarch/ambari-infra-solr-client-2.7.7.0-1.noarch.rpm ../ambari-2.7.7/
cp -r ./ambari-infra/ambari-infra-assembly/target/rpm/ambari-infra-manager/RPMS/noarch/ambari-infra-manager-2.7.7.0-1.noarch.rpm ../ambari-2.7.7/
cp -r ./ambari-logsearch/ambari-logsearch-assembly/target/rpm/ambari-logsearch-portal/RPMS/noarch/ambari-logsearch-portal-2.7.7.0-1.noarch.rpm ../ambari-2.7.7/
cp -r ./ambari-logsearch/ambari-logsearch-assembly/target/rpm/ambari-logsearch-logfeeder/RPMS/noarch/ambari-logsearch-logfeeder-2.7.7.0-1.noarch.rpm ../ambari-2.7.7/

cp -r ./ambari-metrics/ambari-metrics-assembly/target/rpm/ambari-metrics-collector/RPMS/x86_64/
cp -r ./ambari-metrics/ambari-metrics-assembly/target/rpm/ambari-metrics-hadoop-sink/RPMS/x86_64/
cp -r ./ambari-metrics/ambari-metrics-assembly/target/rpm/ambari-metrics-grafana/RPMS/x86_64/
cp -r ./ambari-metrics/ambari-metrics-assembly/target/rpm/ambari-metrics-monitor/RPMS/x86_64/
cp -r ./ambari-metrics/ambari-metrics-common/target/rpm/ambari-metrics-common/RPMS/noarch/

yumソースを作成する

createrepo ./

実行が完了すると、repodata フォルダーが生成されます。

注: レポートにそのようなコマンドがない場合は、createrepo をインストールするだけです。

5.2 ambari インストール ファイルを圧縮する

tar -zcvf ambari-2.7.7.tar.gz ambari-2.7.7/

圧縮が完了したら、
ここに画像の説明を挿入
コンパイルに従って生成された ambari-2.7.7.ta​​r.gz パッケージを使用して、amabri クラスターをインストールおよびデプロイできます。

おすすめ

転載: blog.csdn.net/Keyuchen_01/article/details/130018884