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

How to use udev to enhance the management of ceph storage devices

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about how to use udev to enhance the management of ceph storage devices. I think it is very practical, so I share it with you. I hope you can get something after reading this article.

Requirement description

By default, disks can use various names such as by-id/by-partlabel/by-parttypeuuid/by-partuuid/by-path/by-uuid to manage disk devices, but in ceph, if there are too many disks, plus in order to better distinguish the use of the disk partition corresponding to each OSD (such as filestore or journal), at the same time make sure that the corresponding name remains the same after the physical disk changes (after the failed disk is replaced) New management requirements for disk device naming corresponding to OSD are put forward.

This example uses udev to name the disk according to osd [N]. For example, / dev/osd5_filestore_1 represents the first filestore partition of osd5, / dev/osd5_journal_5 represents the first journal partition of osd5 (indicates that the disk is used for osd.5 's filestore), and takes / dev/sdd as an example

View device information

Root@demo:~# udevadm info-query=all-name=/dev/sdd P: / devices/pci0000:00/0000:00:0d.0/ata6/host5/target5:0:0/5:0:0:0/block/sdd N: sdd S: disk/by-id/ata-VBOX_HARDDISK_VB98806c01-1fe3494a S: disk/by-id/scsi-SATA_VBOX_HARDDISK_VB98806c01-1fe3494a S: disk/by-path/pci-0000:00:0d.0-scsi-0:0: 0:0 S: osd5data E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VB98806c01-1fe3494a / dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB98806c01-1fe3494a / dev/disk/by-path/pci-0000:00:0d.0-scsi-0:0:0:0 / dev/osd5data E: DEVNAME=/dev/sdd E:DEVPATH=/devices/pci0000:00/0000:00:0d.0/ata6/host5/target5:0:0/5:0:0: 0/block/sdd # the system ID that represents the physical device.

Select the identification code of the device. DEVPATH (DEVPATH= / devices/pci0000:00/0000:00:0d.0/ata6/host5/target) is used in the example.

Write udev rules rule files

Root@demo:~# cat / etc/udev/rules.d/20-persistent-disk.rules KERNEL== "sd?", SUBSYSTEM== "block", DEVPATH== "* / devices/pci0000:00/0000:00:0d.0/ata6/host5/target5:0:0/5:0:0:0*", SYMLINK+= "osd5", GOTO= "END_20_PERSISTENT_DISK" KERNEL== "sd?*", ATTR {partition} = = "1", SUBSYSTEM== "block" DEVPATH== "* / devices/pci0000:00/0000:00:0d.0/ata6/host5/target5:0:0/5:0:0:0*", SYMLINK+= "osd5_filestore_%n" KERNEL== "sd?*", ATTR {partition} = = "2", SUBSYSTEM== "block", DEVPATH== "* / devices/pci0000:00/0000:00:0d.0/ata6/host5/target5:0:0/5:0:0:0*", SYMLINK+= "osd5_journal_%n" LABEL= "END_20_PERSISTENT_DISK"

Execute the following command to send an event event to the kernel, triggering the execution of the udev rules (similar to the hot plug of an analog block device).

Udevadm trigger-subsystem-match=block-action=add

Check the final effect

The above is how to use udev to enhance the management of ceph storage devices. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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