企业内部的hadoop平台一般是不可能连接外部网络。所以需要搭建一个本地的yum repository。下面是简单的配置流程,不足之处欢迎拍砖。
1. 配置hdp的源
wget -nv http://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.1-latest/hdp.repo -O /etc/yum.repos.d/hdp.repo
配置ambari源:
wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.6.0/ambari.repo -O /etc/yum.repos.d/hdp.repo
下面是几个常用的链接:
Install Ambari 1.6.0 from Public Repositories
2. Configure the Remote Repositories
Hortonworks repository index
Hortonworks gpgkey
2. 使用reposync同步远程的yum repository
1 2 3 4 |
[root@server] reposync -r Updates-ambari-* [root@server] reposync -r HDP-UTILS-1.1.0.17 [root@server] reposync -r ambari-1.x [root@server] reposync -r HDP-2.1.2.0 |
createrepo是linux下的创建仓库的工具。create是创建的意思,repo是repository的缩写,是仓库的意思。
yum(Yellowdog Updater,Modified)主要的功能是方便添加、删除和更新rpm软件包。可以解决软件包依存问题,更便于管理大量的系统更新问题。由于我这个目录下还包含了CentOS 6.5的光盘,所以已经包含了repo的数据库。下面使用–update来更新repo数据库。
1 2 3 4 5 6 7 8 9 |
[root@server]createrepo --update . Spawning worker 0 with 127 pkgs Workers Finished Gathering worker results Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs |
可以看到HDP的包有大约1.4GB。
1 2 3 4 5 6 7 |
[root@server]du -sk * 38748 ambari-1.x 1408540 HDP-2.1.2.0 21784 HDP-UTILS-1.1.0.17 4092068 Packages 19360 repodata 46740 Updates-ambari |
客户端配置下面的yum repo后,就可以使用yum install来安装。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
[root@server]salt \salt_* cmd.run 'cat /etc/yum.repos.d/local.repo' salt_m1: [basic] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=ftp://172.19.17.1/pub/iso6 enabled=1 gpgcheck=0 salt_m4: [basic] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=ftp://172.19.17.1/pub/iso6 enabled=1 gpgcheck=0 salt_m2: [basic] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=ftp://172.19.17.1/pub/iso6 enabled=1 gpgcheck=0 salt_m3: [basic] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=ftp://172.19.17.1/pub/iso6 enabled=1 gpgcheck=0 |
在客户端安装hadoop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
yum install hadoop Installed: hadoop.x86_64 0:2.4.0.2.1.2.0-402.el6 Dependency Installed: db4-cxx.x86_64 0:4.7.25-18.el6_4 db4-devel.x86_64 0:4.7.25-18.el6_4 foomatic.x86_64 0:4.0.4-3.el6 foomatic-db.noarch 0:4.0-7.20091126.el6 foomatic-db-filesystem.noarch 0:4.0-7.20091126.el6 foomatic-db-ppds.noarch 0:4.0-7.20091126.el6 gdbm-devel.x86_64 0:1.8.0-36.el6 nc.x86_64 0:1.84-22.el6 pax.x86_64 0:3.4-10.1.el6 perl-CGI.x86_64 0:3.51-136.el6 perl-ExtUtils-MakeMaker.x86_64 0:6.55-136.el6 perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-136.el6 perl-Test-Harness.x86_64 0:3.17-136.el6 perl-Test-Simple.x86_64 0:0.92-136.el6 perl-devel.x86_64 4:5.10.1-136.el6 redhat-lsb.x86_64 0:4.0-7.el6.centos redhat-lsb-compat.x86_64 0:4.0-7.el6.centos redhat-lsb-core.x86_64 0:4.0-7.el6.centos redhat-lsb-graphics.x86_64 0:4.0-7.el6.centos redhat-lsb-printing.x86_64 0:4.0-7.el6.centos zookeeper.noarch 0:3.4.5.2.1.2.0-402.el6 |
^^
奇葩的是这位没有任何代言,代言费0!!
你是女的么还要讲解