How to identify devices used for Aerospike storage

How to identify devices used for Aerospike storage

Context

Aerospike can store data in a number of ways, from in-memory storage to PMEM to raw SSD/NVMe device storage. This guide specifically concentrates on raw device storage, and how to identify a disk which has been previously used to storage Aerospike data.

There are a few reasons why you may need to identify an Aerospike storage device. The main one of these is where you are referencing disks in your Aerospike configuration file by device name (/dev/sdX) and the ordering of these devices has changed after a reboot. To avoid this situation, you should configure storage devices to use the disk WWID, but if you do end up in a situation where you have your devices in the wrong order, this guide will help you work out which devices are Aerospike ones.

Method

Aerospike stores a header at the start of every device that it uses for raw storage. This means we can look for that header and identify whether the device has previously need used for Aerospike storage.

# hexdump -C /dev/sdd |head -50 |egrep '^000000|00011000'
00000000  22 03 73 75 72 74 49 43  03 00 00 00 62 61 72 00  |".surtIC....bar.|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 03 00 00 00  |................|
00000030  50 7b b7 38 72 0f a5 cd  00 00 00 00 00 00 10 00  |P{.8r...........|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00011000  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

The example above allows us to find out a few crucial pieces of information. Firstly, the initial 8 Hex values (22 03 73 75 72 74 49 43) in line 00000000 above indicate that this is an Aerospike disk. If you are running an old version of Aerospike you may instead see 07 07 73 75 72 74 49 43. The other thing of note on this line is the namespace for which this device belongs, in this case bar.

The first Hex value in line 00011000 represents the device ID for this device, in this case 01. In Aerospike 4.2 onwards, device ordering is less important as the order will be automatically calulcated, but in older versions you must ensure that your devices are listed in your configuration file in the correct order.

Notes

  • This guide can only be used to identify devices that Aerospike has used for raw device storage. If you are using file storage, you will need to mount each device and see whether it contains your Aerospike storage files.

Keywords

DEVICE STORAGE LOCATE FIND AFTER REBOOT RAW HEADER

Timestamp

March 2021

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.