ceph安装部署

使用ceph-deploy部署部署版本ceph-luminous
 
一,下载安装包,制作yum源,yum将挂载到192.168.100.100
(1)下载安装包
mkdir ceph-luminous
repotrack ceph ceph-mgr ceph-mon ceph-mds ceph-osd ceph-fuse ceph-radosgw -p /root/ceph-luminous/
repotrack ceph-deploy -p /root/ceph-luminous/
repotrack fcgi -p /root/ceph-luminous
repotrack fcgi-devel -p /root/ceph-luminous
repotrack epel-release -p /root/ceph-luminous
repotrack yum-plugin-priorities -p /root/ceph-luminous
repotrack python2-pip -p /root/ceph-luminous
(2)制作yum源
安装httpd服务 yum install httpd
将安装包移动到/var/www/html/ceph目录下,启动http服务后就可以访问
下载https://mirrors.aliyun.com/ceph/keys/release.asc到/var/www/html/文件夹下,ceph-deploy安装时会找key文件
/var/www/html/ceph
├── noarch
│   └── repodata
├── SRPMS
│   └── repodata
└── x86_64
├── repodata
注意:
ceph安装包都在x86_64目录下
安装过程会找noarch和SRPMS目录,因此需要创建noarch和SRPMS目录(空目录),使用createrepo命令在noarch和SRPMS目录下生成 repodata目录,不然安装会报错
 
 
二,ceph节点部署
 
2.1 主机信息

ceph安装部署_第1张图片

 

2.2 配置各主机hosts文件
 
# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.131 ceph1
192.168.100.132 ceph2
192.168.100.133 ceph3
 
2.3 ceph1免密登录ceph2/ceph3
 
[root@ceph1 ~]# ssh-keygen
[root@ceph1 ~]# ssh-copy-id -i .ssh/id_rsa.pub ceph2
[root@ceph1 ~]# ssh-copy-id -i .ssh/id_rsa.pub ceph3
 
2.4 配置各节点yum源
 
# cat /etc/yum.repos.d/base.repo
[ceph]
name=ceph
baseurl=http://192.168.100.100/ceph/x86_64
gpgcheck=0
 
[base]
name=base
baseurl=http://192.168.100.100/centos/7/os/x86_64
gpgcheck=0
 
2.5 ceph1节点安装ceph-deploy工具
 
yum install ceph-deploy
 
2.6 创建集群
创建集群,并设置ceph1 ceph2 ceph3为 mon节点
[root@ceph1 ~]# mkdir /etc/ceph && cd /etc/ceph 生成配置文件在当前目录下
[root@ceph1 ~]# ceph-deploy new ceph1 ceph2 ceph3
[root@ceph1 ~]# cat /etc/ceph/ceph.conf
[global]
fsid = ba902222-4795-4e07-90a3-b1953928d187
mon_initial_members = ceph1, ceph2, ceph3
mon_host = 192.168.100.131,192.168.100.132,192.168.100.133
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
 
public network = 192.168.100.0/24
 
2.7 所有节点安装ceph
 
# ceph-deploy install ceph1 ceph2 ceph3
[root@ceph1 ~]# ceph --version
ceph version 12.2.12 (1436006594665279fe734b4c15d7e08c13ebd777) luminous (stable)
 
2.8 激活monitor服务
 
[root@ceph1 ceph]#ceph-deploy mon create-initial
 
 
2.9 统一配置
 
用ceph-deploy把配置文件和admin密钥拷贝到所有节点,这样每次执行Ceph命令行时就无需指定monitor地址和ceph.client.admin.keyring了
[root@ceph1 ceph]# ceph-deploy admin ceph1 ceph2 ceph3
ceph-deploy --overwrite-conf admin node{1..4} 同步配置文件
 
2.10 部署OSD服务
 
yum install python2-pip
[root@ceph1 ceph]# ceph-volume lvm create --data /dev/sdb
[root@ceph2 ceph]# ceph-volume lvm create --data /dev/sdb
[root@ceph3 ceph]# ceph-volume lvm create --data /dev/sdb
 
ceph安装部署_第2张图片

 

 

 
 

你可能感兴趣的:(ceph安装部署)