美文网首页
CentOS7搭建本地yum仓库--CEPH

CentOS7搭建本地yum仓库--CEPH

作者: 扶海狐 | 来源:发表于2019-04-01 18:14 被阅读0次

一 环境信息

cpu:Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz //4core
mem:total 7686,swap 7935
os:Linux promote.cache-dns.local 3.10.0-957.el7.x86_64
ceph:rh-luminous
network:NAT

二 依赖包下载

NOTE:本节操作需要联网下载,如果已经下载的可以直接拷贝

  1. ceph-ansible 下载
git clone https://github.com/ceph/ceph-ansible.git
git checkout stable-3.2
  1. yum仓库创建所需rpm包下载
  • 文件存放路径
mkdir -p /home/http/repo/httpd/el7
mkdir -p /home/http/repo/ntp/el7
mkdir -p /home/http/repo/createrepo/el7
  • rpm包&依赖解决
yum install --downloadonly --downloaddir /home/http/repo/httpd/el7 httpd
yum install --downloadonly --downloaddir /home/http/repo/ntp/el7 ntp 
yum install --downloadonly --downloaddir /home/http/repo/createrepo/el7 createrepo
  1. ceph安装所需rpm包下载
  • 文件存放路径
mkdir -p /home/http/repo/ceph/luminous
mkdir -p /home/http/repo/ansible/2.6.4
  • rpm包&依赖解决
yum install --downloadonly --downloaddir /home/http/repo/ceph/luminous  http://download.ceph.com/rpm-luminous/el7/noarch/ceph-release-1-1.el7.noarch.rpm
yum install --downloadonly --downloaddir /home/http/repo/ceph/luminous ceph-common.x86_64
yum install --downloadonly --downloaddir /home/http/repo/ansible/2.6.4 centos-release-ansible26.noarch
  1. python包下载
  • 文件存放路径
mkdir -p /home/http/repo/python/pip
mkdir -p /home/http/repo/python/deps
  • 下载安装包
yum install --downloadonly --downloaddir /home/http/repo/python/pip python-pip
cd /home/http/repo/python/pip python-pip
rpm -ivh *.rpm
pip install --download /home/http/repo/python/deps -r requirements.txt
  1. 查看
[root@localhost ~]# tree /home/http/repo/
/home/http/repo/
├── ansible
│   └── 2.6.4
│       ├── centos-release-ansible26-1-3.el7.centos.noarch.rpm
│       └── centos-release-configmanagement-1-1.el7.centos.noarch.rpm
├── ceph
│   └── luminous
│       ├── at-3.1.13-24.el7.x86_64.rpm
│       ├── avahi-libs-0.6.31-19.el7.x86_64.rpm
│       ├── bc-1.06.95-13.el7.x86_64.rpm
│       ├── boost-iostreams-1.53.0-27.el7.x86_64.rpm
│       ├── boost-program-options-1.53.0-27.el7.x86_64.rpm
│       ├── boost-random-1.53.0-27.el7.x86_64.rpm
│       ├── boost-regex-1.53.0-27.el7.x86_64.rpm
│       ├── boost-system-1.53.0-27.el7.x86_64.rpm
│       ├── boost-thread-1.53.0-27.el7.x86_64.rpm
│       ├── centos-release-ceph-luminous-1.1-2.el7.centos.noarch.rpm
│       ├── centos-release-storage-common-2-2.el7.centos.noarch.rpm
│       ├── ceph-common-10.2.5-4.el7.x86_64.rpm
│       ├── cryptsetup-2.0.3-3.el7.x86_64.rpm
│       ├── cups-client-1.6.3-35.el7.x86_64.rpm
│       ├── cups-libs-1.6.3-35.el7.x86_64.rpm
│       ├── ed-1.9-4.el7.x86_64.rpm
│       ├── gdisk-0.8.10-2.el7.x86_64.rpm
│       ├── hdparm-9.43-5.el7.x86_64.rpm
│       ├── libicu-50.1.2-17.el7.x86_64.rpm
│       ├── librados2-10.2.5-4.el7.x86_64.rpm
│       ├── librbd1-10.2.5-4.el7.x86_64.rpm
│       ├── m4-1.4.16-10.el7.x86_64.rpm
│       ├── mailx-12.5-19.el7.x86_64.rpm
│       ├── patch-2.7.1-10.el7_5.x86_64.rpm
│       ├── psmisc-22.20-15.el7.x86_64.rpm
│       ├── python-backports-1.0-8.el7.x86_64.rpm
│       ├── python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
│       ├── python-chardet-2.2.1-1.el7_1.noarch.rpm
│       ├── python-ipaddress-1.0.16-2.el7.noarch.rpm
│       ├── python-rados-10.2.5-4.el7.x86_64.rpm
│       ├── python-rbd-10.2.5-4.el7.x86_64.rpm
│       ├── python-requests-2.6.0-1.el7_1.noarch.rpm
│       ├── python-six-1.9.0-2.el7.noarch.rpm
│       ├── python-urllib3-1.10.2-5.el7.noarch.rpm
│       ├── redhat-lsb-core-4.1-27.el7.centos.1.x86_64.rpm
│       ├── redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64.rpm
│       ├── spax-1.5.2-13.el7.x86_64.rpm
│       └── time-1.7-45.el7.x86_64.rpm
├── createrepo
│   └── el7
│       ├── createrepo-0.9.9-28.el7.noarch.rpm
│       ├── deltarpm-3.6-3.el7.x86_64.rpm
│       ├── libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
│       └── python-deltarpm-3.6-3.el7.x86_64.rpm
├── httpd
│   └── el7
│       └── httpd-2.4.6-88.el7.centos.x86_64.rpm
├── keys
│   └── RPM-GPG-KEY-CentOS-7
└── ntp
    └── el7
        ├── autogen-libopts-5.18-5.el7.x86_64.rpm
        ├── ntp-4.2.6p5-28.el7.centos.x86_64.rpm
        └── ntpdate-4.2.6p5-28.el7.centos.x86_64.rpm

