System: CentOS Release 6.6 (Final)
Nexus:nexus-2.8.1-bundle.tar.gz,:https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.8.1-bundle.tar.gz
Java:java Version "1.7.0_80"
Create directory and enter directory: Mkdir/usr/local/nexus
Extract files: tar-zxvf nexus-2.8.1-bundle.tar.gz, after decompression will appear two directories: Nexus-2.8.1-01,sonatype-work
Enter nexus-2.8.1-01 and start Nexus:bin/nexus start.
Show startup information:
Starting Nexus OSS ...
Started Nexus OSS ...
Add a Nexus 8081 working port to the firewall.
Added in/etc/sysconfig/iptables's ipput chain:-A input-p tcp-m tcp--dport 8081-j ACCEPT
Restart Firewall service iptables restart
Open the Nexus in the browser management interface: Http://ip:8081/nexus login admin/admin123, login can change the password on their own
Click Repositories on the left to view the existing repository.
Select Central, then click on "Configuration" below to change "Download remote Indexes" to true so that you can view the index of the remote MAVEN library
Central Repository is used to compile Apache Hadoop, but I want to compile Cloudera Hadoop, then I need another 3 Cloudera Repository, respectively Cloudera releases Repository,cloudera snapshots Repository and Cloudera repositories.
Management interface in Nexus: Http://ip:8081/nexus repository Repository, respectively, for the configuration information of the 3 repository.
Follow the diagram to configure it.
The mirror information is then set in the Setting.xml file in the Conf directory in the $maven_home directory in CentOS, as follows:
1 <Mirror>2 <ID>Central</ID>3 <mirrorof>Central</mirrorof>4 <name>Central Mirror.</name>5 <URL>http://client:8081/nexus/content/repositories/central/</URL>6 </Mirror>7 <Mirror>8 <ID>Cdh</ID>9 <mirrorof>Cdh.repo</mirrorof>Ten <name>CDH Mirror.</name> One <URL>http://client:8081/nexus/content/repositories/cdh.repo/</URL> A </Mirror> - <Mirror> - <ID>Cdh.snapshot</ID> the <mirrorof>Cdh.snapshots.repo</mirrorof> - <name>CDH Snapshot Mirror.</name> - <URL>http://client:8081/nexus/content/repositories/cdh.snapshots.repo/</URL> - </Mirror> + <Mirror> - <ID>Cdh.release</ID> + <mirrorof>Cdh.releases.repo</mirrorof> A <name>CDH release Mirror.</name> at <URL>http://client:8081/nexus/content/repositories/cdh.releases.repo/</URL> - </Mirror> - <Mirror> - <ID>Cdh.third-party</ID> - <mirrorof>Third-party</mirrorof> - <name>CDH Third-party Mirror.</name> in <URL>http://client:8081/nexus/content/repositories/third-party/</URL> - </Mirror>
Then the jar packages needed to compile the Hadoop CDH source will be downloaded on the MAVEN, if not, then the MAVEN goes back to the remote repository to download and cache, This will require the same jar package to be downloaded from the remote repository and save time and speed.
Use Nexus to build a maven in CentOS to provide local mirroring for Hadoop compilation