This version of the module is deprecated and is no longer supported. Use the sds-drbd module instead. | Текущая версия модуля устарела и больше не поддерживается. Переключитесь на использование модуля sds-drbd. |
The module is guaranteed to work only in the following cases:
| Работоспособность модуля гарантируется только в следующих случаях:
|
In all other cases, the module may work, but its full functionality is not guaranteed. | Работоспособность модуля в других условиях возможна, но не гарантируется. |
What is difference between LVM and LVMThin? | Когда следует использовать LVM, а когда — LVMThin? |
Briefly: | Если кратко, то: |
|
|
Performance and reliability notes, comparison to Ceph | Производительность и надежность LINSTOR, сравнение с Ceph |
You may be interested in our article “Comparing Ceph, LINSTOR, Mayastor, and Vitastor storage performance in Kubernetes”. | Возможно, вам будет интересна наша статья «Исследование производительности свободных хранилищ LINSTOR, Ceph, Mayastor и Vitastor в Kubernetes». |
We take a practical view of the issue. A difference of several tens of percent — in practice it never matters. The difference is several times or more important. | Мы придерживаемся практического взгляда на вопрос. Разница в несколько десятков процентов на практике никогда не имеет значения. Имеет значение разница в несколько раз и более. |
Comparison factors: | Факторы сравнения: |
|
|
All in all, in practice, it doesn’t matter how many knobs you have for tuning, only three factors are significant: | В сухом остатке получается, что на практике неважно, какие параметры менять, и есть всего три значимых фактора: |
|
|
What to use in which situation? | Что использовать в какой ситуации? |
By default, we use two replicas (the third is an automatically created | По умолчанию модуль использует две реплики (третья — так называемая |
|
|
It is strongly recommended to have one replica locally. This doubles the possible write bandwidth (with two replicas) and significantly increases the read speed. But if this is not the case, then everything still continues to work normally (but reading over the network, and double network utilization for writing). | Настоятельно рекомендуется иметь одну реплику локально. Это в два раза увеличивает возможную скорость записи (при двух репликах) и значительно увеличивает скорость чтения. Но даже если реплики на локальном хранилище нет, все также будет работать нормально, за исключением того, что чтение будет осуществляться по сети и будет двойная утилизация сети при записи. |
Depending on the task, choose one of the following: | В зависимости от задачи нужно выбрать один из следующих вариантов: |
|
|
How to get information about the space usage? | Как получить информацию об используемом пространстве? |
There are two options: | Есть два варианта: |
|
|
|
|
|
|
shell kubectl exec -n d8-linstor deploy/linstor-controller – linstor storage-pool list | shell kubectl exec -n d8-linstor deploy/linstor-controller – linstor storage-pool list |
|
|
Changing the default StorageClass | Как назначить StorageClass по умолчанию |
List the StorageClasses in your cluster: | Отобразите список всех StorageClass’ов: |
bash kubectl get storageclass | bash kubectl get storageclass |
Mark the default StorageClass as non-default: | Снимите аннотацию с предыдущего StorageClass’а по умолчанию: |
bash kubectl annotate storageclass local-path storageclass.kubernetes.io/is-default-class- | bash kubectl annotate storageclass local-path storageclass.kubernetes.io/is-default-class- |
Mark a StorageClass as default: | Добавьте аннотацию для назначения нового StorageClass’а по умолчанию: |
bash kubectl annotate storageclass linstor-data-r2 storageclass.kubernetes.io/is-default-class=true | bash kubectl annotate storageclass linstor-data-r2 storageclass.kubernetes.io/is-default-class=true |
How to add existing LVM or LVMThin pool? | Как добавить существующий LVM- или LVMThin-пул? |
The general method is described in`LINSTOR storage configuration page. Unlike commands listed below it will automatically configure the StorageClasses as well. | Основной метод описан на странице конфигурации хранилища LINSTOR. В отличие от команд, перечисленных ниже, он также автоматически настроит StorageClass’ы. |
Example of adding an existing LVM pool: | Пример добавления LVM-пула: |
shell linstor storage-pool create lvm node01 lvmthin linstor_data | shell linstor storage-pool create lvm node01 lvmthin linstor_data |
Example of adding an existing LVMThin pool: | Пример добавления LVMThin-пула: |
shell linstor storage-pool create lvmthin node01 lvmthin linstor_data/data | shell linstor storage-pool create lvmthin node01 lvmthin linstor_data/data |
You can also add pools with some volumes have already been created. LINSTOR will just create new ones nearby. | Можно добавлять и пулы, в которых уже созданы какие-то тома. LINSTOR просто будет создавать в пуле новые тома. |
How to configure Prometheus to use LINSTOR for storing data? | Как настроить Prometheus на использование хранилища LINSTOR? |
To configure Prometheus to use LINSTOR for storing data: | Чтобы настроить Prometheus на использование хранилища LINSTOR, необходимо: |
|
|
Example: | Пример: |
yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: prometheus spec: version: 2 enabled: true settings: longtermStorageClass: linstor-data-r2 storageClass: linstor-data-r2 | yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: prometheus spec: version: 2 enabled: true settings: longtermStorageClass: linstor-data-r2 storageClass: linstor-data-r2 |
|
|
How to evict resources from a node? | Как выгнать ресурсы с узла? |
|
|
|
|
shell curl -fsSL -o evict.sh https://raw.githubusercontent.com/deckhouse/deckhouse/main/modules/041-linstor/tools/evict.sh chmod 700 evict.sh | shell curl -fsSL -o evict.sh https://raw.githubusercontent.com/deckhouse/deckhouse/main/modules/041-linstor/tools/evict.sh chmod 700 evict.sh |
|
|
shell kubectl -n d8-system cp -c deckhouse $(kubectl -n d8-system get po -l app=deckhouse -o jsonpath=’{.items[0].metadata.name}’):/deckhouse/modules/041-linstor/tools/evict.sh ./evict.sh chmod 700 evict.sh | shell kubectl -n d8-system cp -c deckhouse $(kubectl -n d8-system get po -l app=deckhouse -o jsonpath=’{.items[0].metadata.name}’):/deckhouse/modules/041-linstor/tools/evict.sh ./evict.sh chmod 700 evict.sh |
|
|
shell kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor resource list –faulty | shell kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor resource list –faulty |
|
|
shell kubectl -n d8-linstor get pods | grep -v Running | shell kubectl -n d8-linstor get pods | grep -v Running |
Evict Resources from a Node Without Deleting It from LINSTOR and Kubernetes | Выгнать ресурсы с узла без удаления его из LINSTOR и Kubernetes |
Run the | Запустите скрипт |
shell ./evict.sh –delete-resources-only | shell ./evict.sh –delete-resources-only |
To run the | Для запуска скрипта |
shell ./evict.sh –non-interactive –delete-resources-only –node-name “worker-1” | shell ./evict.sh –non-interactive –delete-resources-only –node-name “worker-1” |
|
|
Run the following command to allow resource and pod placement on the node again: | Если необходимо снова разрешить размещать ресурсы и поды на узле, то необходимо выполнить команды: |
shell alias linstor=’kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor’ linstor node set-property “worker-1” AutoplaceTarget kubectl uncordon “worker-1” | shell alias linstor=’kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor’ linstor node set-property “worker-1” AutoplaceTarget kubectl uncordon “worker-1” |
Run the following command to check the AutoplaceTarget property for all nodes (the AutoplaceTarget field will be empty for nodes where LINSTOR resource placement is allowed): | Проверить параметр AutoplaceTarget у всех узлов можно так (поле AutoplaceTarget будет пустым у тех узлов, на которых разрешено размещать ресурсы LINSTOR): |
shell alias linstor=’kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor’ linstor node list -s AutoplaceTarget | shell alias linstor=’kubectl -n d8-linstor exec -ti deploy/linstor-controller – linstor’ linstor node list -s AutoplaceTarget |
Evict Resources from a Node and Subsequently Remove It from LINSTOR and Kubernetes | Выгнать ресурсы с узла с последующим его удалением из LINSTOR и Kubernetes |
Run the | Запустите скрипт |
shell ./evict.sh –delete-node | shell ./evict.sh –delete-node |
To run the | Для запуска скрипта |
shell ./evict.sh –non-interactive –delete-node –node-name “worker-1” | shell ./evict.sh –non-interactive –delete-node –node-name “worker-1” |
|
|
In this | В этом режиме ресурсы физически с узла не удаляются. Для зачистки узла необходимо зайти на нее и выполнить следующие действия: |
|
|
|
|
shell
vgs -o+tags | awk ‘NR==1;$NF~/linstor-/’
vgremove -y | shell vgs -o+tags | awk ‘NR==1;$NF~/linstor-/’ vgremove -y <имена групп томов (vg) из вывода предыдущей команды> |
|
|
shell
lvs -o+tags | awk ‘NR==1;$NF~/linstor-/’
lvremove -y /dev/ | shell lvs -o+tags | awk ‘NR==1;$NF~/linstor-/’ lvremove -y /dev/<имя группы томов (vg) из вывода предыдущей команды>/<имя логического тома(lv) из вывода предыдущей команды> |
|
|
Troubleshooting | Диагностика проблем |
Problems can arise at different levels of component operation. This simple cheat sheet will help you quickly navigate through the diagnosis of various problems with LINSTOR-created volumes: | Проблемы могут возникнуть на разных уровнях работы компонентов. Эта простая шпаргалка поможет вам быстро сориентироваться при диагностике различных проблем с томами, созданными в LINSTOR: |
|
|
Some typical problems are described here: | Некоторые типичные проблемы описаны ниже. |
linstor-node cannot start because the drbd module cannot be loaded | linstor-node не может запуститься из-за невозможности загрузки drbd-модуля |
Check the status of the | Проверьте состояние подов |
shell kubectl get pod -n d8-linstor -l app=linstor-node | shell kubectl get pod -n d8-linstor -l app=linstor-node |
If you see that some of them get stuck in | Если вы видите, что некоторые из них находятся в состоянии |
shell kubectl logs -n d8-linstor linstor-node-xxwf9 -c kernel-module-injector | shell kubectl logs -n d8-linstor linstor-node-xxwf9 -c kernel-module-injector |
The most likely reasons why it cannot load the kernel module: | Наиболее вероятные причины, почему он не может загрузить модуль ядра: |
|
|
|
|
Pod cannot start with the
| Под не может запуститься из-за ошибки
|
Pod is stuck in the
| Под завис на стадии
|
If the Pod is stuck in the | Если под завис на стадии |
text rpc error: code = Internal desc = NodePublishVolume failed for pvc-b3e51b8a-9733-4d9a-bf34-84e0fee3168d: checking for exclusive open failed: wrong medium type, check device health | text rpc error: code = Internal desc = NodePublishVolume failed for pvc-b3e51b8a-9733-4d9a-bf34-84e0fee3168d: checking for exclusive open failed: wrong medium type, check device health |
… it means that device is still mounted on one of the other nodes. | значит, устройство все еще смонтировано на одном из других узлов. |
To check it, use the following command: | Проверить это можно с помощью следующей команды: |
shell linstor resource list -r pvc-b3e51b8a-9733-4d9a-bf34-84e0fee3168d | shell linstor resource list -r pvc-b3e51b8a-9733-4d9a-bf34-84e0fee3168d |
The | Флаг |
Pod cannot start due to missing CSI driver | Под не может запуститься из-за отсутствия CSI-драйвера |
An example error in | Пример ошибки в |
text kubernetes.io/csi: attachment for pvc-be5f1991-e0f8-49e1-80c5-ad1174d10023 failed: CSINode b-node0 does not contain driver linstor.csi.linbit.com | text kubernetes.io/csi: attachment for pvc-be5f1991-e0f8-49e1-80c5-ad1174d10023 failed: CSINode b-node0 does not contain driver linstor.csi.linbit.com |
Check the status of the | Проверьте состояние подов |
shell kubectl get pod -n d8-linstor -l app.kubernetes.io/component=csi-node | shell kubectl get pod -n d8-linstor -l app.kubernetes.io/component=csi-node |
Most likely they are stuck in the | Наиболее вероятно, что они зависли в состоянии |
shell linstor node list | shell linstor node list |
If you see any nodes in the | Если вы видите какие-либо узлы в состоянии |
shell
linstor node rst | shell
linstor node rst |
Errors like
| Ошибки вида
|
Such errors usually occur at the stage of creating the file system (mkfs). | Такие ошибки обычно возникают на стадии создания файловой системы (mkfs). |
Check | Проверьте |
shell dmesg | grep ‘Remote failed to finish a request within’ | shell dmesg | grep ‘Remote failed to finish a request within’ |
If you get any output (there are lines with the “Remote failed to finish a request within …” parts in the | Если вывод команды не пустой (в выводе |