目錄
- 背景
- 內容簡介
- 下載資源
- 搭建環境
- 部署Ambari本地鏡像倉庫
- 安全配置
- 安裝Nginx
- 配置鏡像倉庫
- 參考資料
背景
2018年10月4日,兩家大資料先驅Cloudera和Hortonworks宣布平等合并,Cloudera以股票方式收購Hortonworks,Cloudera股東最侄訓得合并公司60%的股份,
2020年11月,Cloudera宣布:從2021年1月31日開始,所有Cloudera軟體都需要有效的訂閱進行訪問,這包括以下產品的所有先前版本:包含Apache Hadoop的 Cloudera 發行版 (CDH),Hortonworks Data Platform (HDP),Data Flow (HDF / CDF) 和Cloudera Data Science Workbench (CDSW) ,
內容簡介
這個系列將分為三部分內容:
- 迅雷YYDS(部署Ambari本地鏡像倉庫)
- 安裝ambari-server和ambari-agent
- 部署Ambari大資料集群
下載資源
由于封鎖,我們無法下載到需要的資源,筆者在嘗試過各種方法之后,想起了一個被人遺忘的工具——迅雷,

開通會員后,居然可以直接使用官網連接下載需要的資源,我想,應該是以前有人下載過對應的資源,迅雷將其快取在其服務器中了,我又將這些資源上傳到百度網盤和阿里云盤,發現幾乎是秒傳,所以你們懂的!
相應的下載鏈接,我將會放到參考資料中,
這里,筆者也準備一套資源“Ambari 2.7.5及其配套的HDP和HDF資源包”,
搭建環境
虛擬機:Oracle VM VirtualBox
作業系統鏡像:CentOS-7-x86_64-Minimal-2009.torrent.iso
創建了3臺虛擬,都分配了2個核和4GB記憶體,網路使用“NAT 網路”,可以參考我的文章“使用VirtualBox搭建一套集群環境”,
同時,需要給每臺機器配置對應hostname,可以這樣配置master
hostnamectl set-hostname master
其余的節點為“worker1”和“worker2”,然后可以查看各節點ip
ip addr show
最后,配置一下/etc/hosts,注意使用自己本機的ip,不要復制粘貼
vi /etc/hosts
在檔案末尾追加如下內容
10.0.2.5 master
10.0.2.6 worker1
10.0.2.7 worker2
下面我們正式進入部署Ambari鏡像倉庫的部分,
部署Ambari本地鏡像倉庫
安全配置
永久開啟80埠
firewall-cmd --zone=public --add-port=80/tcp --permanent
重啟防火墻
firewall-cmd --reload
關閉SELinux
vi /etc/selinux/config
將SELINUX的值修改為=disabled,然后
reboot
接下來還需要在VirtualBox上配置埠轉發規則

安裝Nginx
安裝yum-utils
yum install -y yum-utils
配置Nginx的YUM源
vi /etc/yum.repos.d/nginx.repo
內容如下
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
安裝Nginx
yum install -y nginx
啟動Nginx
systemctl start nginx
使用瀏覽器訪問localhost,當出現下來的內容時,說明nginx已經安裝成功啦!

設定nginx開機自啟動
systemctl enable nginx
配置鏡像倉庫
正經人誰用默認的組態檔?所以:
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak
這里補充一下,備份而不是洗掉是個好習慣!
創建ambari.conf
vi /etc/nginx/conf.d/ambari.conf
內容如下
server {
listen 80;
server_name localhost;
location / {
root /var/www/html;
autoindex on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
創建目錄
mkdir -p /var/www/html
將下列資源上傳到/var/www/html
- ambari-2.7.5.0-centos7.tar.gz
- HDP-3.1.5.6091-centos7-rpm.tar.gz
- HDF-3.4.1.1-centos7-rpm.tar.gz
- HDP-GPL-3.1.5.0-centos7-gpl.tar.gz
- hdf-ambari-mpack-3.4.1.1-4.tar.gz
- HDP-UTILS-1.1.0.22-centos7.tar.gz
解壓ambari-2.7.5.0-centos7.tar.gz到/var/www/html
tar xf ambari-2.7.5.0-centos7.tar.gz -C /var/www/html
創建hdf和hdp檔案夾
mkdir -p /var/www/html/hdf && mkdir -p /var/www/html/hdp
解壓相關檔案到對應的檔案夾
tar xf HDF-3.4.1.1-centos7-rpm.tar.gz -C /var/www/html/hdf && tar xf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp && tar xf HDP-GPL-3.1.5.0-centos7-gpl.tar.gz -C /var/www/html/hdp
重啟Nginx
systemctl restart nginx
在左上角出現“Index of /”,說明配置成功,
修改ambari.repo
vi /var/www/html/ambari/centos7/2.7.5.0-72/ambari.repo
主要修改baseurl和gpgkey,將public-repo-1.hortonworks.com替換為master
#VERSION_NUMBER=2.7.5.0-72
[ambari-2.7.5.0]
#json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
#VERSION_NUMBER=2.7.5.0-72
[ambari-2.7.5.0]
#json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
name=ambari Version - ambari-2.7.5.0
baseurl=http://master/ambari/centos7/2.7.5.0-72/
gpgcheck=1
gpgkey=http://master/ambari/centos7/2.7.5.0-72/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
至此,一個本地鏡像倉庫已經部署完畢,
參考資料
關于Cloudera軟體的訪問獲取
nginx: Linux packages
Accessing HDP Repositories
HDF Repository Locations
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/293925.html
標籤:其他
上一篇:2021-08-14
