[Hadoop] Hadoop源码编译时“Remote host closed connection during handshake: SSL peer shut down” 错误解决

Hadoop源码编译时经常碰到下面这种错误,“Remote host closed connection during handshake: SSL peer shut down incorrectly”,原因是网络问题,下载jar包的时候与远程仓库断开了连接。

[hadoop@cassandra01 hadoop-2.6.0-cdh5.7.0]$ mvn clean package -Pdist,native -DskipTests -Dtar
...
...
Downloading: https://repository.cloudera.com/content/repositories/snapshots/org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.pom
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.pom
Downloading: https://repository.cloudera.com/content/repositories/cdh-releases-rcs/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom
Downloading: https://repository.cloudera.com/content/repositories/snapshots/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Hadoop Main ................................. FAILURE [ 12.084 s]
[INFO] Apache Hadoop Project POM .......................... SKIPPED
[INFO] Apache Hadoop Annotations .......................... SKIPPED
[INFO] Apache Hadoop Assemblies ........................... SKIPPED
[INFO] Apache Hadoop Project Dist POM ..................... SKIPPED
[INFO] Apache Hadoop Maven Plugins ........................ SKIPPED
[INFO] Apache Hadoop MiniKDC .............................. SKIPPED
[INFO] Apache Hadoop Auth ................................. SKIPPED
[INFO] Apache Hadoop Auth Examples ........................ SKIPPED
[INFO] Apache Hadoop Common ............................... SKIPPED
[INFO] Apache Hadoop NFS .................................. SKIPPED
[INFO] Apache Hadoop KMS .................................. SKIPPED
[INFO] Apache Hadoop Common Project ....................... SKIPPED
[INFO] Apache Hadoop HDFS ................................. SKIPPED
[INFO] Apache Hadoop HttpFS ............................... SKIPPED
[INFO] Apache Hadoop HDFS BookKeeper Journal .............. SKIPPED
[INFO] Apache Hadoop HDFS-NFS ............................. SKIPPED
[INFO] Apache Hadoop HDFS Project ......................... SKIPPED
[INFO] hadoop-yarn ........................................ SKIPPED
[INFO] hadoop-yarn-api .................................... SKIPPED
[INFO] hadoop-yarn-common ................................. SKIPPED
[INFO] hadoop-yarn-server ................................. SKIPPED
[INFO] hadoop-yarn-server-common .......................... SKIPPED
[INFO] hadoop-yarn-server-nodemanager ..................... SKIPPED
[INFO] hadoop-yarn-server-web-proxy ....................... SKIPPED
[INFO] hadoop-yarn-server-applicationhistoryservice ....... SKIPPED
[INFO] hadoop-yarn-server-resourcemanager ................. SKIPPED
[INFO] hadoop-yarn-server-tests ........................... SKIPPED
[INFO] hadoop-yarn-client ................................. SKIPPED
[INFO] hadoop-yarn-applications ........................... SKIPPED
[INFO] hadoop-yarn-applications-distributedshell .......... SKIPPED
[INFO] hadoop-yarn-applications-unmanaged-am-launcher ..... SKIPPED
[INFO] hadoop-yarn-site ................................... SKIPPED
[INFO] hadoop-yarn-registry ............................... SKIPPED
[INFO] hadoop-yarn-project ................................ SKIPPED
[INFO] hadoop-mapreduce-client ............................ SKIPPED
[INFO] hadoop-mapreduce-client-core ....................... SKIPPED
[INFO] hadoop-mapreduce-client-common ..................... SKIPPED
[INFO] hadoop-mapreduce-client-shuffle .................... SKIPPED
[INFO] hadoop-mapreduce-client-app ........................ SKIPPED
[INFO] hadoop-mapreduce-client-hs ......................... SKIPPED
[INFO] hadoop-mapreduce-client-jobclient .................. SKIPPED
[INFO] hadoop-mapreduce-client-hs-plugins ................. SKIPPED
[INFO] hadoop-mapreduce-client-nativetask ................. SKIPPED
[INFO] Apache Hadoop MapReduce Examples ................... SKIPPED
[INFO] hadoop-mapreduce ................................... SKIPPED
[INFO] Apache Hadoop MapReduce Streaming .................. SKIPPED
[INFO] Apache Hadoop Distributed Copy ..................... SKIPPED
[INFO] Apache Hadoop Archives ............................. SKIPPED
[INFO] Apache Hadoop Archive Logs ......................... SKIPPED
[INFO] Apache Hadoop Rumen ................................ SKIPPED
[INFO] Apache Hadoop Gridmix .............................. SKIPPED
[INFO] Apache Hadoop Data Join ............................ SKIPPED
[INFO] Apache Hadoop Ant Tasks ............................ SKIPPED
[INFO] Apache Hadoop Extras ............................... SKIPPED
[INFO] Apache Hadoop Pipes ................................ SKIPPED
[INFO] Apache Hadoop OpenStack support .................... SKIPPED
[INFO] Apache Hadoop Amazon Web Services support .......... SKIPPED
[INFO] Apache Hadoop Azure support ........................ SKIPPED
[INFO] Apache Hadoop Client ............................... SKIPPED
[INFO] Apache Hadoop Mini-Cluster ......................... SKIPPED
[INFO] Apache Hadoop Scheduler Load Simulator ............. SKIPPED
[INFO] Apache Hadoop Tools Dist ........................... SKIPPED
[INFO] Apache Hadoop Tools ................................ SKIPPED
[INFO] Apache Hadoop Distribution ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.223 s
[INFO] Finished at: 2018-08-16T15:11:48+08:00
[INFO] Final Memory: 77M/858M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process (default) on project hadoop-main: Execution default of goal org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process failed: Plugin org.apache.maven.plugins:maven-remote-resources-plugin:1.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-remote-resources-plugin:jar:1.0 -> org.apache.maven:maven-project:jar:2.0.5: Failed to read artifact descriptor for org.apache.maven:maven-project:jar:2.0.5: Could not transfer artifact org.apache.maven:maven-project:pom:2.0.5 from/to cdh.releases.repo (https://repository.cloudera.com/content/repositories/cdh-releases-rcs): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[hadoop@cassandra01 hadoop-2.6.0-cdh5.7.0]$ 

解决方法一:多试几次,或者过一段时间再尝试,反复几次可以编译成功。

解决方法二:查看上面日志,找到报错之前最后一个download的依赖包名。进入本地仓库对应的路径,把那个依赖包下下来,然后继续编译。

# 查看报错前最后一个要下载的依赖包
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom


# cd到本地仓库该包名对应的路径
[hadoop@cassandra01 1.0.5]$ cd ~/maven_repo/velocity/velocity/1.4/

# wget把上面的包下载下来,下载路径即为上面报错的链接地址
[hadoop@cassandra01 1.4]$ wget https://repo.maven.apache.org/maven2/velocity/velocity/1.4/velocity-1.4.pom

# 回到编译的窗口,再次编译

这样反复几次,把卡住的包都下载下来,就可以编译成功。

你可能感兴趣的:(Hadoop,hadoop,maven)