From 0e5d23de3565aad24faaf057bfd3a1b58e3a2413 Mon Sep 17 00:00:00 2001 From: kruall Date: Fri, 17 Jan 2025 09:29:07 +0300 Subject: [PATCH] Change install instruction for ydb-dstool (#11834) Co-authored-by: Anton Bobkov --- .../reference/ydb-dstool/_includes/test.md | 17 +++++ .../ydb-dstool/_includes/unix_install.md | 11 +++ .../_includes/unix_install_command.md | 7 ++ .../en/core/reference/ydb-dstool/install.md | 68 ++++++++++++------- .../reference/ydb-dstool/_includes/test.md | 17 +++++ .../ydb-dstool/_includes/unix_install.md | 11 +++ .../_includes/unix_install_command.md | 7 ++ .../ru/core/reference/ydb-dstool/install.md | 66 ++++++++++++------ 8 files changed, 159 insertions(+), 45 deletions(-) create mode 100644 ydb/docs/en/core/reference/ydb-dstool/_includes/test.md create mode 100644 ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install.md create mode 100644 ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install_command.md create mode 100644 ydb/docs/ru/core/reference/ydb-dstool/_includes/test.md create mode 100644 ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install.md create mode 100644 ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install_command.md diff --git a/ydb/docs/en/core/reference/ydb-dstool/_includes/test.md b/ydb/docs/en/core/reference/ydb-dstool/_includes/test.md new file mode 100644 index 000000000000..c0a6c646231c --- /dev/null +++ b/ydb/docs/en/core/reference/ydb-dstool/_includes/test.md @@ -0,0 +1,17 @@ + + +```bash +ydb-dstool -e cluster list +``` + +* `bs_endpoint`: URI of the cluster's HTTP endpoint, the same endpoint that serves the [Embedded UI](../../embedded-ui/index.md). Example: `http://localhost:8765`. + +Result: + +```text +┌───────┬───────┬───────┬────────┬────────┬───────┬────────┐ +│ Hosts │ Nodes │ Pools │ Groups │ VDisks │ Boxes │ PDisks │ +├───────┼───────┼───────┼────────┼────────┼───────┼────────┤ +│ 8 │ 16 │ 1 │ 5 │ 40 │ 1 │ 32 │ +└───────┴───────┴───────┴────────┴────────┴───────┴────────┘ +``` diff --git a/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install.md b/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install.md new file mode 100644 index 000000000000..a8e88162bb1e --- /dev/null +++ b/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install.md @@ -0,0 +1,11 @@ +To install the {{ ydb-short-name }} DSTool, follow these steps: + +1. Run the command: + + {% include [install command](./unix_install_command.md) %} + +1. To update the environment variables, restart the command shell. + +1. Test it by running the command that shows cluster information: + + {% include [test step](./test.md) %} diff --git a/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install_command.md b/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install_command.md new file mode 100644 index 000000000000..f8be6af4924d --- /dev/null +++ b/ydb/docs/en/core/reference/ydb-dstool/_includes/unix_install_command.md @@ -0,0 +1,7 @@ + + +```bash +curl -sSL 'https://install.ydb.tech/dstool' | bash +``` + +The script will install the {{ ydb-short-name }} DSTool. If the script is run from a `bash` or `zsh` shell, it will also add the `ydb-dstool` executable to the `PATH` environment variable. Otherwise, you can run it from the `~/ydb/bin` folder or add it to `PATH` manually. diff --git a/ydb/docs/en/core/reference/ydb-dstool/install.md b/ydb/docs/en/core/reference/ydb-dstool/install.md index 4b623bd660b5..1830dce7db0a 100644 --- a/ydb/docs/en/core/reference/ydb-dstool/install.md +++ b/ydb/docs/en/core/reference/ydb-dstool/install.md @@ -1,33 +1,55 @@ -# Installing {{ ydb-short-name }} DSTool +# Installing the {{ ydb-short-name }} DSTool -To install and configure {{ ydb-short-name }} DSTool: + -1. Install the `ydb-dstool` Python package: +{% list tabs %} - ```bash - pip install ydb-dstool - ``` +- Linux -1. Configure the environment: + {% include [unix_install](./_includes/unix_install.md) %} - ```bash - export PATH=${PATH}:${HOME}/.local/bin - ``` +- macOS -1. Test it by running the command that shows cluster information: + {% include [unix_install](./_includes/unix_install.md) %} - ```bash - ydb-dstool -e cluster list - ``` +- Windows - * `bs_endpoint`: URI of the interface for {{ ydb-short-name }} cluster distributed storage management. The interface is accessible over HTTP on any cluster node on port 8765 by default. URI example: `http://localhost:8765`. + To install the {{ ydb-short-name }} DSTool, follow these steps: - Result: + 1. Run the command: - ```text - ┌───────┬───────┬───────┬────────┬────────┬───────┬────────┐ - │ Hosts │ Nodes │ Pools │ Groups │ VDisks │ Boxes │ PDisks │ - ├───────┼───────┼───────┼────────┼────────┼───────┼────────┤ - │ 8 │ 16 │ 1 │ 5 │ 40 │ 1 │ 32 │ - └───────┴───────┴───────┴────────┴────────┴───────┴────────┘ - ``` + - in **PowerShell**: + + ```powershell + iex (New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows') + ``` + + - in **CMD**: + + ```cmd + @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows'))" + ``` + + 1. Specify whether to add `ydb-dstool` to the `PATH` environment variable: + + ```text + Add ydb-dstool installation dir to your PATH? [Y/n] + ``` + + 1. To update the environment variables, restart the command shell. + + {% note info %} + + The {{ ydb-short-name }} DSTool uses Unicode characters in the output of some commands. If these characters aren't displayed correctly in the Windows console, switch the encoding to UTF-8: + + ```cmd + chcp 65001 + ``` + + {% endnote %} + + 1. Test it by running the command that shows cluster information: + + {% include [test step](./_includes/test.md) %} + +{% endlist %} diff --git a/ydb/docs/ru/core/reference/ydb-dstool/_includes/test.md b/ydb/docs/ru/core/reference/ydb-dstool/_includes/test.md new file mode 100644 index 000000000000..4ecdc4cda6c1 --- /dev/null +++ b/ydb/docs/ru/core/reference/ydb-dstool/_includes/test.md @@ -0,0 +1,17 @@ + + +```bash +ydb-dstool -e cluster list +``` + +* `bs_endpoint` — URI HTTP-эндпоинта кластера — это тот же самый эндпоинт, который обслуживает [Embedded UI](../../embedded-ui/index.md). Пример: `http://localhost:8765`. + +Результат: + +```text +┌───────┬───────┬───────┬────────┬────────┬───────┬────────┐ +│ Hosts │ Nodes │ Pools │ Groups │ VDisks │ Boxes │ PDisks │ +├───────┼───────┼───────┼────────┼────────┼───────┼────────┤ +│ 8 │ 16 │ 1 │ 5 │ 40 │ 1 │ 32 │ +└───────┴───────┴───────┴────────┴────────┴───────┴────────┘ +``` diff --git a/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install.md b/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install.md new file mode 100644 index 000000000000..cd866bdcdaed --- /dev/null +++ b/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install.md @@ -0,0 +1,11 @@ +Чтобы установить {{ ydb-short-name }} DSTool: + +1. Выполните команду: + + {% include [install command](./unix_install_command.md) %} + +1. Чтобы обновить переменные окружения, перезапустите командную оболочку. + +1. Проверьте работу, выполнив команду вывода информации о кластере: + + {% include [test step](./test.md) %} diff --git a/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install_command.md b/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install_command.md new file mode 100644 index 000000000000..486fce8aac38 --- /dev/null +++ b/ydb/docs/ru/core/reference/ydb-dstool/_includes/unix_install_command.md @@ -0,0 +1,7 @@ + + +```bash +curl -sSL 'https://install.ydb.tech/dstool' | bash +``` + +Скрипт установит {{ ydb-short-name }} DSTool. Если скрипт запускается из оболочки `bash` или `zsh`, он также добавит исполняемый файл `ydb-dstool` в переменную окружения `PATH`. В противном случае вы можете запускать его из папки `~/ydb/bin` или добавить в `PATH` вручную. diff --git a/ydb/docs/ru/core/reference/ydb-dstool/install.md b/ydb/docs/ru/core/reference/ydb-dstool/install.md index 337fa518a12f..186eab16bdb2 100644 --- a/ydb/docs/ru/core/reference/ydb-dstool/install.md +++ b/ydb/docs/ru/core/reference/ydb-dstool/install.md @@ -1,33 +1,55 @@ # Установка {{ ydb-short-name }} DSTool -Чтобы установить и настроить {{ ydb-short-name }} DSTool: + -1. Установите Python-пакет `ydb-dstool`: +{% list tabs %} - ```bash - pip install ydb-dstool - ``` +- Linux -1. Настройте окружение: + {% include [unix_install](./_includes/unix_install.md) %} - ```bash - export PATH=${PATH}:${HOME}/.local/bin - ``` +- macOS -1. Проверьте работу, выполнив команду вывода информации о кластере: + {% include [unix_install](./_includes/unix_install.md) %} - ```bash - ydb-dstool -e cluster list - ``` +- Windows - * `bs_endpoint` — URI интерфейса управления распределенным хранилищем кластера {{ ydb-short-name }}. Интерфейс доступен на любом узле кластера по протоколу HTTP на порте 8765 по умолчанию. Пример URI: `http://localhost:8765`. + Чтобы установить {{ ydb-short-name }} DSTool: - Результат: + 1. Выполните команду: - ```text - ┌───────┬───────┬───────┬────────┬────────┬───────┬────────┐ - │ Hosts │ Nodes │ Pools │ Groups │ VDisks │ Boxes │ PDisks │ - ├───────┼───────┼───────┼────────┼────────┼───────┼────────┤ - │ 8 │ 16 │ 1 │ 5 │ 40 │ 1 │ 32 │ - └───────┴───────┴───────┴────────┴────────┴───────┴────────┘ - ``` + - **PowerShell**: + + ```powershell + iex (New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows') + ``` + + - **CMD**: + + ```cmd + @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows'))" + ``` + + 1. Укажите, нужно ли добавить путь к `ydb-dstool` в переменную окружения `PATH`: + + ```text + Add ydb-dstool installation dir to your PATH? [Y/n] + ``` + + 1. Чтобы обновить переменные окружения, перезапустите командную оболочку. + + {% note info %} + + {{ ydb-short-name }} DSTool использует символы Юникода в выводе некоторых команд. При некорректном отображении таких символов в консоли Windows, переключите кодировку на UTF-8: + + ```cmd + chcp 65001 + ``` + + {% endnote %} + + 1. Проверьте работу, выполнив команду вывода информации о кластере: + + {% include [test step](./_includes/test.md) %} + +{% endlist %}