版本:
[root@node2 ~]# cat /proc/version
Linux version 2.6.32-220.el6.x86_64 ([email protected]) (gcc version 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC) ) #1 SMP Wed Nov 9 08:03:13 EST 2011
[root@node2 ~]#
最近碰到了点小麻烦,修改了/etc/iscsi/iscsid.conf里面的timeout参数,但是重启iscsi确不能使之生效。
修改过的配置文件与当前生效参数:
[root@node2 iscsi]# grep -i timeout /etc/iscsi/iscsid.conf | grep -v '#'
node.session.timeo.replacement_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.noop_out_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
[root@node2 iscsi]# iscsiadm -m session -P3 | grep -i timeout
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 5
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 5
重启iscsi依然不能使修改生效:
[root@node2 iscsi]# /etc/init.d/iscsi restart
Stopping iscsi: [ OK ]
Starting iscsi: [ OK ]
[root@node2 iscsi]# iscsiadm -m session -P3 | grep -i timeout
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 5
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 5
原来客户端配置文件iscsid.conf的参数只在discovery的时候才被读取,如果没在discovery之前改好配置文件,要使配置文件里的参数生效就只能重新discovery一遍了。
删除discovery并重新discovery,这里一个target之所以有两个portal是因为启用了多路径multipath:
[root@node2 iscsi]# iscsiadm -m discovery -P3
SENDTARGETS:
DiscoveryAddress: 172.18.20.4,3260
Target: iqn.2012-04.com.example.cluster20:clusterstorage
Portal: 172.18.20.4:3260,1
Iface Name: default
DiscoveryAddress: 172.19.20.4,3260
Target: iqn.2012-04.com.example.cluster20:clusterstorage
Portal: 172.19.20.4:3260,1
Iface Name: default
DiscoveryAddress: 172.17.20.4,3260
iSNS:
No targets found.
STATIC:
No targets found.
FIRMWARE:
No targets found.
[root@node2 iscsi]# iscsiadm -m discovery -p 172.18.20.4 -o delete
[root@node2 iscsi]# iscsiadm -m discovery -p 172.19.20.4 -o delete
[root@node2 iscsi]# iscsiadm -m discovery -P3
SENDTARGETS:
DiscoveryAddress: 172.17.20.4,3260
iSNS:
No targets found.
STATIC:
No targets found.
FIRMWARE:
No targets found.
[root@node2 iscsi]# iscsiadm -m discovery -p 172.17.20.4 -o delete #这个是没有target的portal,为了整洁一起删掉
[root@node2 iscsi]# iscsiadm -m discovery -P3
SENDTARGETS:
No targets found.
iSNS:
No targets found.
STATIC:
No targets found.
FIRMWARE:
No targets found.
[root@node2 iscsi]# iscsiadm -m discovery -t sendtargets -p 172.18.20.4
172.18.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
[root@node2 iscsi]# iscsiadm -m discovery -t sendtargets -p 172.19.20.4
172.19.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
[root@node2 iscsi]# iscsiadm -m discovery -P3
SENDTARGETS:
DiscoveryAddress: 172.18.20.4,3260
Target: iqn.2012-04.com.example.cluster20:clusterstorage
Portal: 172.18.20.4:3260,1
Iface Name: default
DiscoveryAddress: 172.19.20.4,3260
Target: iqn.2012-04.com.example.cluster20:clusterstorage
Portal: 172.19.20.4:3260,1
Iface Name: default
iSNS:
No targets found.
STATIC:
No targets found.
FIRMWARE:
No targets found.
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage -l
node列出的参数已经生效了,但是session参数还是没变,原因是session没有重新login:
[root@node2 iscsi]# iscsiadm -m session -P3 | grep -i timeout
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
Timeouts:
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout
node.session.timeo.replacement_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 2
node.session.timeo.replacement_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 2
session重新login后,参数也生效了:
[root@node2 iscsi]# iscsiadm -m session -P0
tcp: [7] 172.19.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
tcp: [8] 172.18.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage -u
Logging out of session [sid: 7, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.19.20.4,3260]
Logging out of session [sid: 8, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.18.20.4,3260]
Logout of [sid: 7, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.19.20.4,3260] successful.
Logout of [sid: 8, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.18.20.4,3260] successful.
[root@node2 iscsi]# iscsiadm -m session -P0
iscsiadm: No active sessions.
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage -l
Logging in to [iface: default, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.19.20.4,3260] (multiple)
Logging in to [iface: default, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.18.20.4,3260] (multiple)
Login to [iface: default, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.19.20.4,3260] successful.
Login to [iface: default, target: iqn.2012-04.com.example.cluster20:clusterstorage, portal: 172.18.20.4,3260] successful.
[root@node2 iscsi]# iscsiadm -m session -P0
tcp: [10] 172.18.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
tcp: [9] 172.19.20.4:3260,1 iqn.2012-04.com.example.cluster20:clusterstorage
[root@node2 iscsi]# iscsiadm -m session -P3 | grep -i timeout
Timeouts:
Recovery Timeout: 2
Target Reset Timeout: 2
LUN Reset Timeout: 2
Abort Timeout: 2
Timeouts:
Recovery Timeout: 2
Target Reset Timeout: 2
LUN Reset Timeout: 2
Abort Timeout: 2
[root@node2 iscsi]# iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout
node.session.timeo.replacement_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 2
node.session.timeo.replacement_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
node.session.err_timeo.host_reset_timeout = 60
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_timeout = 2
[root@node2 iscsi]#
单独命令列表:
grep -i timeout /etc/iscsi/iscsid.conf | grep -v '#' iscsiadm -m session -P3 | grep -i timeout iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout /etc/init.d/iscsi restart iscsiadm -m session -P3 | grep -i timeout iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout iscsiadm -m discovery -P3 iscsiadm -m discovery -p 172.18.20.4 -o delete iscsiadm -m discovery -p 172.19.20.4 -o delete iscsiadm -m discovery -P3 iscsiadm -m discovery -t sendtargets -p 172.18.20.4 iscsiadm -m discovery -t sendtargets -p 172.19.20.4 iscsiadm -m discovery -P3 iscsiadm -m session -P0 iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage -u iscsiadm -m session -P0 iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage -l iscsiadm -m session -P0 iscsiadm -m session -P3 | grep -i timeout iscsiadm -m node -T iqn.2012-04.com.example.cluster20:clusterstorage | grep timeout
REF:
1. Timeout settings not working?
https://groups.google.com/forum/?fromgroups#!topic/open-iscsi/MsWY7N5s55g