Iscsi can be stored Based on raid or image storage
Image Storage: dd If =/dev/Zero of =/Zou. img bs = 1000 k count = 20000 then a 2 GB image storage disk will be generated under the root directory. Here, how to generate raid will not be mentioned first
The operating environment is On Debian. This server acts as a disk array system and has RAID (Level 5) and Image Storage Zou. IMG.
Install aptitude install iscsitarget-dkms-y
Modify the file Vim/etc/default/iscsitarget iscsitarget_enable = true
Modify the vim/etc/Iet/ietd. conf file (the content is as follows. If there are several iSCSI files, write the following parts)
Target iqn.2014-10.com. Zou: storage. lun1
# Incominguser someuser secret
Outgoinguser
Lun 0 Path =/dev/md127, type = fileio
Alias lun1
# Maxconnections 6
Target iqn.2014-10.com. Zou: storage. lun2
# Incominguser someuser secret
Lun 0 Path =/Zou. IMG, type = fileio
Alias lun2
# Maxconnections 6
Modify the file Vim/etc/Iet/initiators. Allow
Add comment # All
Iqn.2014-10.com. Zou: storage. lun1 192.168.200.125
Iqn.2014-10.com. Zou: storage. lun2 192.168.200.125 of course can also write multiple IP addresses, or even a network segment to make the disk array configured more secure can set Firewall
Iphonetables-I input! -S 192.168.200.0/24-p tcp -- dport 3206-J Drop
Restart the service/etc/init. d/iscsitarget restart
1. Test on ipvs7:
Open the control panel, Administrative Tools, iSCSI detection tools, and enter the Server IP address to detect. Then, go to "disk management" in Computer Management, create a partition, format, and use
2. Test on rhel6.2:
Yum install iscsi-initiatorutils.x86_64 install client Tool
Echo "initiator alias = lun1">/etc/iSCSI/initiatorname. iSCSI
Test the iscsiadm-M discovery-T sendtargets-P 192.168.200.125 server provided by the server.
When detected, you want to view the information iscsiadm-M node-T iqn.2014-10.com. Zou: storage. lun2
Use the device iscsidm-M node-L to create a partition fdisk for the device.
After creating a partition, format mkfs. ext4, dev/sdb1
Mount with Mount/dev/sdb1/mnt
If you do not need to use iscsidm-M node-u, you can remove the iscsidm-M node-u before detaching the disk.
View the link status iscsidm-M node-S
Supplement: If RHEL is used as the iSCSI server, perform the following operations:
Yum install-y iscsi-target-utils.x86_64
Vim/etc/TGT/targets. conf
<Target iqn.2014-10.com. Zou: iSCSI>
Backing-store/dev/md127
</Target>
Restart service
Start chkconfig tgtd on permanently
If you want to specify the IP range, configure it in targets. conf.
Initiator-Ah dress192.168.200.125 specifies the IP address that can be accessed
Incominguser Zou 123.com
To view the output, run TGT-admin-s.
This article is from the "Arctic Linux" blog, please be sure to keep this source http://941012521.blog.51cto.com/9253690/1560617
High-availability cluster iSCSI Storage