Preparations of ceph storage cluster (refer to the specific process of establishing other articles in this blog)
Including management node in the cluster is store1, ip address 10.8.20.11
The following create a mirror above 40G in this cluster, and that image as iscsi target, other machines can access the LAN and mount the iscsi target,
It is using tgt way.
First, create a mirror using a visual manner
Open ceph cluster Dashboard (https://10.8.20.11:8443), select the above navigation Block → images
Click on "New":
Enter the image name, size, below only check the "layered" and "mutex", then click the lower right corner of the "New RBD"
Remember that storage pool name: Store-the pool and mirror Name: iscsi-Disk , will be used later
So far, created a mirror
Second, the installation tgt, and add support for the rbd
Ceph cluster management node (e.g., above this cluster is store1) open shell, enter the following command to install tgt
apt -y install tgt
After installation, use the following command to verify whether tgt support rbd
tgtadm --lld iscsi --mode system --op show | grep rbd
The output is empty, indicating the current tgt is not yet supported rbd
Use the following command to install the tgt rbd module:
apt -y install tgt-rbd
Tgt restart the service, has supported the re-examination
Third, the establishment iscsi target
Edit /etc/tgt/targets.conf,
vim etc/tgt/targets.conf
Add the following:
<target iqn.2019-12-02.abc.com:iscsi>
bs-type rbd
backing-store store-pool/iscsi-disk #上面记下来的存储池名/镜像名
initiator-address 10.8.20.0/24 #允许访问的ip段
</target>
重启tgt服务
systemctl restart tgt
四、客户端挂载(windows客户端)
打开局域网中另一台windows系统管理工具中的iscsi发起程序
输入上述集群提供目标的IP地址,点击快速连接
发现目标,点击 完成
打开磁盘管理,可以看到新加的iscsi磁盘,对其进行格式化操作后即可使用