下面为转载内容,当时客户端连不上iscsi服务器,查了好多文章都是说认证没匹配,但是我的认证是匹配的,最后找到这个才发现我修改完客户端配置之后原来的缓存没删,导致一直登陆不了。
[root@server ~]# iscsiadm -m node -T iqn.2017-12.com.example.storage1 -p 172.25.254.156 -l
Logging in to [iface: default, target: iqn.2017-12.com.example.storage1, portal: 172.25.254.156,3260] (multiple)
iscsiadm: Could not login to [iface: default, target: iqn.2017-12.com.example.storage1, portal: 172.25.254.10,3260].
iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure)
iscsiadm: Could not log into all portals
解决方法:
1)检查钥匙是否正确
vim /etc/iscsi/initiatorname.iscsi
若是修改了文件,需要重启服务
[root@server ~]# systemctl restart iscsid
[root@server ~]# systemctl restart iscsi
2)删除所有文件,重新发现
[root@server ~]# yum install tree
[root@server ~]# tree /var/lib/iscsi/
/var/lib/iscsi/
├── ifaces
├── isns
├── nodes
│ └── iqn.2017-12.com.example.storage1
│ └── 172.25.254.156,3260,1
│ └── default
├── send_targets
│ └── 172.25.254.156,3260
│ ├── iqn.2017-12.com.example.storage1,172.25.254.156,3260,1,default -> /var/lib/iscsi/nodes/iqn.2017-12.com.example.storage1/172.25.254.156,3260,1
│ └── st_config
├── slp
└── static
[root@server ~]# rm -rf /var/lib/iscsi/nodes/*
[root@server ~]# rm -rf /var/lib/iscsi/send_targets/*
[root@server ~]# tree /var/lib/iscsi/
/var/lib/iscsi/
├── ifaces
├── isns
├── nodes
├── send_targets
├── slp
└── static
[root@server ~]# iscsiadm -m discovery -t st -p 172.25.254.156
[root@server ~]# iscsiadm -m node -T iqn.2017-12.com.example.storage1 -p 172.25.254.10 -l
---------------------
作者:袁湘琴钟意江直树
来源:CSDN
原文:https://blog.csdn.net/qq_40385970/article/details/78786023