准备好源资源server,我使用之前的一台node4,配置都是1GB内存20GB存储

集群最好的安装方式一定是通过本地源的,假设是公共源,那么网络将会严重影响我们的安装进度。所以制作本地源是每个大数据工作者的必会技能。

1:制作ambari(1.4.1.25)本地源

下载ambari repo

拷贝到yum repo文件夹

[root@node4 ~]# cp ambari.repo /etc/yum.repos.d/

安装 yum-utils 当中有个命令是同步命令reposync 用来同步远程的yum repository

使用方法: reposync --repoid=base

[root@node4 ~]# yum install yum-utils

查看我们repo里面有什么:

[root@node4 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.psu.ac.th
 * extras: mirrors.psu.ac.th
 * updates: mirrors.psu.ac.th
repo id                                                       repo name                                                                                           status
HDP-UTILS-1.1.0.16                                            Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.16                                           61
Updates-ambari-1.4.1.25                                       ambari-1.4.1.25 - Updates                                                                               5
ambari-1.x                                                    Ambari 1.x                                                                                              5
base                                                          CentOS-6 - Base                                                                                     6,575
cloudera-cdh5                                                 Cloudera CDH, Version 5.5.1                                                                           146
cloudera-manager                                              Cloudera Manager, Version 5.5.1                                                                         7
extras                                                        CentOS-6 - Extras                                                                                      48
keytrustee                                                    Cloudera Navigator Key Trustee, Version 5.5.0                                                           1
updates                                                       CentOS-6 - Updates                                                                                    958
repolist: 7,806

将网络源中的包同步到本地:

reposync -r HDP-UTILS-1.1.0.16

reposync -r Updates-ambari-1.4.1.25

reposync -r ambari-1.x


HDP-UTILS-1.1.0.16 Updates-ambari-1.4.1.25 ambari-1.x拷贝到 /var/www/html/ambari下

cd /var/www/html/ambari
createrepo ./    #[root@node4 hdp]# yum install createrepo 


2:准备hortonworks hadoop
(HDP)2.0.6本地源

准备HDP网络源

[root@node4 ~]# vi /etc/yum.repos.d/HDP.repo

vi /etc/yum.repos.d/HDP.repo,加入下面内容

[HDP-2.0.6]

name=HDP

baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0

enabled=1

gpgcheck=0

[root@node4 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vinahost.vn
 * extras: mirrors.vinahost.vn
 * updates: mirrors.vinahost.vn
HDP-2.0.6                                                                                                                                        | 2.9 kB     00:00
HDP-2.0.6/primary_db                                                                                                                             |  70 kB     00:01
repo id                                                       repo name                                                                                           status
HDP-2.0.6                                                     HDP                                                                                                   156
HDP-UTILS-1.1.0.16                                            Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.16                                           61
Updates-ambari-1.4.1.25                                       ambari-1.4.1.25 - Updates                                                                               5
ambari-1.x                                                    Ambari 1.x                                                                                              5
base                                                          CentOS-6 - Base                                                                                     6,575
cloudera-cdh5                                                 Cloudera CDH, Version 5.5.1                                                                           146
cloudera-manager                                              Cloudera Manager, Version 5.5.1                                                                         7
extras                                                        CentOS-6 - Extras                                                                                      48
keytrustee                                                    Cloudera Navigator Key Trustee, Version 5.5.0                                                           1
updates                                                       CentOS-6 - Updates                                                                                    958
repolist: 7,962

reposync -r HDP-2.0.6  

耐心等待。

同步完毕。检查目录
[root@node4 ~]# ll
total 600
drwxr-xr-x   3 root root   4096 Dec 29 09:45 ambari-1.x
drwxr-xr-x  17 root root   4096 Dec 29 12:39 HDP-2.0.6
drwxr-xr-x  18 root root   4096 Dec 29 09:40 HDP-UTILS-1.1.0.16

查看文件大小:
du: cannot access `work/testing': No such file or directory
[root@node4 ~]# du -h --max-depth=1 
65M     ./HDP-UTILS-1.1.0.16
2.8M    ./iptraf-3.0.0
8.0K    ./.pki
38M     ./ambari-1.x
2.1G    ./HDP-2.0.6
2.2G    . 

HDP-2.0.6 拷贝到http server的/var/www/html/hdp下
cd /var/www/html/hdp

createrepo ./  
create是创建的意思。repo是repository的缩写,是仓库的意思。
yum(Yellow dog Updater,Modified)基本的功能是方便加入、删除和更新rpm软件包。能够解决软件包依存问题,更便于管理大量的系统更新问题。

它能够同一时候配置多个仓库或叫资源库(repository),就是存放更新和依存的软件包的地方。


[root@node4 hdp]# yum install createrepo 
[root@node4 hdp]# createrepo ./
Spawning worker 0 with 131 pkgs
Workers Finished
Gathering worker results

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
这样hadoop的本地源就做好了

hadoop集群ambari搭建(2)之制作hadoop本地源-LMLPHP

3.制作Centos系统源

手动mount系统光盘
[root@node4 mnt]# mount /dev/cdrom  /var/www/html/centos/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@node4 mnt]# cd /var/www/html/centos/
[root@node4 centos]# ll
total 82
-r--r--r-- 1 root root    14 Nov 29  2013 CentOS_BuildTag
dr-xr-xr-x 3 root root  2048 Nov 29  2013 EFI
-r--r--r-- 1 root root   212 Nov 27  2013 EULA
-r--r--r-- 1 root root 18009 Nov 27  2013 GPL
dr-xr-xr-x 3 root root  2048 Nov 29  2013 images
dr-xr-xr-x 2 root root  2048 Nov 29  2013 isolinux
dr-xr-xr-x 2 root root 40960 Nov 29  2013 Packages
-r--r--r-- 1 root root  1354 Nov 27  2013 RELEASE-NOTES-en-US.html
dr-xr-xr-x 2 root root  4096 Nov 29  2013 repodata
-r--r--r-- 1 root root  1706 Nov 27  2013 RPM-GPG-KEY-CentOS-6
-r--r--r-- 1 root root  1730 Nov 27  2013 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r-- 1 root root  1730 Nov 27  2013 RPM-GPG-KEY-CentOS-Security-6
-r--r--r-- 1 root root  1734 Nov 27  2013 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r-- 1 root root  3380 Nov 29  2013 TRANS.TBL
hadoop集群ambari搭建(2)之制作hadoop本地源-LMLPHP

4.制作HDP-UTILS-1.1.0.17源

到此本地源就差点儿相同了。可是到了安装的时候发现

 redhat6
HDP-2.0
HDP-UTILS-1.1.0.17而不是我们安装的HDP-UTILS-1.1.0.16所以我们须要再次反复以上的步骤,下载HDP-UTILS-1.1.0.17源
改动ambari.repo
[root@node4 yum.repos.d]# vi ambari.repo 
[ambari-1.x]
name=Ambari 1.x
gpgcheck=1
enabled=1
priority=1

[HDP-UTILS-1.1.0.17]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.17
gpgcheck=0
enabled=1
priority=1

[Updates-ambari-1.4.1.25]
name=ambari-1.4.1.25 - Updates
gpgcheck=1
enabled=1
priority=1


[root@node4 yum.repos.d]# reposync -r HDP-UTILS-1.1.0.17

将HDP-UTILS-1.1.0.17拷贝到server就可以
hadoop集群ambari搭建(2)之制作hadoop本地源-LMLPHP

至此,我们有三个源:



Charles 2015-12-30于Phnom Phen




版权说明:
本文由Charles Dong原创,本人支持开源以及免费故意的传播,反对商业化谋利。

CSDN博客:http://blog.csdn.net/mrcharles
个人站:http://blog.xingbod.cn
05-23 13:38