11 directories, 49 files

NOTE:以下章节操作不需要联网操作

三 文件服务器

  1. 安装httpd
cd /home/http/repo/httpd/el7
rpm -ivh *.rpm
  1. 编辑文件服务器路径
vi /etc/httpd/conf/httpd.conf
------------------------------------
# DocumentRoot "/var/www/html"
DocumentRoot "/home/http/"
ServerName 192.168.232.129
...
#<Directory "/var/www">
<Directory "/home">
...
#<Directory "/var/www/html">
<Directory "/home/http">
...
------------------------------------

NOTE:ServerName 是本机IP,也可以是配置过的主机名或域名

  1. 启动服务
  • 重启httpd服务
systemctl stop firewalld
systemctl restart httpd
setenforce 0

四 创建本地仓库

  1. 安装createrepo
cd /home/http/repo/createrepo/el7
rpm -ivh *.rpm
  1. 创建仓库
createrepo /home/http/repo/ntp/el7
createrepo /home/http/repo/httpd/el7
createrepo /home/http/repo/createrepo/el7
createrepo /home/http/repo/ceph/luminous
createrepo /home/http/repo/ansible/2.6.4
  1. gpgkey
mkdir -p /home/http/repo/keys
cp /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 /home/http/repo/keys

五 使用本地仓库

  1. 配置本地源
touch /etc/yum.repos.d/local.repo
vi /etc/yum.repos.d/local.repo
------------------------------------------------------------
[ntp]
name=ntp
baseurl=http://192.168.232.129/repo/ntp/el7/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://192.168.232.129/repo/keys/RPM-GPG-KEY-CentOS-7
[httpd]
name=httpd
baseurl=http://192.168.232.129/repo/httpd/el7/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://192.168.232.129/repo/keys/RPM-GPG-KEY-CentOS-7
[createrepo]
name=createrepo
baseurl=http://192.168.232.129/repo/createrepo/el7/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://192.168.232.129/repo/keys/RPM-GPG-KEY-CentOS-7
[ceph]
name=ceph
baseurl=http://192.168.232.129/repo/ceph/luminous/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://192.168.232.129/repo/keys/RPM-GPG-KEY-CentOS-7
[ansible]
name=ansible
baseurl=http://192.168.232.129/repo/ansible/2.6.4/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://192.168.232.129/repo/keys/RPM-GPG-KEY-CentOS-7
------------------------------------------------------------
  1. 本地源生效
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
yum clean all
yum update -y
  1. 查看repo信息
yum repoinfo ceph
YUM_LOCAL_02.PNG

六 问题和错误解决

  1. httpd启动失败:Permission denied: AH00072: make_sock: could not bind to address [::]:80
    systemctl stop firewalld
  2. 本地源不生效:Cannot find a valid baseurl for repo: base/7/x86_64
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

相关文章

  • CentOS7搭建本地yum仓库--CEPH

    一 环境信息 cpu:Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz //4co...

  • 搭建本地离线yum仓库

    搭建本地离线yum仓库 目录 前言 把rpm包下载到本地 配置本地yum仓库信息 生成repodata信息 检查以...

  • 个人-搭建本地yum仓库及自制rpm包

    搭建本地yum仓库及自制rpm包 实验目的 为方便本地 yum 的管理,建本地 yum 仓库,实现局域网内部快速安...

  • CentOS7搭建本地YUM仓库

    1. 仓库环境准备 1.1. 系统环境 1.2. 修改yum源 1.3. 检验阿里云源是否正常 2. 部署仓库 2...

  • Linux软件管理day17

    yum指令yum本地仓库搭建 一、yum指令 1.与yum仓库相关指令 2.与yum缓存相关指令 3.组包相关指令...

  • 本地yum仓库搭建

    yum: yum的全称是yellow dog updater,modified,是一个shell前端软件包管理器;...

  • 搭建本地yum仓库

    前言 我们知道yum工具是基于rpm的,其一个重要的特性就是可以自动解决依赖问题,但是yum的本质依旧是把...

  • 搭建本地yum仓库

    方法一: 第一步:光盘挂载 第二步:编写文件 第三步:清理缓存和安装优先级 其它设备如果想要使用,可以结合NFS使...

  • 搭建本地yum仓库

    服务端 *本地yum 仓库【这里用的是ftp协议】 ftp://10.0.0.2/ *1.先准备一天虚拟机当做本地...

  • CentOS7.6 搭建本地yum仓库

    CentOS7.6 搭建本地yum仓库 yum源地址:http://mirrors.163.com/centos/...

网友评论

      本文标题:CentOS7搭建本地yum仓库--CEPH

      本文链接:https://www.haomeiwen.com/subject/eizvbqtx.html