Ceph-10.2.10安装配置

环境准备

操作系统

1CentOS 7.2.1511

主机规划

1192.168.0.106 ceph-node1 #ceph-deploy
2192.168.0.107 ceph-node2
3192.168.0.108 ceph-node3

磁盘规划

1/dev/sda system
2/dev/sdb osd
3/dev/sdc osd

基本操作

关闭防火墙

1setenforce 0
2sed -i s'/SELINUX=enforcing/SELINUX=disabled'/g /etc/selinux/config
3yum -y install epel-release

ssh免密登录

ceph-node1

1ssh-keygen -t rsa
2ssh-copy-id ceph-node1
3ssh-copy-id ceph-node2
4ssh-copy-id ceph-node3

时间同步

1yum -y install ntp ntpdate
2ntpdate cn.pool.ntp.org

开始部署

使用国内源

1export CEPH_DEPLOY_REPO_URL=http://mirrors.163.com/ceph/rpm-jewel/el7
2export CEPH_DEPLOY_GPG_URL=http://mirrors.163.com/ceph/keys/release.asc

安装ceph-deploy

1yum -y ceph-deploy

使用ceph-deploy快速部署

 1mkdir my-cluster
 2cd my-cluster
 3
 4ceph-deploy new ceph-node1
 5
 6yum -y update ceph-deploy
 7
 8ceph-deploy install ceph-node1 ceph-node2 ceph-node3
 9
10ceph-deploy mon create-initial
11
12ceph-deploy admin ceph-node1 ceph-node2 ceph-node3
13
14# 查看磁盘
15ceph-deploy disk list ceph-node1
16
17ceph-deploy osd create ceph-node1:/dev/sdb ceph-node1:/dev/sdc
18
19ceph-deploy osd create ceph-node2:/dev/sdb ceph-node2:/dev/sdc
20
21ceph-deploy osd create ceph-node3:/dev/sdb ceph-node3:/dev/sdc
22
23ceph osd tree
24ID WEIGHT  TYPE NAME           UP/DOWN REWEIGHT PRIMARY-AFFINITY 
25-1 0.08752 root default                                          
26-2 0.02917     host ceph-node1                                   
27 0 0.01459         osd.0            up  1.00000          1.00000 
28 1 0.01459         osd.1            up  1.00000          1.00000 
29-3 0.02917     host ceph-node2                                   
30 2 0.01459         osd.2            up  1.00000          1.00000 
31 3 0.01459         osd.3            up  1.00000          1.00000 
32-4 0.02917     host ceph-node3                                   
33 4 0.01459         osd.4            up  1.00000          1.00000 
34 5 0.01459         osd.5            up  1.00000          1.00000 
35
36
37chmod +r /etc/ceph/ceph.client.admin.keyring

检查健康状况

1ceph health
2HEALTH_OK

创建块设备

1rbd create rbd1 --size 10240 

查看创建的rbd

1rbd list
2rbd1

查看rbd细节

1rbd --image rbd1 info
2rbd image 'rbd1':
3    size 10240 MB in 2560 objects
4    order 22 (4096 kB objects)
5    block_name_prefix: rbd_data.10372ae8944a
6    format: 2
7    features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
8    flags: