配置本地ceph源

以下为转载其他链接,详情请看http://www.strugglesquirrel.com/2019/04/23/centos7%E9%83%A8%E7%BD%B2ceph/#more
一、下载相关安装包到本地

[cephfsd@deploy ~]$ sudo yum -y install --downloadonly --downloaddir=/yum/ceph/ ceph ceph-radosgw htop sysstat iftop iotop ntp ntpdate
[cephfsd@deploy ~]$ sudo yum install -y createrepo httpd
[cephfsd@deploy ~]$ sudo mkdir -p /yum/ceph/luminous
[cephfsd@deploy ~]$ sudo yum install -y ceph-deploy python-pip ntp ntpdate

二、配置本地源

2
3
4
5
6
7
8
[cephfsd@deploy ~]$ sudo createrepo -pdo /yum/ceph/luminous/ /yum/ceph/luminous/
Spawning worker 0 with 91 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

  如果源的包发生变化,例如加入了新的包,或者删掉了一些旧包,需要更新xml

  [cephfsd@deploy ~]$ sudo createrepo --update /yum/ceph/luminous/

  修改/etc/httpd/conf/httpd.conf文件,然后启动httpd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DocumentRoot "/yum/ceph/"

<Directory "/yum/ceph/">
AllowOverride None
# Allow open access:
Require all granted
</Directory>

<Directory "/yum/ceph/">
...
</Directory>

[cephfsd@deploy ~]$ sudo systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[cephfsd@deploy ~]$ sudo systemctl start httpd.service

  至此,内部源就建好了,接下来到每一个安装ceph的节点,配置源指向这个内部源

     

1
2
3
4
5
6
7
8
9
10
11
12
13
[cephfsd@ceph1 ~]$ cd /etc/yum.repos.d/
[cephfsd@ceph1 yum.repos.d]$ sudo mkdir backup
[cephfsd@ceph1 yum.repos.d]$ sudo mv ./*.repo backup/
[cephfsd@ceph1 yum.repos.d]$ cat inter.repo
[http-repo]
name=internal-ceph-repo
baseurl=http://deploy/luminous
enabled=1
gpgcheck=0

[cephfsd@ceph1 ~]$ sudo yum -y install ceph ceph-radosgw htop sysstat iftop iotop ntp ntpdate
[cephfsd@ceph1 ~]$ ceph --version
ceph version 12.2.12 (1436006594665279fe734b4c15d7e08c13ebd777) luminous (stable)

 

ceph阿里源,
在每个节点上加入ceph源后,先安装epel-release,如果我们不安装,就会缺少部分包,会有下面的错误

[Ceph]
name=Ceph packages for $basearch
baseurl=http://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=http://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=http://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

posted @ 2019-05-06 17:13  bili9527  阅读(792)  评论(0编辑  收藏  举报