Ambari 2.7.3版本编译报错各问题解决

时间:2024-05-19 08:27:19

执行编译命令:# mvn -B clean install rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X

1、报错:

[DEBUG] Configuring mojo org.apache.rat:apache-rat-plugin:0.12:check from plugin realm ClassRealm[plugin>org.apache.rat:apache-rat-plugin:0.12, parent: [email protected]]
[WARNING] Error injecting: org.apache.rat.mp.RatCheckMojo
java.lang.NoClassDefFoundError: org/apache/rat/report/IReportable
    at java.lang.Class.getDeclaredConstructors0 (Native Method)
    at java.lang.Class.privateGetDeclaredConstructors (Class.java:2671)
    at java.lang.Class.getDeclaredConstructors (Class.java:2020)
    at com.google.inject.spi.InjectionPoint.forConstructorOf (InjectionPoint.java:245)
    at com.google.inject.internal.ConstructorBindingImpl.create (ConstructorBindingImpl.java:115)
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding (InjectorImpl.java:706)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:930)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:852)
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:291)
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:222)
    at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1040)
    at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1071)
    at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1034)
    at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)

Ambari 2.7.3版本编译报错各问题解决

解决:ambari maven打包多添加几个数据源,否则会导致缺失某些jar包下载不了,先删除maven刚下载失败的目录:

# rm -rf /root/.m2/repository/org/apache/rat

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

vim /usr/local/apache-maven-3.6.0/conf/settings.xml,新增内容如下:

Ambari 2.7.3版本编译报错各问题解决

再执行命令:# mvn -B clean install rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X

2、报错:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:install-node-and-yarn (install node and yarn) on project ambari-web: Could not extract the Yarn archive: Could not extract archive: '/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz': EOFException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:install-node-and-yarn (install node and yarn) on project ambari-web: Could not extract the Yarn archive: Could not extract archive: '/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz'
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)
Ambari 2.7.3版本编译报错各问题解决

解决:下载不完全,无法解压,手动下载https://github.com/yarnpkg/yarn/releases/download/v0.23.2/yarn-v0.23.2.tar.gz

替换/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz

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

重新从ambari-web开始编译:

# mvn -B clean install package rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true --rf :ambari-web

3、报错:

[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
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)
Ambari 2.7.3版本编译报错各问题解决

解决:删除编译报错目录下的*.lock文件(个人将target目录一起删除),重新编译

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

# mvn -B clean install package rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true --rf :ambari-web

4、报错:一直卡着如下

[INFO] 
[INFO] PhantomJS not found on PATH
[INFO] Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1//phantomjs-2.1.1-linux-x86_64.tar.bz2
[INFO] Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
[INFO] Receiving...
Ambari 2.7.3版本编译报错各问题解决

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

重新运行编译命令

5、报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ambari-metrics-grafana: An Ant BuildException has occured: Error while expanding /data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana/grafana.tgz
[ERROR] java.io.EOFException: Unexpected end of ZLIB input stream
[ERROR] around Ant part ...<untar src="/data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana/grafana.tgz" dest="/data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana" compression="gzip"/>... @ 6:269 in /data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/antrun/build-Download Ambari Grafana.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ambari-metrics-grafana: An Ant BuildException has occured: Error while expanding /data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana/grafana.tgz
java.io.EOFException: Unexpected end of ZLIB input stream
around Ant part ...<untar src="/data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana/grafana.tgz" dest="/data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/grafana" compression="gzip"/>... @ 6:269 in /data5/139.bd/home/samba/node/apache-ambari-2.7.3-src/ambari-metrics/ambari-metrics-grafana/target/antrun/build-Download Ambari Grafana.xml
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)

Ambari 2.7.3版本编译报错各问题解决

