Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure iSCSI Transport Service based on ceph Cluster

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to configure ceph cluster-based iSCSI transport service. I hope you will get something after reading this article. Let's discuss it together.

Prepare:

System: CentOS-7-x86_64-DVD-1511 (minimize installation Chinese)

A complete ceph cluster (the cluster used in this article is a healthy cluster of one mon node and three osd nodes)

Usage tool: server side scsi-target-utils-1.0.38-48 Linux client iscsi-initiator-utils

Scsi-target-utils-1.0.38-48 download address

Http://apt-mirror.sepia.ceph.com/centos6-qemu-kvm/scsi-target-utils-1.0.38-48.bf6981.ceph.el6.x86_64.rpm

Turn off the firewall and selinux

Systemctl disable firewalld (turn off the firewall and boot automatically)

Systemctl stop firewalld (turn off fire prevention please)

Setenforce 0 (temporarily shuts down selinux)

Permanently close the SELINUX in the modified / etc/selinux/config file to disabled

SELINUX=disabled

Steps:

1. download

Method 1: download visually by browser and send it to the server using xshell

Yum install-y lrzsz

Rz

Method 2: yum install-y wget

Wget http://apt-mirror.sepia.ceph.com/centos6-qemu-kvm/scsi-target-utils-1.0.38-48.bf6981.ceph.el6.x86_64.rpm

two。 Installation

Method 1: rpm-ivh scsi-target-utils-1.0.38-48.bf6981.ceph.el6.x86_64.rpm (this is not recommended when the server has a network connection)

Mode 1 dependencies required during installation

Boost-iostreams.x86_64 0RO 1.53.0-27.el7 boost-random.x86_64 0RO 1.53.0-27.el7

Boost-system.x86_64 0RO 1.53.0-27.el7 boost-thread.x86_64 0RO 1.53.0-27.el7

Libibverbs.x86_64 0:13-7.el7 librados2.x86_64 1purl 10.2.10-0.el7

Librbd1.x86_64 1VR 10.2.10-0.el7 librdmacm.x86_64 0:13-7.el7

Lsof.x86_64 0VOR 4.87-4.el7 lttng-ust.x86_64 0RU 2.4.1-4.el7

Perl.x86_64 4RV 5.16.3-292.el7 perl-Carp.noarch 0RU 1.26-244.el7

Perl-Config-General.noarch 0VOR 2.61-1.el7 perl-Encode.x86_64 0RU 2.51-7.el7

Perl-Exporter.noarch 0VOR 5.68-3.el7 perl-File-Path.noarch 0RU 2.09-2.el7

Perl-File-Temp.noarch 0RO 0.23.01-3.el7 perl-Filter.x86_64 0RO 1.49-3.el7

Perl-Getopt-Long.noarch 0VOR 2.40-2.el7 perl-HTTP-Tiny.noarch 0RU 0.033-3.el7

Perl-PathTools.x86_64 0VOR 3.40-5.el7 perl-Pod-Escapes.noarch 1RU 1.04-292.el7

Perl-Pod-Perldoc.noarch 0VOR 3.20-4.el7 perl-Pod-Simple.noarch 1RU 3.28-4.el7

Perl-Pod-Usage.noarch 0VOR 1.63-3.el7 perl-Scalar-List-Utils.x86_64 0RU 1.27-248.el7

Perl-Socket.x86_64 0VOR 2.010-4.el7 perl-Storable.x86_64 0RU 2.45-3.el7

Perl-Text-ParseWords.noarch 0VOR 3.29-4.el7 perl-Time-HiRes.x86_64 4RU 1.9725-3.el7

Perl-Time-Local.noarch 0vl 1.2300-2.el7 perl-constant.noarch 0vl 1.27-2.el7

Perl-libs.x86_64 4rig 5.16.3-292.el7 perl-macros.x86_64 4rig 5.16.3-292.el7

Perl-parent.noarch 1RO 0.225-244.el7 perl-podlators.noarch 0RO 2.5.1-3.el7

Perl-threads.x86_64 0VOR 1.87-4.el7 perl-threads-shared.x86_64 0RU 1.43-6.el7

Sg3_utils.x86_64 0VOR 1.37-12.el7 sg3_utils-libs.x86_64 0RU 1.37-12.el7

Userspace-rcu.x86_64 0RO 0.7.16-1.el7

Method 2: yum isntall scsi-target-utils-1.0.38-48.bf6981.ceph.el6.x86_64.rpm (this method is recommended when the server has a network connection, which will automatically resolve dependencies)

3. Enable tgt service

Systemctl enable tgtd.service

Systemctl start tgtd.service

Enable the scsi-target-utils service

Service tgtd start or systemctl start tgtd

Boot self-starting scsi-target-utils service

Chconfig tgtd on

Check to see if scsi-target-utils is started

Netstat-anltp | grep 3260

4. Verify that tgt supports rbd

Tgtadm-- lld iscsi-- mode system-- op show | grep rbd

It is recommended to use the website provided by download method 2 and use version 1.0.38 to verify that rbd is supported.

5. Create iscsi target

Create storage pools and rbd mirrors

Ceph osd pool create iscsi-pool 192 (it is recommended that you use the rbd ls-p iscsipool command to see if the creation is successful before performing the next step)

Rbd create iscsipool/image01-size 10240

Note: the cluster used in this example is a mon node and a ceph cluster with three osd nodes. The PGS value is 192. The specific implementation is based on the number of osd nodes.

The created mirror capacity is 10G (if the creation fails, use the command ceph osd pool delete iscsipool iscsipool-- yes-i-really-really-mean-it to delete the created pool, where iSCSIpool is the name of the pool I created)

After the image is created successfully, the ceph cluster will experience an unhealthy condition, and will gradually return to a healthy state if there is no pgs error.

6. Modify the configuration file

Vi / etc/tgt/targets.conf

Add the following configuration

Driver iscsi

Bs-type rbd

Backing-store iscsi-pool/image01

Or create a conf.d directory under the / etc/tgt directory and a configuration file with the suffix .conf under the conf.d directory. The example of writing is as follows

Driver iscsi

Bs-type rbd

Backing-store iscsi-pool/image01

7. Restart the target service

Systemctl restart tgtd.service

8. View the created scsi target

Tgtadm-lld iscsi-mode target-op show

You can see that the created lun1 indicates success.

9. Use the client to validate the iSCSI service

Control Panel-> Administrative tools-> iSCSI initiator-> enter the ip address of the server providing iSCSI services in the target-> Click Quick Connect

If the prompt is not active, click the connection button in the lower left corner.

Linux client configuration: 1. Configure the extension source, the source in 1511 does not contain the installation package for iscsi-initiator-utils

Yum install-y epel-release

Yum install-y iscsi-initiator-utils

two。 Discover the target device

Iscsiadm-m discovery-t sendtargets-p 192.168.1.111

3. Mount the target device

Iscsiadm-m node-T 192.168.1.111:iscsi-l

4. Uninstall the target device

Iscsiadm-m node-T 192.168.1.109:iscsi-u

After reading this article, I believe you have a certain understanding of "how to configure iSCSI transmission service based on ceph cluster". If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report