在 /etc/tgt/targets.conf 中添加新磁盘并重新加载,而不影响其他磁盘/启动器主机

在 /etc/tgt/targets.conf 中添加新磁盘并重新加载,而不影响其他磁盘/启动器主机

我已向服务器添加了一个新磁盘:

[root@ns1 tgt]# lsblk |grep sdh
sdh           8:112  0  600M  0 disk

/dev/sdh此外,我还为in创建了一个新条目/etc/tgt/targets.conf

[root@ns1 tgt]# cat /etc/tgt/targets.conf |grep /dev/
                                         direct-store /dev/sdb
                                         direct-store /dev/sdc
                                         direct-store /dev/sdd
                                         direct-store /dev/sde
                                         direct-store /dev/sdf
                                         direct-store /dev/sdg
                                         direct-store /dev/sdh
[root@ns1 tgt]#

如何重新加载新配置并使新 lun 可用?我已经尝试过,systemctl reload tgtd但没有成功。下面我们可以看到还没有。tgt-admin -etgt-admin --ready ALL/dev/sdh

[root@ns1 tgt]# tgtadm --mode target --op show|grep /dev/
            Backing store path: /dev/sdb
            Backing store path: /dev/sdc
            Backing store path: /dev/sdd
            Backing store path: /dev/sde
            Backing store path: /dev/sdf
            Backing store path: /dev/sdg
[root@ns1 tgt]#

我已经测试过systemctl restart tgtd并且它有效,但它会影响启动器主机。即重新启动后tgtd(来自某些启动器主机的日志):

Jun  6 18:20:41 rac1 kernel: connection1:0: detected conn error (1020)
Jun  6 18:20:41 rac1 iscsid: iscsid: Kernel reported iSCSI connection 1:0 error (1020 - ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (3)
Jun  6 18:20:43 rac1 iscsid: iscsid: Kernel reported iSCSI connection 1:0 error (1020 - ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (2)
Jun  6 18:20:43 rac1 kernel: connection1:0: detected conn error (1020)
Jun  6 18:20:45 rac1 kernel: connection1:0: detected conn error (1020)
Jun  6 18:20:45 rac1 iscsid: iscsid: Kernel reported iSCSI connection 1:0 error (1020 - ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (2)
Jun  6 18:20:46 rac1 kernel: session1: session recovery timed out after 5 secs
Jun  6 18:20:47 rac1 multipathd: checker failed path 8:112 in map data1
Jun  6 18:20:47 rac1 multipathd: data1: remaining active paths: 0
Jun  6 18:20:47 rac1 kernel: device-mapper: multipath: Failing path 8:112.
Jun  6 18:20:47 rac1 kernel: device-mapper: multipath: Failing path 8:80.
Jun  6 18:20:47 rac1 kernel: device-mapper: multipath: Failing path 8:96.
Jun  6 18:20:47 rac1 multipathd: checker failed path 8:80 in map fra2
Jun  6 18:20:47 rac1 multipathd: fra2: remaining active paths: 0
Jun  6 18:20:47 rac1 multipathd: checker failed path 8:96 in map fra3
Jun  6 18:20:47 rac1 multipathd: fra3: remaining active paths: 0
Jun  6 18:20:47 rac1 iscsid: iscsid: Kernel reported iSCSI connection 1:0 error (1020 - ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (2)
Jun  6 18:20:47 rac1 kernel: connection1:0: detected conn error (1020)
Jun  6 18:20:49 rac1 iscsid: iscsid: connection1:0 is operational after recovery (4 attempts)

答案1

您是否尝试过指定配置文件?例如

tgt-admin --update ALL -c /etc/tgt/targets.conf

我还在我的服务器日志(49 个目标)中注意到 systemd 在启动时超时,导致状态不一致。创建/etc/systemd/system/tgt.service.d/extend-timeout.conf这样允许干净启动:

[Service]
TimeoutStartSec=5m

旁白:bs-type aioLUN 也有助于缩短启动时间。

相关内容