解决:打开ambar-metrics/pom.xml文件,手动下载如下文件,并配置本地仓库(

# yum install createrepo

# createrepo 目录)下载,提高编译效率

Ambari 2.7.3版本编译报错各问题解决

修改后:

Ambari 2.7.3版本编译报错各问题解决

重新编译ambari-metrics-grafana

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

# mvn -B install package rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X -rf :ambari-metrics-grafana

6、报错:

[ERROR] Failed to execute goal on project ambari-metrics-assembly: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-assembly:pom:2.7.3.0.0: Failed to collect dependencies at org.apache.ambari:ambari-metrics-timelineservice:jar:2.7.3.0.0 -> org.apache.phoenix:phoenix-core:jar:5.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-mapreduce:jar:2.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-server:jar:2.0.0.3.0.0.0-1634 -> org.glassfish.web:javax.servlet.jsp:jar:2.3.2 -> org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT: Failed to read artifact descriptor for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT: Could not transfer artifact org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT from/to jvnet-nexus-snapshots (https://maven.java.net/content/repositories/snapshots): maven.java.net: 未知的名称或服务: Unknown host maven.java.net: 未知的名称或服务 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project ambari-metrics-assembly: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-assembly:pom:2.7.3.0.0: Failed to collect dependencies at org.apache.ambari:ambari-metrics-timelineservice:jar:2.7.3.0.0 -> org.apache.phoenix:phoenix-core:jar:5.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-mapreduce:jar:2.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-server:jar:2.0.0.3.0.0.0-1634 -> org.glassfish.web:javax.servlet.jsp:jar:2.3.2 -> org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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.project.DependencyResolutionException: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-assembly:pom:2.7.3.0.0: Failed to collect dependencies at org.apache.ambari:ambari-metrics-timelineservice:jar:2.7.3.0.0 -> org.apache.phoenix:phoenix-core:jar:5.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-mapreduce:jar:2.0.0.3.0.0.0-1634 -> org.apache.hbase:hbase-server:jar:2.0.0.3.0.0.0-1634 -> org.glassfish.web:javax.servlet.jsp:jar:2.3.2 -> org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT
Ambari 2.7.3版本编译报错各问题解决

解决:接着重编

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

# mvn -B install package rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true --rf :ambari-metrics-assembly

7、报错:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) on project ambari-logsearch-web: Could not extract the Yarn archive: Could not extract archive: '/root/.m2/repository/com/github/eirslett/yarn/1.1.0/yarn-1.1.0.tar.gz': EOFException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) on project ambari-logsearch-web: Could not extract the Yarn archive: Could not extract archive: '/root/.m2/repository/com/github/eirslett/yarn/1.1.0/yarn-1.1.0.tar.gz'
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)
Ambari 2.7.3版本编译报错各问题解决

解决:下载不完全,无法解压,手动下载https://github.com/yarnpkg/yarn/releases/download/v1.1.0/yarn-v1.1.0.tar.gz

重命名为yarn-1.1.0.tar.gz,替换/root/.m2/repository/com/github/eirslett/yarn/1.1.0/yarn-1.1.0.tar.gz

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

重新编译:

# mvn -B install package rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true --rf :ambari-logsearch-web

8、报错:一直卡着如下

[ERROR] warning [email protected]: No license field
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[ERROR] warning [email protected]: The platform "linux" is incompatible with this module.
[INFO] info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[ERROR] warning [email protected]: The platform "linux" is incompatible with this module.
[INFO] info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[INFO] [4/4] Building fresh packages...
解决(在此处编译需耐心等待一阵,才继续往下执行):

# npm install [email protected] -g

# pm2 install pm2-slack

9、报错

Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.0.1:rpm (default-cli) on project ambari: RPM build execution returned: '127' executing '/bin/sh -c cd /home/compile/ambari/ambari-release-2.7.3/target/rpm/ambari/SPECS && rpmbuild -bb --buildroot /home/compile/ambari/ambari-release-2.7.3/target/rpm/ambari/buildroot --define '_topdir /home/compile/ambari/ambari-release-2.7.3/target/rpm/ambari' --target noarch-redhat-linux ambari.spec' -> [Help 1]

解决:

# yum remove  epel-release

# yum install rpm

# yum install rpm-build

10、报错

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project ambari-admin: Failed to run task: 'nped. (error code 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) ed to run task
解决(接着重编):

