1。安装Ceph块存储客户端
<强> 192.168.3.158为客户端做如下操作强>
1.1修改主机名
root@localhost ~ #猫/etc/hosts …… 192.168.3.165 ceph265 192.168.3.166 ceph266 192.168.3.167 ceph267 192.168.3.158 ceph258 (root@localhost ~) # hostnamectl set-hostname ceph258
1.2修改ceph源文件
# wget - o/etc/yum.repos.d/ceph。回购https://raw.githubusercontent.com/aishangwei/ceph-demo/master/ceph-deploy/ceph.repo
1.3创建目录
# mkdir - p/etc/ceph
1.4安装ceph
# yum - y epel-release安装 #安装ceph yum - y #猫/etc/ceph/ceph.client.rbd。密匙环
[ceph@ceph265 my-cluster]美元ceph auth get-or-create客户机。rbd mon允许r的osd的允许班级阅读object_prefix rbd_children,允许rwx池=rbd”|三通。/ceph.client.rbd.keyring (client.rbd) 关键=AQBLBwRepKVJABAALyRx67z6efeI4xogPqHkyw==注:客户端。rbd为客户端名 孟之后的全为授权配置
[ceph@ceph265 my-cluster] scp ceph.client.rbd美元。密匙环root@192.168.3.158:/etc/ceph [ceph@ceph265 my-cluster] scp ceph美元。参看root@192.168.3.158:/etc/ceph
uname - r modprobe rbd
# wget - o/etc/yum.repos.d/ceph。回购https://raw.githubusercontent.com/aishangwei/ceph-demo/master/ceph-deploy/ceph.repo
root@ceph258 ~ #猫/etc/ceph/ceph.client.rbd.keyring (client.rdb) 关键=AQBLBwRepKVJABAALyRx67z6efeI4xogPqHkyw==(root@ceph258 ~) # ceph - s -客户名称。rbd
2。客户端创建块设备及映射
<强> 强>
美元ceph osd lspools #查看集群存储池 ceph osd池创建rbd 50美元 池rbd的创建50 #为地方组数量,由于我们后续测试,也需要更多的pg,所以这里设置为50
<强> 强>
[root@ceph258 ~] # rbd创建rbd2——5105名客户。rbd
[root@ceph258 ~] # rbd client.rbd ls -名字 rbd2 (root@ceph258 ~) # rbd ls - p rbd client.rbd——名称 rbd2 (root@ceph258 ~) # rbd client.rbd列表,名称 rbd2
[root@ceph258 ~] # rbd形象rbd2信息——客户名称。rbd
[root@ceph258 ~] # rbd地图——图像rbd2——客户名称。rbd
rbd功能禁用rbdl互斥型锁对象映射deep-flatten fast-diff——客户名称。rbd
rbd创建rbd2——大小10240——图像特征分层——客户名称。rbd
rbd_default_features=1
[root@ceph258 ~] # rbd功能禁用rbd2互斥型锁对象映射fast-diff deep-flatten——客户名称。rbd
[root@ceph258 ~] # rbd地图——图像rbd2——客户名称。rbd
[root@ceph258 ~] # rbd showmapped——客户名称。rbd
[root@ceph258 ~] # mkdir/mnt/ceph-disk1 [root@ceph258 ~] #山/dev/rbd0/mnt/ceph-disk1/
[root@ceph258 ~] # dd if=/dev/0=/mnt/ceph-disk1/file1数=100 b=1 m
[root@ceph203 -] # wget - o/usr/local/bin/rbd-mount https://raw.githubusercontent.com/aishangwei/ceph-demo/master/client/rbd-mount
root@ceph258 ~ # chmod + x/usr/local/bin/rbd-mount # wget - o/etc/systemd/system/rbd-mount. root@ceph258 ~服务https://raw.githubusercontent.com/aishangwei/ceph-demo/master/client/rbd-mount.service (root@ceph258 ~) # systemctl daemon-reload (root@ceph258 ~) # systemctl启用rbd-mount.service 从/etc/systemd/system/multi-user.target.wants/rbd-mount创建符号链接。/etc/systemd/system/rbd-mount.service服务。CEPH块存储