vitalif / vitastor

Simplified distributed block and file storage with strong consistency, like in Ceph (repository mirror)
https://vitastor.io
Other
136 stars 22 forks source link

Не могу запустить vitastor-cli в контейнере cinder не root пользователем. #63

Closed mulasov closed 6 months ago

mulasov commented 6 months ago

Всем привет Выполнение vitastor-cli в контейнере cinder завершается ошибкой: от пользователя cinder:

docker exec -it --user cinder cinder_volume vitastor-cli status
terminate called after throwing an instance of 'std::runtime_error'
  what():  io_uring_queue_init: Cannot allocate memory

от пользователя root все ок:

  docker exec -it --user root cinder_volume vitastor-cli status
  cluster:
    etcd: 3 / 3 up, 1.1 M database size
    mon:  3 up, master test-vitastore-02
    osd:  6 / 6 up

  data:
    raw:   0 B used, 299.2 G / 299.2 G available
    state: 0 B clean
    pools: 1 / 1 active
    pgs:   256 active

  io:
    client: 0 B/s rd, 0 op/s rd, 0 B/s wr, 0 op/s wr

от пользователя cinder vitastor-cli -h работает :

docker exec -it --user cinder cinder_volume vitastor-cli -h
Vitastor command-line tool 1.6.0
(c) Vitaliy Filippov, 2019+ (VNPL-1.1)

COMMANDS:

  vitastor-cli status
  vitastor-cli df
  vitastor-cli ls [-l] [-p POOL] [--sort FIELD] [-r] [-n N] [<glob> ...]
  vitastor-cli create -s|--size <size> [-p|--pool <id|name>] [--parent <parent_name>[@<snapshot>]] <name>
  vitastor-cli create --snapshot <snapshot> [-p|--pool <id|name>] <image>
  vitastor-cli snap-create [-p|--pool <id|name>] <image>@<snapshot>
  vitastor-cli modify <name> [--rename <new-name>] [--resize <size>] [--readonly | --readwrite] [-f|--force] [--down-ok]
  vitastor-cli rm <from> [<to>] [--writers-stopped] [--down-ok]
  vitastor-cli flatten <layer>
  vitastor-cli rm-data --pool <pool> --inode <inode> [--wait-list] [--min-offset <offset>]
  vitastor-cli merge-data <from> <to> [--target <target>]
  vitastor-cli describe [OPTIONS]
  vitastor-cli fix [--objects <objects>] [--bad-osds <osds>] [--part <part>] [--check no]
  vitastor-cli alloc-osd
  vitastor-cli rm-osd [--force] [--allow-data-loss] [--dry-run] <osd_id> [osd_id...]
  vitastor-cli create-pool|pool-create <name> (-s <pg_size>|--ec <N>+<K>) -n <pg_count> [OPTIONS]
  vitastor-cli modify-pool|pool-modify <id|name> [--name <new_name>] [PARAMETERS...]
  vitastor-cli rm-pool|pool-rm [--force] <id|name>
  vitastor-cli ls-pools|pool-ls|ls-pool|pools [-l] [--detail] [--sort FIELD] [-r] [-n N] [--stats] [<glob> ...]

Use vitastor-cli --help <command> for command details or vitastor-cli --help --all for all details.

GLOBAL OPTIONS:
  --config_file FILE  Path to Vitastor configuration file
  --etcd_address URL  Etcd connection address
  --iodepth N         Send N operations in parallel to each OSD when possible (default 32)
  --parallel_osds M   Work with M osds in parallel when possible (default 4)
  --progress 1|0      Report progress (default 1)
  --cas 1|0           Use CAS writes for flatten, merge, rm (default is decide automatically)
  --color 1|0         Enable/disable colored output and CR symbols (default 1 if stdout is a terminal)
  --json              JSON output

Права доступа к /etc/vitastor/vitastor.conf у пользователя cinder есть. vitastor-cli версия 1.6.0 делал по мануалу - https://github.com/vitalif/vitastor/blob/v1.6.0/docs/installation/openstack.ru.md

vitalif commented 6 months ago

Привет Это связано с инициализацией io_uring io_uring требует лимита mlock, т.к. очереди пинятся в памяти Т.е. смотри в сторону ulimit -l - это вот как раз оно

mulasov commented 6 months ago

Спасибо @vitalif я увеличил memlock в конфигурации Docker daemon.json и все отлично заработало.