编译 VDO 以在 Debian 上使用

编译 VDO 以在 Debian 上使用

我找不到任何适用于 Debian 的 vdo 软件包,而且我自己编译和运行该软件的尝试也失败了。任何人都可以阐明如何编译 vdo 以用于 Debian,因为这是 RHEL 在收购另一家公司后发布的软件。

我当前的步骤是:

apt-get update -y
apt-get install -y git sudo
sudo apt-get upgrade -y
sudo apt-get install -y build-essential libdevmapper-dev libz-dev uuid-dev
git clone https://github.com/dm-vdo/vdo.git
make
make install
sudo apt install -t stretch-backports linux-headers-$(uname -r)
git clone https://github.com/dm-vdo/kvdo.git
make -C /usr/src/linux-headers-`uname -r` M=`pwd`
cp vdo/kvdo.ko /lib/modules/$(uname -r)
cp uds/uds.ko /lib/modules/$(uname -r)
depmod
modprobe kvdo
modprobe uds
systemctl start vdo

// error with
Starting VDO volume services...
Traceback (most recent call last):
  File "/usr/bin/vdo", line 46, in <module>
    from vdo.utils import Command

答案1

OP的问题不完整:错误消息的末尾包含重要线索解决这个问题不包括在内。这是(在 Debian buster 上。Debian 9 会改为搜索python3.5):

# vdo status
Traceback (most recent call last):
  File "/usr/local/bin/vdo", line 46, in <module>
    from vdo.utils import Command
  File "/usr/local/lib/python3.7/dist-packages/vdo/utils/__init__.py", line 27, in <module>
    from .YAMLObject import YAMLObject
  File "/usr/local/lib/python3.7/dist-packages/vdo/utils/YAMLObject.py", line 33, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

所以Python代码需要一个yaml模块。

# apt-cache search python3 yaml | grep yaml | head -5
python3-pretty-yaml - module to produce pretty and readable YAML-serialized data (Python 3)
python3-xstatic-js-yaml - JavaScript yaml implementation - XStatic support
python3-xstatic-json2yaml - converts json or simple javascript objects into a yaml - XStatic support
python3-yamlordereddictloader - loader and dump for PyYAML keeping keys order
python3-yaml - YAML parser and emitter for Python3

# apt-get install python3-yaml

[...]

# vdo status
VDO status:
  Date: '2019-05-13 19:33:06+02:00'
  Node: somenode
Kernel module:
  Loaded: true
  Name: kvdo
  Version information:
    kvdo version: 6.2.0.293
Configuration:
  File: does not exist
  Last modified: not available
VDOs: {}

就是这样。请注意,如果不进行任何配置,实际上什么都不会启动。您应该遵循 Redhat 提供的指示:1.5.创建 VDO 卷

下面是我运行的一个例子:

# vdo create --name=vdo-data --device=/dev/md0 --vdoLogicalSize=8T
Creating VDO vdo-data
Starting VDO vdo-data
Starting compression on VDO vdo-data
VDO instance 0 volume is ready at /dev/mapper/vdo-data

即使没有完全安装它,看一眼也vdo.service能提供足够的信息:

ExecStart=/usr/bin/vdo start --all --confFile /etc/vdoconf.yml

所以手动:

# vdo start --all --confFile /etc/vdoconf.yml
Starting VDO vdo-data
VDO instance 0 volume is ready at /dev/mapper/vdo-data

# ps -ef|grep vdo
root     11590     2  0 19:53 ?        00:00:00 [kvdo0:dedupeQ]
root     11593     2  0 19:53 ?        00:00:00 [kvdo0:journalQ]
root     11594     2  0 19:53 ?        00:00:00 [kvdo0:packerQ]
root     11595     2  0 19:53 ?        00:00:00 [kvdo0:logQ0]

[...]

# vdo status
VDO status:
  Date: '2019-05-13 19:54:46+02:00'
  Node: somenode
Kernel module:
  Loaded: true
  Name: kvdo
  Version information:
    kvdo version: 6.2.0.293
Configuration:
  File: /etc/vdoconf.yml
  Last modified: '2019-05-13 19:53:35'
VDOs:
  vdo-data:
    Acknowledgement threads: 1
    Activate: enabled
    Bio rotation interval: 64
    Bio submission threads: 4
    Block map cache size: 128M
    Block map period: 16380
    Block size: 4096
    CPU-work threads: 2
    Compression: enabled
    Configured write policy: auto
    Deduplication: enabled
    Device mapper status: 0 17179869184 vdo /dev/md0 normal - online online 1151960 242161600
    Emulate 512 byte: disabled
    Hash zone threads: 1
    Index checkpoint frequency: 0

[...]

最后注意:要在 >= 4.20 的内核上运行它,默认情况下需要没有可变参数函数在内核中,kvdo 需要更改。最简单的是忽略相应的警告,直到项目本身纠正受影响的功能。其他 RH 员工可提供 2x2 行修补树那里

相关内容