Set the following configuration for all nodes in which the mirroring function among servers is used.
The "current node" in the following procedure indicates: node 1 if you execute the procedure on the node 1; node 2 if you execute the procedure on the node 2.
Add the iSCSI target setting to the /etc/tgt/targets.conf file.
Add the following content.
<target targetname> initiator-address IPaddress1 initiator-address IPaddress2 write-cache off <backing-store by-id> lun LUN scsi_id SCSI-ID </backing-store> </target> |
Point
For targetname, describe the target name of the current node.
Specify the unique string of characters (up to 255 characters) in the cluster system.
For IPaddress1, describe the IP address for the mirroring among servers on node 1. The IPv4 address or the IPv6 address can be set.
For IPaddress2, describe the IP address for the mirroring among servers on node 2. The IPv4 address or the IPv6 address can be set.
Set all the IP addresses used for the mirroring among servers as the initiator-address.
For by-id, describe the path of the by-id file stored in a disk on the current node which performs mirroring among servers.
For LUN, describe the LUN number for the iSCSI device of the disk specified by by-id.
Specify the unique string of characters in the iSCSI target (in <target targetname> ... </target>).
For SCSI-ID, describe the SCSI ID of the iSCSI device with which by-id specifies.
Specify the unique number in the cluster system.
If the current node has multiple disks on which the mirroring among servers is performed, describe four lines starting from <backing-store by-id> to </backing-store> for each disk.
Description example (node 1)
<target target-0101> initiator-address 192.168.56.20 initiator-address 192.168.56.10 write-cache off <backing-store /dev/disk/by-id/scsi-3500000e111c56610> lun 1 scsi_id SDX01 </backing-store> </target> |
Description example (node 2)
<target target-0201> initiator-address 192.168.56.20 initiator-address 192.168.56.10 write-cache off <backing-store /dev/disk/by-id/scsi-3500000e114784360> lun 1 scsi_id SDX02 </backing-store> </target> |
Restart the SCSI target daemon (tgtd).
# service tgtd restart
Stopping SCSI target daemon: [ OK ]
Starting SCSI target daemon: [ OK ] |
If the SCSI target daemon (tgtd) is not started, the following message will be output.
Stopping SCSI target daemon: not running [FAILED] |
Then, if the following message is output, there is no problem.
Starting SCSI target daemon: [ OK ] |