离线部署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 (pysense@gmail.com)
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