ceph本地镜像源搭建

本文以Cetnos7为例,搭建ceph本地镜像源

1、添加阿里云ceph镜像源

vi /etc/yum.repos.d/ceph.repo

[Ceph]

name=Ceph packages for $basearch

baseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/$basearch

enabled=1

gpgcheck=0

type=rpm-md

gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc

priority=1

[Ceph-noarch]

name=Ceph noarch packages

baseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/noarch

enabled=1

gpgcheck=0

type=rpm-md

gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc

priority=1

[ceph-source]

name=Ceph source packages

baseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/SRPMS

enabled=1

gpgcheck=0

type=rpm-md

gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc

priority=1

2、安装epel源

curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3、仅下载镜像源包组

这么做的好处就是仅仅把最新所需要的包下载了下来,如果通过同步镜像的方式,会把一些暂时无用的包下载下来,占用空间!

yum install --downloadonly --downloaddir=/data/mirrors/ceph/ ceph ceph-radosgw ntp ceph-deploy

PS:其中--downloadonly表示仅下载,--downloaddir指定下载到哪个目录

4、安装nginx

我这里以nginx为例,当然你也可以使用vsftp或httpd

rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm

yum install wnginx

5、配置nginx

将原来/usr/local/nginx/conf/vhost/demo.conf清空,写入以下配置

server

    {

        listen 80;

        server_name _;

    

 location / {

   root   /data/mirrors;

          index  index.html index.htm;

          autoindex on;

          autoindex_exact_size off;

          autoindex_localtime on;

        }

}

6、重启nginx服务

nginx -t

/etc/init.d/nginx restart

7、创建本地源

yum install createrepo -y

createrepo -pdo /data/mirrors/ceph/ /data/mirrors/ceph/

后续如果有更新增加或删减包,使用以下命令更新

createrepo --update /data/mirrors/ceph/

至此一个本地ceph源镜像就配置完成了

8、配置本地源

其他内网机器上配置源地址

mkdir /etc/yum.repos.d/repo

mv /etc/yum.repos.d/CentOS* /etc/yum.repos.d/repo

mv /etc/yum.repos.d/epel* /etc/yum.repos.d/repo

vi /etc/yum.repos.d/ceph.repo

[http-repo]

name=internal-ceph-repo

baseurl=http://IP/ceph

enabled=1

gpgcheck=0

将其中IP替换为本地镜像机的地址,此时就可以通过本地源安装服务了

yum -y install ceph ceph-radosgw ntp

 

上一篇:基于wlnmp一键包安装Nextcloud网盘


下一篇:android 开发中遇到的错误及解决方式(更新R.java文件不能自动更新问题)