24.16.3. iSCSI Root
When accessing the root partition directly through an iSCSI disk, the iSCSI timers should be set so that iSCSI layer has several chances to try to reestablish a path/session. In addition, commands should not be quickly re-queued to the SCSI layer. This is the opposite of what should be done when dm-multipath is implemented.
To start with, NOP-Outs should be disabled. You can do this by setting both NOP-Out interval and timeout to zero. To set this, open /etc/iscsi/iscsid.conf and edit as follows:
node.conn[0].timeo.noop_out_interval = 0
node.conn[0].timeo.noop_out_timeout = 0
In line with this, replacement_timeout should be set to a high number. This will instruct the system to wait a long time for a path/session to reestablish itself. To adjust replacement_timeout, open /etc/iscsi/iscsid.conf and edit the following line:
node.session.timeo.replacement_timeout = replacement_timeout
After configuring /etc/iscsi/iscsid.conf, you must perform a re-discovery of the affected storage. This will allow the system to load and use any new values in /etc/iscsi/iscsid.conf. For more information on how to discover iSCSI devices, refer to Section 24.12, “ Scanning iSCSI Interconnects”.
Configuring Timeouts for a Specific Session
You can also configure timeouts for a specific session and make them non-persistent (instead of using/etc/iscsi/iscsid.conf). To do so, run the following command (replace the variables accordingly):
# iscsiadm -m node -T target_name -p target_IP:port -o update -n node.session.timeo.replacement_timeout -v $timeout_value
24.16.3. iSCSI Root
当直接通过一个ISCSI磁盘访问根分区的时候,iSCSI计时器应该被设置,以便iSCSI层有足够的时间重建会话/路径。此外,命令不应过快在SCSI层重排。这个是对立的,当实施多路径的时候应该被完成。
首先,NOP-Outs应该被禁用。你可以通过NOP-Out间隔和超时设置为零。设置这个打开/etc/iscsi/iscsid.conf编辑修改参数如下:
node.conn[0].timeo.noop_out_interval = 0
node.conn[0].timeo.noop_out_timeout = 0
以上修改之后,replacement_timeout应该设置为高的数字。这将指示系统等很长时间让会话/路径重建自己的连接。调整replacement_timeout,打开/etc/iscsi/iscsid.conf编辑以下行:
node.session.timeo.replacement_timeout = 替换的时间(默认是120,我改为2000)
在配置/etc/iscsi/iscsid.config之后,你必须执重新读取配置命令,去实时生效。让系统使用新配置的数值。
为一个单独的会话设置超时:
你还可以为特定的会话设置超时,让他们非持久性(而不是使用/ etc / iscsi / iscsid.conf的配置)。为此,运行以下命令(替换相应的变量):
# iscsiadm -m node -T target_name -p target_IP:port -o update -n node.session.timeo.replacement_timeout -v $timeout_value
service tgtd restart
service iscsi restart
service netfs restart
service iscsid restart
译自:http://blog.csdn.net/hshl1214/article/details/7624005