Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux:iSCSI client scan failed to discover iSCSI server problem

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Configure environment information:

Redhat7 target:192.168.23.10

Redhat7 initiator:192.168.23.20

Windows10 initiator:192.168.23.1

Problem: in 192.168.23.20 client scanning server, no resources were found.

Step 1: check the network connectivity, the network is normal.

Step 2: check that the client name written in the initiator file is consistent with the parameter acls in the target directory

[root@client Desktop] # cat / etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee:client

O-iscsi. [Targets: 1]

| | o-iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee... [TPGs: 1]

| o-tpg1. [no-gen-acls, no-auth]

| o-acls. [ACLs: 1]

| | o-iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee:client. | [Mapped LUNs: 1]

The results of the examination are consistent!

Step 3: check the service status of initiator

[root@client Desktop] # systemctl restart iscsid

[root@client Desktop] # systemctl status iscsid

Iscsid.service-Open-iSCSI

Loaded: loaded (/ usr/lib/systemd/system/iscsid.service; enabled)

Active: active (running) since Fri 2020-02-07 08:42:17 EST; 10s ago

Docs: man:iscsid (8)

Man:iscsiadm (8)

Process: 3950 ExecStop=/sbin/iscsiadm-k 0 2 (code=exited, status=0/SUCCESS)

Process: 3955 ExecStart=/usr/sbin/iscsid (code=exited, status=0/SUCCESS)

Main PID: 3957 (iscsid)

CGroup: / system.slice/iscsid.service

├─ 3956 / usr/sbin/iscsid

└─ 3957 / usr/sbin/iscsid

Feb 07 08:42:17 client systemd [1]: Starting Open-iSCSI...

Feb 07 08:42:17 client systemd [1]: Failed to read PID from file / var/run/iscsid.pid: Invali...ment

Feb 07 08:42:17 client iscsid [3956]: iSCSI daemon with pid=3957 started!

Feb 07 08:42:17 client systemd [1]: Started Open-iSCSI.

Hint: Some lines were ellipsized, use-l to show in full.

The results of the check show that it is running normally!

Step 4: check the service status of target

[root@localhost Desktop] # systemctl status targetd

Targetd.service-targetd storage array API daemon

Loaded: loaded (/ usr/lib/systemd/system/targetd.service; enabled)

Active: failed (Result: exit-code) since Fri 2020-02-07 07:45:27 EST; 11s ago

Process: 3597 ExecStart=/usr/bin/targetd (code=exited, status=255)

Main PID: 3597 (code=exited, status=255)

Feb 07 07:45:27 localhost.localdomain systemd [1]: Starting targetd storage array API daemon...

Feb 07 07:45:27 localhost.localdomain systemd [1]: Started targetd storage array API daemon.

Feb 07 07:45:27 localhost.localdomain targetd [3597]: CRITICAL:root:password not set in / etc/target/targetd.yaml

Feb 07 07:45:27 localhost.localdomain systemd [1]: targetd.service: main process exited, code=exited, status=255/n/a

Feb 07 07:45:27 localhost.localdomain systemd [1]: Unit targetd.service entered failed state.

An error was reported when the iSCSI service ran, "CRITICAL:root:password not set in / etc/target/targetd.yaml".

Check the file / etc/target/targetd.yaml, search the Internet for the relevant configuration documents of the file, failed, and need to be supplemented later.

I tried to match myself, but it didn't work.

At this time, based on the existing information, it is impossible to tell whether my iSCSI target is configured properly.

However, according to a document on the network, the error does not affect the normal use of the service, and initiator can still find target.

Step 5: Windows customers are trying to scan iSCSI shared resources, but failed, no search was found.

At this point, you can basically judge that there is something wrong with my iSCSI target configuration and list all the directories of target for inspection.

[root@localhost Desktop] # targetcli

Targetcli shell version 2.1.fb34

Copyright 2011-2013 by Datera, Inc and others.

For help on commands, type 'help'.

/ > ls

O-/. [...]

O-backstores. [...]

| o-block. [Storage Objects: 1]

| | o-desk0. | [/ dev/md0 (40.0GiB) write-thru activated]

| o-fileio. [Storage Objects: 0]

| o-pscsi. [Storage Objects: 0]

| o-ramdisk. [Storage Objects: 0]

O-iscsi. [Targets: 1]

| | o-iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee... [TPGs: 1]

| o-tpg1. [no-gen-acls, no-auth]

| o-acls. [ACLs: 1]

| | o-iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee:client. | [Mapped LUNs: 1]

| | o-mapped_lun0. | [lun0 block/desk0 (rw)]

| o-luns. [LUNs: 1]

| | o-lun0. | [block/desk0 (/ dev/md0)]

| o-portals. [Portals: 1]

| o-192.168.23.20 purl 3260. [OK]

O-loopback. [Targets: 0]

Check line by line, the problem is found, the address of the network card that provides access to the shared resources is written wrong, the correct address should be 192.168.23.10.

Step 6: modify the correct TCP/IP address.

Commands can be deleted through help.

/ iscsi/iqn.20.../tpg1/portals > help

GENERALITIES outline

Commands are built using the following syntax:

[TARGET_PATH] COMMAND_NAME [OPTIONS]

The TARGET_PATH indicates the path to run the command from.

If ommited, the command will be run from your current path.

The OPTIONS depend on the command. Please use help

COMMAND to get more information.

AVAILABLE COMMANDS

The following commands are available in the

Current path:

Bookmarks action [bookmark] cd [path] create [ip_address] [ip_port] delete ip_address ip_portexitget [group] [parameter...] help [topic] ls [path] [depth] pwdrefreshset [group] [parameter=value...] status

Delete the wrong TCP/IP message:

/ iscsi/iqn.20.../tpg1/portals > delete 192.168.23.20 3260

Deleted network portal 192.168.23.20:3260

Add the correct TCP/IP information:

/ iscsi/iqn.20.../tpg1/portals > create 192.168.23.10

Using default IP port 3260

Created network portal 192.168.23.10:3260.

Restart the service and initiator tries to scan again.

[root@client Desktop] # iscsiadm-m discovery-t sendtargets-p 192.168.23.10

192.168.23.10 Phantom 3260 iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.3c9133ae8aee

To sum up, targetd.yaml 's preservation of root password does not affect the normal operation of iSCSI services.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report