-
Notifications
You must be signed in to change notification settings - Fork 7
How to run SPDK
Keith Lucas edited this page Feb 9, 2022
·
6 revisions
- I tested this primarily on Ubuntu. Installing this seems to get all the dependencies:
apt-get install -y make linux-libc-dev pkg-config \
devscripts libaio-dev libc6-dev gcc meson \
python3-pyelftools uuid-dev libssl-dev \
libibverbs-dev libfuse-dev libiscsi-dev \
zlib1g-dev libfdt-dev libpcap0.8-dev \
libncurses-dev libcunit1-dev \
build-essential nasm autoconf libtool automake
- Checkout my version of spdk:
git clone https://github.com/keithalucas/spdk
git checkout longhorn
- Configure and make:
cd spdk
git submodule update --init
./configure
make
- Run
Before you run spdk, you need to run ./scripts/setup.sh
. Then you can type:
./build/bin/spdk_tgt
You can run multiple instances of SPDK on a single host by specifying different socket paths on the command line with -r
. The default socket path is /var/tmp/spdk.sock
. For example, this starts SPDK with a different socket:
./build/bin/spdk_tgt -r /var/tmp/spdk2.sock
- Demo
You need at least two nodes. One or more remote replica nodes and one local replica node. On the remote replica nodes.
- Get https://github.com/keithalucas/spdk_replica_start on each remote replica node.
- Each replica node on equinix metal has
/dev/sda
available so that code uses it. If/dev/sda
isn't available, choose something else or make a file greater than 10GB on each node and change the code to use that.- Compile build with
go build
- Run
./build/bin/spdk_tgt
on each replica node. I run it inscreen
.- Run
./spdk_replica_start <ip of node>
On the local replica node:
- Get https://github.com/keithalucas/spdk_volume_start
- Each replica node on equinix metal has
/dev/sda
available so that code uses it. If/dev/sda
isn't available, choose something else or make a file greater than 10GB on each node and change the code to use that.- Compile build with
go build
- Run
./build/bin/spdk_tgt
on the local replica node. I run it inscreen
.- Run
./spdk_replica_start <remote node ip 1> <remote node ip 2>
- Discover the NVMe-OF target with
nvme discover -t tcp -a 127.0.0.1 -s 4420
- Connect the NVMe-OF target with
nvme connect -t tcp -a 127.0.0.1 -s 4420 -n nqn.2021-12.io.longhorn.volume:demo
- Find the device file with
nvme list
- Format and use the device file:
mkfs.ext4 /dev/nvme0n1
mount /dev/nvme0n1 /mnt