解决过程:查看ambari-admin/src/main/resources/ui/admin-web/npm-debug.log  发现下载的对应链接无法访问,上网查了下是被墙了,可以在国内镜像地址 http://npm.taobao.org/dist/phantomjs/下载phantomjs-1.9.8-linux-x86_64.tar.bz2。下载后拷贝到对应路径下。

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

# mvn -B clean install rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X -rf :ambari-admin

11、报错

[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
}
个人将ambari-admin(包括子目录ambari-admin/src/main/resources/ui/admin-web)里面生成的node、node_modules删除,保持干净的源码环境,再单独编译ambari-admin

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

# mvn -B clean install rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X -rf :ambari-admin

12、报错

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project ambari-admin: Failed to run task: 'npm install --unsafe-perm' failed. (error code 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project ambari-admin: Failed to run task

如果npm是在root账户下执行的话,它会将uid改成当前账户,或者uid的值从user配置文件中获取,而默认情况下uid的值为nobody。所以在root账户下运行npm install时需要将unsafe-perm选项加上。

解决(接着重编):

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

# mvn -B clean install rpm:rpm -DnewVersion=2.7.3.0.0 -DskipTests -Dpython.ver="python >= 2.6" -Drat.skip=true -X -rf :ambari-admin

13、安装配置报错

ambari-server/sbin/ambari-server中#注释掉set -u # fail on unset variables

14、

ambari卡在设置集群名称的下一步

详情见下图:设置好集群名称,卡在了 NEXT这一步,换句话说,就是select version那个页面不能被我们访问到。

Ambari 2.7.3版本编译报错各问题解决

分析:

进入 selectversion页面是访问的 HDP-3.0,但是发现 /var/lib/ambari-server/resources/stacks/HDP/没有3.0这个目录,所以 selectversion页面打不开。

解决办法:

链接: https://pan.baidu.com/s/1-v1KoMxduK_8FzSgl2TIAw 提取码: y49a

下载文件并解压至 /var/lib/ambari-server/resources/stacks/HDP/

Ambari 2.7.3版本编译报错各问题解决

可将 3.0文件添加到源码处: ./ambari-server/src/main/resources/stacks/HDP,再进行编译,可以一劳永逸。

15、报错

[ERROR] Failed to execute goal on project ambari-metrics-storm-sink-legacy: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-storm-sink-legacy:jar:2.7.3.0.0: Failed to collect dependencies at org.apache.storm:storm-core:jar:0.10.0.2.3.0.0-2557: 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: 连接超时 (Connection timed out) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project ambari-metrics-storm-sink-legacy: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-storm-sink-legacy:jar:2.7.3.0.0: Failed to collect dependencies at org.apache.storm:storm-core:jar:0.10.0.2.3.0.0-2557

解决办法:

ping nexus-private.hortonworks.com,发现这个私有仓库地址访问不上去。

Ambari配置的仓库为nexus-private.hortonworks.com,但该地址无法访问。

解决方案:个人是进入目录ambari-metrics,编辑pom.xml替换如下(如果编译还报错,不行就替换为阿里源http://maven.aliyun.com/nexus/content/groups/public

Ambari 2.7.3版本编译报错各问题解决

执行:mvn install package -Dbuild-rpm -DskipTests单独编译模块的)

Ambari 2.7.3版本编译报错各问题解决

16、如果某个地方卡住,~/.m2/仓库下除了删除*.lastUpdated,也要删除掉相关*.lock,然后再重新编译

个人单独编译模块:ambari-metrics、ambari-logsearch、ambari-infra

cd ambari-metrics
mvn package -Dbuild-rpm -DskipTests

cd ambari-logsearch
mvn versions:set -DnewVersion=2.7.3.0.0
mvn package -Dbuild-rpm -DskipTests

cd ambari-infra
mvn versions:set -DnewVersion=2.7.3.0.0
mvn package -Dbuild-rpm -DskipTests

总体编译结果:

Ambari 2.7.3版本编译报错各问题解决