93 lines
3.0 KiB
Markdown
93 lines
3.0 KiB
Markdown
# Лабораторная работа №2 - Разработка простейшего распределённого приложения.
|
||
|
||
## Цель:
|
||
Изучение техники создания простого распределённого приложения.
|
||
|
||
## Задачи:
|
||
1. Согласно вашему варианту (выбирайте любой) разработать два приложения такие, что результат первого является исходными данными для второго.
|
||
2. Изучить файлы сборки образов docker и разработать их для созданных приложений.
|
||
3. Собрать файл docker-compose.yml для запуска приложений. Разобраться с монтированием каталогов из хост-системы.
|
||
4. Правильно закоммитить результат без лишних файлов.
|
||
5. Оформить pull request по правилам и отправить его на проверку.
|
||
|
||
## Запуск:
|
||
Чтобы запустить контейнеры в docker, необходимо выполнить следующую команду:
|
||
`docker-compose -f \ docker-compose.yml up -d`,
|
||
где:
|
||
+ `-f` - путь до docker-compose.yml файла
|
||
+ `-d` - фоновый режим запуска
|
||
|
||
## Решение:
|
||
Выбраны следующие варианты задания:
|
||
+ Worker1: Ищет в каталоге /var/data файл с наибольшим количеством строк и перекладывает его в /var/result/data.txt.
|
||
+ Worker2: Ищет набольшее число из файла /var/data/data.txt и сохраняет количество таких чисел из последовательности в /var/result/result.txt.
|
||
|
||
|
||
+ `Worker1`:
|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||
+ `Worker2`:
|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||
**Файлы**:
|
||
|
||
+ **Файл `var/data/file1.txt`**:
|
||
|
||

|
||
|
||
+ **Файл `var/data/file2.txt`**:
|
||
|
||

|
||
|
||
+ **Файл `var/data/file3.txt`**:
|
||
|
||

|
||
|
||
+ **Файл `docker-compose.yaml`**:
|
||
|
||

|
||
|
||
**Результат запуска**:
|
||
|
||

|
||
|
||
...
|
||
|
||

|
||
|
||
**Образы**:
|
||
|
||

|
||
|
||
**Контейнеры**:
|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||
**Файл `var/result/data.txt`**:
|
||
|
||

|
||
|
||
**Файл `var/result/result.txt`**:
|
||
|
||

|
||
|
||
## Ссылка на видео:
|
||
https://youtu.be/pLVCu7AxThc |