ISCSI
From ISPWiki
Contents |
Introduction
ISCSI is a client-server application for linking data storage facilities over the network. As a result, SCSI device is emulated.
We recommend that you use iscsitarget application as server and open-iscsi as client under Linux.
iscsitarget
The application configuration file is located in /etc/ietd.conf. It contains description of disks to be distributed. Each disk is a Target section with parameters. The format is as follows:
Target unique.disk.name.that.other.machines.will.know.
Lun 0 Path=/dev/device
IncomingUser login password
OutcomingUser login password
# and other parameters, see man ietd.conf
You can locate the authorization fields at the top of the file not to describe them for each device. Example:
IncomingUser user password
OutgoingUser user password
Target iqn.2009-03.cluster-n3.cluster.com:storage.disk1
Lun 0 Path=/dev/sdb
open-iscsi
Main configuration file
/etc/iscsi/iscsid.conf file. Following are the most important parameters:
# enable CHAP authorization discovery.sendtargets.auth.authmethod = CHAP # client side authorization login discovery.sendtargets.auth.username = user # client side authorization login discovery.sendtargets.auth.password = password # response timeout from the remote side (in sec) node.session.timeo.replacement_timeout = 600
node.session.timeo.replacement_timeout
Consider the last example. If the iSCSI-client discovers that the server distributing devices does not reply, it will wait for reply for the specified number of seconds. If the server does not reply within specified 600 seconds, the iSCSI client returns a disk error message to the applications that use this device.
Disk configuration files
Each connected remote disk has its own configuration file located in /etc/iscsi/nodes/remote.device.name/IP,port,1/default. It is created automatically from the main configuration file (all the values are taken from that file). Following is the main parameter:
node.startup = automatic
In our case disks must connect automatically.
Connecting disks
You can use a iscsiadm utility to manage connected disks. Once you have configured the main configuration file, you need to obtain information about devices from each machine which disks you want to use. Execute the command below for each machine:
iscsiadm -m discovery -t sendtargets -p IP_address_OF_MACHINE_WITH_DISK-o update
The configuration files for each disk will appear in /etc/iscsi/nodes. You need to specify the automatic start mode in these files (see description above), if it was not specified in the main configuration file. Then you need to get authorized (in future, you will be authorized automatically when the system starts):
iscsiadm -m node -l
Now you have several devices /dev/sdXXX (normally /dev/sda is an existing local disk)
