Ambari本地库搭建

2022-05-06 17:29:03 浏览数 (1)

0 Obtaining the Repositories(下载库)

0.1 CentOS 6

      http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.2.0/ambari-2.4.2.0-centos6.tar.gz

      http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6/HDP-UTILS-1.1.0.20-centos6.tar.gz

      http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.3.0/HDP-2.4.3.0-centos6-rpm.tar.g

0.2 CentOS 7

      http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.2.0/ambari-2.4.2.0-centos7.tar.gz

     http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.3.0/HDP-2.4.3.0-centos7-rpm.tar.gz

      http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz

1.Setting Up a Local Repository(搭建本地库)

1.1 If your repository has temporary Internet access, and you are using RHEL/CentOS/Oracle Linux as your OS, install yum utilities:

     [root@vnode0 ~]# yum install -y yum-utils createrepo

1.2 install an HTTP server

     [root@vnode0 ~]# yum install -y httpd      [root@vnode0 ~]#  vi /etc/httpd/conf/httpd.conf      ServerName 192.168.1.180:80      [root@vnode0 ~]# httpd      httpd (pid 2728) already running      [root@vnode0 ~]# systemctl enable httpd      Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.      Apache默认将网站的根目录指向/var/www/html 目录      默认的主配置文件是/etc/httpd/conf/httpd.conf      配置存储在的/etc/httpd/conf.d/目录      On your mirror server, create a directory for your web server.      [root@vnode0 ~]# cd /var/www/html      [root@vnode0 html]#

1.3 Copy the repository tarballs to the web server directory and untar.

(1) Ambari Repository : Untar under <web.server.directory>      [root@east81 Public]# tar -zxvf ambari-2.4.2.0-centos7.tar.gz      [root@east81 Public]# scp -r AMBARI-2.4.2.0/ 192.168.1.180:/var/www/html/      [root@vnode0 html]# ls      AMBARI-2.4.2.0 (2)HDP Stack Repositories : Create directory and untar under <web.server.directory>/hdp      [root@vnode0 html]# mkdir hdp      [root@vnode0 html]# ls      AMBARI-2.4.2.0  hdp      [root@vnode0 html]#      [root@east81 Public]# scp -r HDP 192.168.1.180:/var/www/html/hdp      [root@east81 Public]# tar -zxvf HDP-UTILS-1.1.0.20-centos7.tar.gz      [root@east81 Public]# scp -r HDP-UTILS-1.1.0.20 192.168.1.180:/var/www/html/hdp    (3)Confirm you can browse to the newly created local repositories.      http://192.168.1.180/AMBARI-2.4.2.0/      http://192.168.1.180/hdp/      http://192.168.1.180/hdp/HDP/

     http://192.168.1.180/hdp/HDP-UTILS-1.1.0.20/

2、配置repo文件

2.1下载Ambari 的公共库文件(public repository)

      http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.2.0/ambari.repo       [root@east81 Downloads]# scp ambari.repo 192.168.1.180:/etc/yum.repos.d/

2.2修改repo

      [root@vnode0 yum.repos.d]# vi ambari.repo       [Updates-ambari-2.4.2.0]       name=ambari-2.4.2.0 - Updates       baseurl=http://192.168.1.180/ambari/centos7/2.4.2.0-136/       gpgcheck=1       gpgkey=http://192.168.1.180/ambari/centos7/2.4.2.0-136//RPM-GPG-KEY/RPM-GPG-KEY-Jenkins       enabled=1

      priority=1

3 访问本地库

http://192.168.1.180/ambari/

      Index of /ambari

Name

Last modified

Size

Description

Parent Directory

-

OSL.txt

2016-12-17 01:05

530K

centos7/

2016-12-17 01:04

-

setup_repo.sh

2016-12-24 00:43

5.6K

http://192.168.1.180/hdp/

Index of /hdp

Name

Last modified

Size

Description

Parent Directory

-

HDP-UTILS-1.1.0.20/

2016-12-17 01:18

-

HDP/

2016-12-17 01:19

-

elasticsearch-5.1.1...>

2016-12-26 06:03

32M

4、更新库

[root@vnode0 2.4.2.0-136]# ls ambari  build.id  build_metadata.txt  changelog.txt  repodata  RPM-GPG-KEY  smartsense [root@vnode0 2.4.2.0-136]# createrepo --update ./ Spawning worker 0 with 1 pkgs Spawning worker 1 with 1 pkgs Spawning worker 2 with 0 pkgs Spawning worker 3 with 0 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete [root@vnode0 2.4.2.0-136]# yum clean all Loaded plugins: fastestmirror Cleaning repos: HDP-2.4.3.0 HDP-UTILS-1.1.0.20 Updates-ambari-2.4.2.0 c7-media Cleaning up everything Cleaning up list of fastest mirrors [root@vnode0 2.4.2.0-136]# yum makecache Loaded plugins: fastestmirror HDP-2.4.3.0                                                                                                               | 2.9 kB  00:00:00      HDP-UTILS-1.1.0.20                                                                                                        | 2.9 kB  00:00:00      Updates-ambari-2.4.2.0                                                                                                    | 2.9 kB  00:00:00      c7-media                                                                                                                  | 3.6 kB  00:00:00      (1/13): HDP-2.4.3.0/primary_db                                                                                            |  62 kB  00:00:00      (2/13): HDP-2.4.3.0/other_db                                                                                              |  12 kB  00:00:00      (3/13): HDP-UTILS-1.1.0.20/primary_db                                                                                     |  28 kB  00:00:00      (4/13): HDP-2.4.3.0/filelists_db                                                                                          | 361 kB  00:00:01      (5/13): Updates-ambari-2.4.2.0/filelists_db                                                                               | 135 kB  00:00:00      (6/13): Updates-ambari-2.4.2.0/other_db                                                                                   | 1.3 kB  00:00:00      (7/13): Updates-ambari-2.4.2.0/primary_db                                                                                 |  11 kB  00:00:00      (8/13): c7-media/group_gz                                                                                                 | 155 kB  00:00:00      (9/13): c7-media/primary_db                                                                                               | 5.3 MB  00:00:00      (10/13): c7-media/filelists_db                                                                                            | 6.2 MB  00:00:00      (11/13): c7-media/other_db                                                                                                | 2.3 MB  00:00:00      (12/13): HDP-UTILS-1.1.0.20/filelists_db                                                                                  |  67 kB  00:00:01      (13/13): HDP-UTILS-1.1.0.20/other_db                                                                                      |  15 kB  00:00:00      Determining fastest mirrors Metadata Cache Created

0 人点赞