Set up iscsi storage in Centos6.5

Source: Internet
Author: User

Set up iscsi storage in Centos6.5

To build a vsphere environment, you need to use network storage to simulate applications in the production environment. Now, a 800 GB hard drive server is configured as iscsi storage.

The iscsi server is as follows:

Ip: 10.11.68.10

Hard Disk: in addition to basic server applications, GB is used for storage. Thanks to the lvm, we can directly create a logical volume.

[Html] view plaincopy
  1. [Root @ iscsi10 ~] # Vgs
  2. VG # PV # LV # SNAttrVSizeVFree
  3. Vg_iscsi10110wz -- n-808.45g730.32g

Lvcreate-L 500G-n iscsi_test vg_iscsi10

In this way, the iscsi storage space is available. Let's configure the storage.

1. Install scsi-target-utils on the server

Yum instal scsi-target-utils-y

2. Configure the storage device

[Html] view plaincopy
  1. [Root @ iscsi10 ~] # Vim/etc/tgt/targets. conf
  2. Targetiqn.2008-09.com. example: iscsidisk>
  3. Backing-store/dev/vg_iscsi10/iscsi_test
  4. Initiator-address10.11.68.11
  5. Initiator-address10.11.68.12
  6. Initiator-address10.11.68.13
  7. </Target>
The target definition format is as follows:

Iqn. yyyy-mm. <reversed domain name>: target_name

Backing-store: virtual device. This parameter is generally used preferentially.

Direct-store: the actual device. The entire disk is used for iscsi devices.

Initiator-address: used to restrict client sources using this target

Incominguser: the client can use the user name and password for storage.

After startup, you can check whether the storage has been allocated.

Service tgtd start

[Html] view plaincopy
  1. [Root @ iscsi10 ~] # Tgt-admin-s
  2. Target1: iqn.2008-09.com. example: iscsidisk
  3. Systeminformation:
  4. Driver: iscsi
  5. State: ready
  6. I _Tnexusinformation:
  7. LUNinformation:
  8. LUN: 0
  9. Type: controller
  10. SCSIID: IET00010000
  11. SCSISN: beaf10
  12. Size: 0 MB, Blocksize: 1
  13. Online: Yes
  14. Removablemedia: No
  15. Preventremoval: No
  16. Readonly: No
  17. Backingstoretype: null
  18. Backingstorepath: None
  19. Backingstoreflags:
  20. LUN: 1
  21. Type: disk
  22. SCSIID: IET00010001
  23. SCSISN: beaf11
  24. Size: 536871 MB, Blocksize: 512
  25. Online: Yes
  26. Removablemedia: No
  27. Preventremoval: No
  28. Readonly: No
  29. Backingstoretype: rdwr
  30. Backingstorepath:/dev/vg_iscsi10/iscsi_test
  31. Backingstoreflags:
  32. Accountinformation:
  33. ACLinformation:
  34. 10.11.68.11
  35. 10.11.68.12
  36. 10.11.68.13

3. Add the boot item

Chkconfig tgtd on

4. If the server has firewall settings, open the corresponding port. The iscsi port is 3260.

Iptables-a input-p tcp-s 10.0.0.0/8 -- dport 3260-j ACCEPT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.