forked from vitalif/vitastor
Raise default NBD timeout from 30 to 300 seconds and allow to take it from /etc/vitastor/vitastor.conf
parent
037cf64a47
commit
628aa59574
|
@ -28,7 +28,8 @@ It supports the following commands:
|
|||
Global options:
|
||||
|
||||
```
|
||||
--etcd_address ADDR Etcd connection address
|
||||
--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)
|
||||
|
|
|
@ -27,7 +27,8 @@ vitastor-cli - интерфейс командной строки для адм
|
|||
Глобальные опции:
|
||||
|
||||
```
|
||||
--etcd_address ADDR Адрес соединения с etcd
|
||||
--config_file FILE Путь к файлу конфигурации Vitastor
|
||||
--etcd_address URL Адрес соединения с etcd
|
||||
--iodepth N Отправлять параллельно N операций на каждый OSD (по умолчанию 32)
|
||||
--parallel_osds M Работать параллельно с M OSD (по умолчанию 4)
|
||||
--progress 1|0 Печатать прогресс выполнения (по умолчанию 1)
|
||||
|
|
|
@ -20,16 +20,16 @@ See also [VDUSE](qemu.en.md#vduse).
|
|||
To create a local block device for a Vitastor image run:
|
||||
|
||||
```
|
||||
vitastor-nbd map --etcd_address 10.115.0.10:2379/v3 --image testimg
|
||||
vitastor-nbd map --image testimg
|
||||
```
|
||||
|
||||
It will output a block device name like /dev/nbd0 which you can then use as a normal disk.
|
||||
|
||||
You can also use `--pool <POOL> --inode <INODE> --size <SIZE>` instead of `--image <IMAGE>` if you want.
|
||||
|
||||
Additional options for map command:
|
||||
vitastor-nbd supports all usual Vitastor configuration options like `--config_file <path_to_config>` plus NBD-specific:
|
||||
|
||||
* `--nbd_timeout 30` \
|
||||
* `--nbd_timeout 300` \
|
||||
Timeout for I/O operations in seconds after exceeding which the kernel stops
|
||||
the device. You can set it to 0 to disable the timeout, but beware that you
|
||||
won't be able to stop the device at all if vitastor-nbd process dies.
|
||||
|
@ -44,6 +44,9 @@ Additional options for map command:
|
|||
* `--foreground 1` \
|
||||
Stay in foreground, do not daemonize.
|
||||
|
||||
Note that `nbd_timeout`, `nbd_max_devices` and `nbd_max_part` options may also be specified
|
||||
in `/etc/vitastor/vitastor.conf` or in other configuration file specified with `--config_file`.
|
||||
|
||||
## Unmap image
|
||||
|
||||
To unmap the device run:
|
||||
|
|
|
@ -23,7 +23,7 @@ CSI-драйвер Kubernetes Vitastor основан на NBD.
|
|||
Чтобы создать локальное блочное устройство для образа, выполните команду:
|
||||
|
||||
```
|
||||
vitastor-nbd map --etcd_address 10.115.0.10:2379/v3 --image testimg
|
||||
vitastor-nbd map --image testimg
|
||||
```
|
||||
|
||||
Команда напечатает название блочного устройства вида /dev/nbd0, которое потом можно
|
||||
|
@ -32,7 +32,8 @@ vitastor-nbd map --etcd_address 10.115.0.10:2379/v3 --image testimg
|
|||
Для обращения по номеру инода, аналогично другим командам, можно использовать опции
|
||||
`--pool <POOL> --inode <INODE> --size <SIZE>` вместо `--image testimg`.
|
||||
|
||||
Дополнительные опции для команды подключения NBD-устройства:
|
||||
vitastor-nbd поддерживает все обычные опции Vitastor, например, `--config_file <path_to_config>`,
|
||||
плюс специфичные для NBD:
|
||||
|
||||
* `--nbd_timeout 30` \
|
||||
Максимальное время выполнения любой операции чтения/записи в секундах, при
|
||||
|
@ -53,6 +54,10 @@ vitastor-nbd map --etcd_address 10.115.0.10:2379/v3 --image testimg
|
|||
* `--foreground 1` \
|
||||
Не уводить процесс в фоновый режим.
|
||||
|
||||
Обратите внимание, что опции `nbd_timeout`, `nbd_max_devices` и `nbd_max_part` можно
|
||||
также задавать в `/etc/vitastor/vitastor.conf` или в другом файле конфигурации,
|
||||
заданном опцией `--config_file`.
|
||||
|
||||
## Отключить устройство
|
||||
|
||||
Для отключения устройства выполните:
|
||||
|
|
|
@ -23,7 +23,7 @@ balancer or any failover method you want to in that case.
|
|||
vitastor-nfs usage:
|
||||
|
||||
```
|
||||
vitastor-nfs [--etcd_address ADDR] [OTHER OPTIONS]
|
||||
vitastor-nfs [STANDARD OPTIONS] [OTHER OPTIONS]
|
||||
|
||||
--subdir <DIR> export images prefixed <DIR>/ (default empty - export all images)
|
||||
--portmap 0 do not listen on port 111 (portmap/rpcbind, requires root)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
Использование vitastor-nfs:
|
||||
|
||||
```
|
||||
vitastor-nfs [--etcd_address ADDR] [ДРУГИЕ ОПЦИИ]
|
||||
vitastor-nfs [СТАНДАРТНЫЕ ОПЦИИ] [ДРУГИЕ ОПЦИИ]
|
||||
|
||||
--subdir <DIR> экспортировать "поддиректорию" - образы с префиксом имени <DIR>/ (по умолчанию пусто - экспортировать все образы)
|
||||
--portmap 0 отключить сервис portmap/rpcbind на порту 111 (по умолчанию включён и требует root привилегий)
|
||||
|
|
|
@ -116,7 +116,8 @@ static const char* help_text =
|
|||
"Use vitastor-cli --help <command> for command details or vitastor-cli --help --all for all details.\n"
|
||||
"\n"
|
||||
"GLOBAL OPTIONS:\n"
|
||||
" --etcd_address <etcd_address>\n"
|
||||
" --config_file FILE Path to Vitastor configuration file\n"
|
||||
" --etcd_address URL Etcd connection address\n"
|
||||
" --iodepth N Send N operations in parallel to each OSD when possible (default 32)\n"
|
||||
" --parallel_osds M Work with M osds in parallel when possible (default 4)\n"
|
||||
" --progress 1|0 Report progress (default 1)\n"
|
||||
|
|
|
@ -30,7 +30,7 @@ protected:
|
|||
std::string image_name;
|
||||
uint64_t inode = 0;
|
||||
uint64_t device_size = 0;
|
||||
int nbd_timeout = 30;
|
||||
int nbd_timeout = 300;
|
||||
int nbd_max_devices = 64;
|
||||
int nbd_max_part = 3;
|
||||
inode_watch_t *watch = NULL;
|
||||
|
@ -135,14 +135,16 @@ public:
|
|||
" %s unmap /dev/nbd0\n"
|
||||
" %s ls [--json]\n"
|
||||
"OPTIONS:\n"
|
||||
" All usual Vitastor config options like --etcd_address <etcd_address> plus NBD-specific:\n"
|
||||
" --nbd_timeout 30\n"
|
||||
" All usual Vitastor config options like --config_file <path_to_config> plus NBD-specific:\n"
|
||||
" --nbd_timeout 300\n"
|
||||
" Timeout for I/O operations in seconds after exceeding which the kernel stops\n"
|
||||
" the device. You can set it to 0 to disable the timeout, but beware that you\n"
|
||||
" won't be able to stop the device at all if vitastor-nbd process dies.\n"
|
||||
" --nbd_max_devices 64 --nbd_max_part 3\n"
|
||||
" Options for the \"nbd\" kernel module when modprobing it (nbds_max and max_part).\n"
|
||||
" note that maximum allowed (nbds_max)*(1+max_part) is 256.\n"
|
||||
" Note that nbd_timeout, nbd_max_devices and nbd_max_part options may also be specified\n"
|
||||
" in /etc/vitastor/vitastor.conf or in other configuration file specified with --config_file.\n"
|
||||
" --logfile /path/to/log/file.txt\n"
|
||||
" Wite log messages to the specified file instead of dropping them (in background mode)\n"
|
||||
" or printing them to the standard output (in foreground mode).\n"
|
||||
|
@ -204,17 +206,18 @@ public:
|
|||
exit(1);
|
||||
}
|
||||
}
|
||||
if (cfg["nbd_max_devices"].is_number() || cfg["nbd_max_devices"].is_string())
|
||||
auto file_config = osd_messenger_t::read_config(cfg);
|
||||
if (file_config["nbd_max_devices"].is_number() || file_config["nbd_max_devices"].is_string())
|
||||
{
|
||||
nbd_max_devices = cfg["nbd_max_devices"].uint64_value();
|
||||
nbd_max_devices = file_config["nbd_max_devices"].uint64_value();
|
||||
}
|
||||
if (cfg["nbd_max_part"].is_number() || cfg["nbd_max_part"].is_string())
|
||||
if (file_config["nbd_max_part"].is_number() || file_config["nbd_max_part"].is_string())
|
||||
{
|
||||
nbd_max_part = cfg["nbd_max_part"].uint64_value();
|
||||
nbd_max_part = file_config["nbd_max_part"].uint64_value();
|
||||
}
|
||||
if (cfg["nbd_timeout"].is_number() || cfg["nbd_timeout"].is_string())
|
||||
if (file_config["nbd_timeout"].is_number() || file_config["nbd_timeout"].is_string())
|
||||
{
|
||||
nbd_timeout = cfg["nbd_timeout"].uint64_value();
|
||||
nbd_timeout = file_config["nbd_timeout"].uint64_value();
|
||||
}
|
||||
if (cfg["client_writeback_allowed"].is_null())
|
||||
{
|
||||
|
@ -272,7 +275,7 @@ public:
|
|||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
int r = run_nbd(sockfd, i, device_size, NBD_FLAG_SEND_FLUSH, 30, bg);
|
||||
int r = run_nbd(sockfd, i, device_size, NBD_FLAG_SEND_FLUSH, nbd_timeout, bg);
|
||||
if (r == 0)
|
||||
{
|
||||
printf("/dev/nbd%d\n", i);
|
||||
|
|
|
@ -56,7 +56,7 @@ json11::Json::object nfs_proxy_t::parse_args(int narg, const char *args[])
|
|||
"(c) Vitaliy Filippov, 2021-2022 (VNPL-1.1)\n"
|
||||
"\n"
|
||||
"USAGE:\n"
|
||||
" %s [--etcd_address ADDR] [OTHER OPTIONS]\n"
|
||||
" %s [STANDARD OPTIONS] [OTHER OPTIONS]\n"
|
||||
" --subdir <DIR> export images prefixed <DIR>/ (default empty - export all images)\n"
|
||||
" --portmap 0 do not listen on port 111 (portmap/rpcbind, requires root)\n"
|
||||
" --bind <IP> bind service to <IP> address (default 0.0.0.0)\n"
|
||||
|
|
Loading…
Reference in New Issue