SPDK engine使用方式
Closed this issue · 0 comments
qiyuanzhi commented
PureFlash集成了SPDK以提升IO性能,如下为SPDK engine的使用方式(以/dev/nvme0n1为例说明):
- 如果
/dev/nvme0n1
是新盘的话,清零磁盘头:
dd if=/dev/zero of=/dev/nvme0n1 bs=4K count=1 oflag=direct
当然如果/dev/nvme0n1
不是第一次使用,则可以跳过这一步; - 获取
/dev/nvme0n1
的PCIe Bus ID:
# ls -l /sys/class/block/*
/sys/class/block/nvme0n1 -> ../../devices/pci0000:00/0000:00:16.1/0000:0c:00.0/nvme/nvme0/nvme0n1
可以获取nvme0n1的Bus ID为0000:0c:00.0
- 使用SPDK接管nvme:
PCI_ALLOWED="0000:0c:00.0" ./PureFlash/thirdParty/spdk/scripts/setup.sh config
- 修改pfs.conf如下:
[cluster]
name=cluster1
[zookeeper]
ip=127.0.0.1:2181
[afs]
mngt_ip= xxx
id=1
meta_size=10737418240
[engine]
name=spdk
[tray.0]
dev = trtype:PCIe traddr:0000:0c:00.0 # path of physical flash device
[port.0]
ip= xxx
[rep_port.0]
ip= xxx
与非SPDK模式相比,修改了engine.name为spdk,dev使用PCIe addr