欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos 8.1存储多路径配置

程序员文章站 2022-06-01 10:29:28
...

系统环境 centos 8.1
服务器环境 戴尔R740服务器 2张12GB sas HBA卡
存储环境 DELL ME4084存储
阵列环境 5个RAID6 每个raid6由16个8TB硬盘组成
硬盘环境 84个8TB硬盘

系统安装 忽略
存储配置
1.本地网卡配置为 10.0.0.22
2. 通过管理口 10.0.0.2登录
3. 第一次登录需要设置用户名和密码 这里设置为admin1 密码[email protected]
4. 首选设置raid,这里设置为5个raid6
5. 然后建立映射
6.登录centos系统配置
7.查看磁盘状态

[[email protected] ~]# fdisk -l
Disk /dev/sda: 446.6 GiB, 479559942144 bytes, 936640512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x1e02e144

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 697565183 697563136 332.6G 83 Linux
/dev/sda2       697565184 831782911 134217728    64G 82 Linux swap / Solaris
/dev/sda3       831782912 936640511 104857600    50G 83 Linux
[[email protected] ~]# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 446.6G  0 disk 
├─sda1   8:1    0 332.6G  0 part /
├─sda2   8:2    0    64G  0 part [SWAP]
└─sda3   8:3    0    50G  0 part /var

8.未发现磁盘,看看fba卡是是否识别

[[email protected] ~]# lspci
00:00.0 Host bridge: Intel Corporation Sky Lake-E DMI3 Registers (rev 07)
00:05.0 System peripheral: Intel Corporation Sky Lake-E MM/Vt-d Configuration Registers (rev 07)
af:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS3008 PCI-Express Fusion-MPT SAS-3 (rev 02)
d7:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 07)
d7:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 07)
d7:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 07)
d7:0e.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 07)

[[email protected] ~]# cat /proc/scsi/scsi 
Attached devices:
Host: scsi0 Channel: 02 Id: 00 Lun: 00
  Vendor: DELL     Model: PERC H730P Adp   Rev: 4.30
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi7 Channel: 00 Id: 00 Lun: 00
  Vendor: DellEMC  Model: ME4              Rev: G280
  Type:   Enclosure                        ANSI  SCSI revision: 06
Host: scsi7 Channel: 00 Id: 01 Lun: 00
  Vendor: DellEMC  Model: ME4              Rev: G280
  Type:   Enclosure                        ANSI  SCSI revision: 06
Host: scsi16 Channel: 00 Id: 00 Lun: 00
  Vendor: DellEMC  Model: ME4              Rev: G280
  Type:   Enclosure                        ANSI  SCSI revision: 06
Host: scsi16 Channel: 00 Id: 01 Lun: 00
  Vendor: DellEMC  Model: ME4              Rev: G280
  Type:   Enclosure                        ANSI  SCSI revision: 06

9.识别到FBA卡和存储,重启centos系统.
10.重启后查看磁盘

 fdisk -l
Disk /dev/sda: 446.6 GiB, 479559942144 bytes, 936640512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x1e02e144

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 697565183 697563136 332.6G 83 Linux
/dev/sda2       697565184 831782911 134217728    64G 82 Linux swap / Solaris
/dev/sda3       831782912 936640511 104857600    50G 83 Linux


Disk /dev/sdb: 101.7 TiB, 111799999397888 bytes, 218359373824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


Disk /dev/sde: 101.7 TiB, 111799999397888 bytes, 218359373824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


Disk /dev/sdf: 101.7 TiB, 111799999397888 bytes, 218359373824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


Disk /dev/sdc: 101.7 TiB, 111799999397888 bytes, 218359373824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes

11.存储磁盘已经被发现,而且有很多呢.
12.查看多路径软件是否安装

lsmod |grep dm_multipath

13.安装多路径软件

yum  install device-mapper device-mapper-multipath

14.运行多路径软件

multipath –ll
Jul 22 22:15:08 | /etc/multipath.conf does not exist, blacklisting all devices.
Jul 22 22:15:08 | You can run "/sbin/mpathconf --enable" to create
Jul 22 22:15:08 | /etc/multipath.conf. See man mpathconf(8) for more details
Jul 22 22:15:08 | DM multipath kernel driver not loaded

15.安装提示运行

[[email protected] ~]# /sbin/mpathconf --enable

17.启动服务并查看

[[email protected] ~]# /bin/systemctl start multipathd.service
[[email protected] ~]# multipath -ll
mpathe (3600c0ff0005218d82acb175f01000000) dm-4 DellEMC,ME4
size=102T features='0' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 1:0:0:4  sdf 8:80  active ready running
|-+- policy='service-time 0' prio=50 status=enabled
| `- 1:0:1:4  sdk 8:160 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 16:0:0:4 sdp 8:240 active ready running
mpathd (3600c0ff0005218d838cb175f01000000) dm-3 DellEMC,ME4
size=102T features='0' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 1:0:0:3  sde 8:64  active ready running
|-+- policy='service-time 0' prio=50 status=enabled
| `- 1:0:1:3  sdj 8:144 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 16:0:0:3 sdo 8:224 active ready running
mpathc (3600c0ff000521db149cb175f01000000) dm-2 DellEMC,ME4
size=102T features='0' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 16:0:0:2 sdn 8:208 active ready running
|-+- policy='service-time 0' prio=10 status=enabled
| `- 1:0:0:2  sdd 8:48  active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 1:0:1:2  sdi 8:128 active ready running
mpathb (3600c0ff000521db15acb175f01000000) dm-1 DellEMC,ME4
size=102T features='0' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 16:0:0:1 sdm 8:192 active ready running
|-+- policy='service-time 0' prio=10 status=enabled
| `- 1:0:0:1  sdc 8:32  active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 1:0:1:1  sdh 8:112 active ready running
mpatha (3600c0ff0005218d80bcb175f01000000) dm-0 DellEMC,ME4
size=102T features='0' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 1:0:0:0  sdb 8:16  active ready running
|-+- policy='service-time 0' prio=50 status=enabled
| `- 1:0:1:0  sdg 8:96  active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 16:0:0:0 sdl 8:176 active ready running

`
18.已经全部正常识别,接下来就是分区和挂载了,
19,和原来的不同,就是不需要那么麻烦些uuid之类的,自己编辑了,multipath软件会自动识别.方便了不少.