环境:ubuntu16.04 ceph v10.2.3git
1、安装tgtgithub
在ceph集群中的某一台服务器上安装tgt服务( 若是target要支持后端为rbd存储,须要升级tgt >= 1.0.35 )ubuntu
apt-get install tgtvim
tgtadm --lld iscsi --op show --mode system | grep rbd #查看tgt是否支持rbd模块
若是不支持rbd,安装tgt的rbd模块后端
apt-get install tgt-rbd服务器
systemctl restart tgt #安装完后重启tgt服务rest
2、建立rbd imageorm
rbd create --size 100G rbd/iscsi-imageget
3、编辑ceph的配置文件ubuntu16.04
一、vim /etc/tgt/conf.d/iscsi_ceph.conf 内容以下:
<target iqn.2016-03.rbdstore.example.com:iscsi>
driver iscsi
bs-type rbd
backing-store rbd/iscsi-image # Format is <pool-name>/<image-name>
</target>
二、重启tgt服务
systemctl restart tgt
4、客户端发现磁盘
。。。。。。待续
配置文件参考:https://github.com/fujita/tgt/blob/master/doc/README.rbd