離線部署Ambari + hdp

搭建本地yum源

1. 從科大源同步yum源

因爲要部署的設備不能連接外網,所以我用了一臺可連外網的電腦同步源,然後通過scp傳輸到開啓http服務的服務器上。

說明:我的設備是centos7,大部分的包都在os/x86_64/Packages目錄下,所以我只同步了這個目錄。
  實際上7/是7.6/的鏈接所以7/中並沒有什麼內容,可以根據實際需要同步所需的目錄。
  可以到 https://mirrors.ustc.edu.cn/centos/ 中查找,並需改centos.list中的目錄。
  參考文檔:http://mirrors.ustc.edu.cn/help/rsync-guide.html

$ mkdir repo
$ cd repo
$ vim centos.list
*/
7
7/os/x86_64/Packages/*
7/os/*/repodata/*
7/os/*/RPM-GPG-KEY*
7/extras/**
7/updates/**
7/centosplus/**
7.6*/os/x86_64/Packages/*

$  rsync-centos-yum.sh
#!/bin/bash
# by 1057 ([email protected])
set -o errexit
set -o nounset

include="centos.list"
DST=mirrors/centos

cd $(dirname $(readlink -f ${BASH_SOURCE[0]}))
if [[ $# -ne 0 ]]; then
    if [[ -f "$1" ]]; then
        include="$1"
        shift
    fi
fi

mkdir -p $DST
rsync -avi --progress --delete --include-from="$include" --exclude="*" \
    --log-file=rsync-centos-yum.log \
    rsync://rsync.mirrors.ustc.edu.cn/repo/centos $DST $*

$ chmod +x rsync-centos-yum.sh
$ ./rsync-centos-yum.sh

同步的包放在當前目錄下的mirrors/centos中。

2. 安裝apache httpd服務器

3. 配置

  • 生成repo
$ cp  mirrors/centos/centos/7.6.1810/os/x86_64/Packages/*  /var/www/html/centos
$ cd  /var/www/html/centos
$ createrepo .
  • 添加yum源文件
$ vim /etc/yum.repos.d/centos.repo
[centos]
name=Centos
baseurl=http://192.168.0.196/centos
gpgcheck=0
gpgkey=http://ep-bd01/centos/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

$ yum clean all
$ yum makecache

部署

安裝之前查看系統支持版本:(一定要確定安裝版本適合你的系統)
https://supportmatrix.hortonworks.com/
參考文檔:
https://www.cnblogs.com/dajianshi/p/9455980.html
https://www.cnblogs.com/dajianshi/p/9482495.html
https://blog.csdn.net/u014589856/article/details/81625007

依賴包:
psutil-5.6.2.tar.gz https://pypi.org/project/psutil/#files

yum install python python-devel glibc-devel glibc-headers -y
tar -xvf psutil-5.6.2.tar.gz
cd psutil-5.6.2
python setup.py install
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章