From 638c86c1bd8264ef38e3772a5b9ded7bc7433e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=91=D0=B5=D0=BB=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 00:09:36 +0300 Subject: [PATCH 1/3] cache --- mongo-sharding-repl/.gitignore | 1 + mongo-sharding-repl/README.md | 168 ++++++++ mongo-sharding-repl/api_app/Dockerfile | 10 + mongo-sharding-repl/api_app/app.py | 192 +++++++++ mongo-sharding-repl/api_app/requirements.txt | 6 + mongo-sharding-repl/compose.yaml | 233 ++++++++++ mongo-sharding-repl/scripts/mongo-init.sh | 11 + mongo-sharding/.gitignore | 1 + mongo-sharding/README.md | 130 ++++++ mongo-sharding/api_app/Dockerfile | 10 + mongo-sharding/api_app/app.py | 192 +++++++++ mongo-sharding/api_app/requirements.txt | 6 + mongo-sharding/compose.yaml | 130 ++++++ mongo-sharding/scripts/mongo-init.sh | 11 + sharding-repl-cache/.gitignore | 1 + sharding-repl-cache/README.md | 165 +++++++ sharding-repl-cache/api_app/Dockerfile | 10 + sharding-repl-cache/api_app/app.py | 192 +++++++++ sharding-repl-cache/api_app/requirements.txt | 6 + sharding-repl-cache/compose.yaml | 247 +++++++++++ sharding-repl-cache/scripts/mongo-init.sh | 11 + task1.drawio | 425 +++++++++++++++++++ 22 files changed, 2158 insertions(+) create mode 100644 mongo-sharding-repl/.gitignore create mode 100644 mongo-sharding-repl/README.md create mode 100644 mongo-sharding-repl/api_app/Dockerfile create mode 100644 mongo-sharding-repl/api_app/app.py create mode 100644 mongo-sharding-repl/api_app/requirements.txt create mode 100644 mongo-sharding-repl/compose.yaml create mode 100644 mongo-sharding-repl/scripts/mongo-init.sh create mode 100644 mongo-sharding/.gitignore create mode 100644 mongo-sharding/README.md create mode 100644 mongo-sharding/api_app/Dockerfile create mode 100644 mongo-sharding/api_app/app.py create mode 100644 mongo-sharding/api_app/requirements.txt create mode 100644 mongo-sharding/compose.yaml create mode 100644 mongo-sharding/scripts/mongo-init.sh create mode 100644 sharding-repl-cache/.gitignore create mode 100644 sharding-repl-cache/README.md create mode 100644 sharding-repl-cache/api_app/Dockerfile create mode 100644 sharding-repl-cache/api_app/app.py create mode 100644 sharding-repl-cache/api_app/requirements.txt create mode 100644 sharding-repl-cache/compose.yaml create mode 100644 sharding-repl-cache/scripts/mongo-init.sh create mode 100644 task1.drawio diff --git a/mongo-sharding-repl/.gitignore b/mongo-sharding-repl/.gitignore new file mode 100644 index 00000000..f5e96dbf --- /dev/null +++ b/mongo-sharding-repl/.gitignore @@ -0,0 +1 @@ +venv \ No newline at end of file diff --git a/mongo-sharding-repl/README.md b/mongo-sharding-repl/README.md new file mode 100644 index 00000000..929af215 --- /dev/null +++ b/mongo-sharding-repl/README.md @@ -0,0 +1,168 @@ +# Задание 1 + +# Задание 2 + +## Шардирование + +### Инициализация сервера конфигурации + +```bash +docker-compose exec -it configSrv mongosh --port 27017 +``` + +```bash +rs.initiate( + { + _id : "config_server", + configsvr: true, + members: [ + { _id : 0, host : "configSrv:27017" } + ] + } +); +``` + +### Инициализаци реплик + +#### Шард 1 + +```bash +docker-compose exec -it shard1 mongosh --port 27018 +``` + +```bash +rs.initiate({_id: "shard1", members: [ +{_id: 0, host: "shard1:27018"}, +{_id: 1, host: "shard1_2:27021"}, +{_id: 2, host: "shard1_3:27022"} +]}) +``` + +#### Шард 2 + +```bash +docker-compose exec -it shard2 mongosh --port 27019 +``` + +```bash +rs.initiate({_id: "shard2", members: [ +{_id: 0, host: "shard2:27019"}, +{_id: 1, host: "shard2_2:27023"}, +{_id: 2, host: "shard2_3:27024"} +]}) +``` + + +### Инициализация роутера + +```bash +docker-compose exec -it mongos_router mongosh --port 27020 +``` + +```bash +sh.addShard( "shard1/shard1:27018"); +``` + +```bash +sh.addShard( "shard2/shard2:27019"); +``` + +```bash +sh.enableSharding("somedb"); +``` + +```bash +sh.shardCollection("somedb.helloDoc", { "name" : "hashed" } ) +``` + +```bash +use somedb +``` + +```bash +for(var i = 0; i < 1000; i++) db.helloDoc.insert({age:i, name:"ly"+i}) +``` + +```bash +db.helloDoc.countDocuments() +``` + +### Проверка в шардах + +#### Шард 1 + +```bash +docker-compose exec -it shard1 mongosh --port 27018 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +##### Реплика 2 + +```bash +docker-compose exec -it shard1 mongosh --port 27021 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +##### Реплика 3 + +```bash +docker-compose exec -it shard1 mongosh --port 27022 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +#### Шард 2 + +```bash +docker-compose exec -it shard2 mongosh --port 27019 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +##### Реплика 2 + +```bash +docker-compose exec -it shard2 mongosh --port 27023 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +##### Реплика 3 + +```bash +docker-compose exec -it shard2 mongosh --port 27024 +``` + +```bash +use somedb; +db.helloDoc.countDocuments(); +``` + +### Запуск приложения + +```bash +docker-compose up -d pymongo_api +``` + +Проверка [http://localhost:8080/](http://localhost:8080/) + + +# Задание 3 + diff --git a/mongo-sharding-repl/api_app/Dockerfile b/mongo-sharding-repl/api_app/Dockerfile new file mode 100644 index 00000000..46f6c9d0 --- /dev/null +++ b/mongo-sharding-repl/api_app/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.12.1-slim +WORKDIR /app +EXPOSE 8080 +COPY requirements.txt ./ +# Устанавливаем зависимости python не пересобирая их +RUN pip install --no-cache --no-cache-dir -r requirements.txt +# Копирование кода приложения +COPY app.py /app/ +ENTRYPOINT ["uvicorn"] +CMD ["app:app", "--host", "0.0.0.0", "--port", "8080"] diff --git a/mongo-sharding-repl/api_app/app.py b/mongo-sharding-repl/api_app/app.py new file mode 100644 index 00000000..9b19c017 --- /dev/null +++ b/mongo-sharding-repl/api_app/app.py @@ -0,0 +1,192 @@ +import json +import logging +import os +import time +from typing import List, Optional + +import motor.motor_asyncio +from bson import ObjectId +from fastapi import Body, FastAPI, HTTPException, status +from fastapi_cache import FastAPICache +from fastapi_cache.backends.redis import RedisBackend +from fastapi_cache.decorator import cache +from logmiddleware import RouterLoggingMiddleware, logging_config +from pydantic import BaseModel, ConfigDict, EmailStr, Field +from pydantic.functional_validators import BeforeValidator +from pymongo import errors +from redis import asyncio as aioredis +from typing_extensions import Annotated + +# Configure JSON logging +logging.config.dictConfig(logging_config) +logger = logging.getLogger(__name__) + +app = FastAPI() +app.add_middleware( + RouterLoggingMiddleware, + logger=logger, +) + +DATABASE_URL = os.environ["MONGODB_URL"] +DATABASE_NAME = os.environ["MONGODB_DATABASE_NAME"] +REDIS_URL = os.getenv("REDIS_URL", None) + + +def nocache(*args, **kwargs): + def decorator(func): + return func + + return decorator + + +if REDIS_URL: + cache = cache +else: + cache = nocache + + +client = motor.motor_asyncio.AsyncIOMotorClient(DATABASE_URL) +db = client[DATABASE_NAME] + +# Represents an ObjectId field in the database. +# It will be represented as a `str` on the model so that it can be serialized to JSON. +PyObjectId = Annotated[str, BeforeValidator(str)] + + +@app.on_event("startup") +async def startup(): + if REDIS_URL: + redis = aioredis.from_url(REDIS_URL, encoding="utf8", decode_responses=True) + FastAPICache.init(RedisBackend(redis), prefix="api:cache") + + +class UserModel(BaseModel): + """ + Container for a single user record. + """ + + id: Optional[PyObjectId] = Field(alias="_id", default=None) + age: int = Field(...) + name: str = Field(...) + + +class UserCollection(BaseModel): + """ + A container holding a list of `UserModel` instances. + """ + + users: List[UserModel] + + +@app.get("/") +async def root(): + collection_names = await db.list_collection_names() + collections = {} + for collection_name in collection_names: + collection = db.get_collection(collection_name) + collections[collection_name] = { + "documents_count": await collection.count_documents({}) + } + try: + replica_status = await client.admin.command("replSetGetStatus") + replica_status = json.dumps(replica_status, indent=2, default=str) + except errors.OperationFailure: + replica_status = "No Replicas" + + topology_description = client.topology_description + read_preference = client.client_options.read_preference + topology_type = topology_description.topology_type_name + replicaset_name = topology_description.replica_set_name + + shards = None + if topology_type == "Sharded": + shards_list = await client.admin.command("listShards") + shards = {} + for shard in shards_list.get("shards", {}): + shards[shard["_id"]] = shard["host"] + + cache_enabled = False + if REDIS_URL: + cache_enabled = FastAPICache.get_enable() + + return { + "mongo_topology_type": topology_type, + "mongo_replicaset_name": replicaset_name, + "mongo_db": DATABASE_NAME, + "read_preference": str(read_preference), + "mongo_nodes": client.nodes, + "mongo_primary_host": client.primary, + "mongo_secondary_hosts": client.secondaries, + "mongo_address": client.address, + "mongo_is_primary": client.is_primary, + "mongo_is_mongos": client.is_mongos, + "collections": collections, + "shards": shards, + "cache_enabled": cache_enabled, + "status": "OK", + } + + +@app.get("/{collection_name}/count") +async def collection_count(collection_name: str): + collection = db.get_collection(collection_name) + items_count = await collection.count_documents({}) + # status = await client.admin.command('replSetGetStatus') + # import ipdb; ipdb.set_trace() + return {"status": "OK", "mongo_db": DATABASE_NAME, "items_count": items_count} + + +@app.get( + "/{collection_name}/users", + response_description="List all users", + response_model=UserCollection, + response_model_by_alias=False, +) +@cache(expire=60 * 1) +async def list_users(collection_name: str): + """ + List all of the user data in the database. + The response is unpaginated and limited to 1000 results. + """ + time.sleep(1) + collection = db.get_collection(collection_name) + return UserCollection(users=await collection.find().to_list(1000)) + + +@app.get( + "/{collection_name}/users/{name}", + response_description="Get a single user", + response_model=UserModel, + response_model_by_alias=False, +) +async def show_user(collection_name: str, name: str): + """ + Get the record for a specific user, looked up by `name`. + """ + + collection = db.get_collection(collection_name) + if (user := await collection.find_one({"name": name})) is not None: + return user + + raise HTTPException(status_code=404, detail=f"User {name} not found") + + +@app.post( + "/{collection_name}/users", + response_description="Add new user", + response_model=UserModel, + status_code=status.HTTP_201_CREATED, + response_model_by_alias=False, +) +async def create_user(collection_name: str, user: UserModel = Body(...)): + """ + Insert a new user record. + + A unique `id` will be created and provided in the response. + """ + collection = db.get_collection(collection_name) + new_user = await collection.insert_one( + user.model_dump(by_alias=True, exclude=["id"]) + ) + created_user = await collection.find_one({"_id": new_user.inserted_id}) + return created_user diff --git a/mongo-sharding-repl/api_app/requirements.txt b/mongo-sharding-repl/api_app/requirements.txt new file mode 100644 index 00000000..6dde742d --- /dev/null +++ b/mongo-sharding-repl/api_app/requirements.txt @@ -0,0 +1,6 @@ +fastapi==0.110.2 +uvicorn[standard]==0.29.0 +motor==3.5.0 +redis==4.4.2 +fastapi-cache2==0.2.0 +logmiddleware==0.0.4 \ No newline at end of file diff --git a/mongo-sharding-repl/compose.yaml b/mongo-sharding-repl/compose.yaml new file mode 100644 index 00000000..f436d572 --- /dev/null +++ b/mongo-sharding-repl/compose.yaml @@ -0,0 +1,233 @@ +version: '3' + +services: + pymongo_api: + container_name: pymongo_api + build: + context: api_app + dockerfile: Dockerfile + image: kazhem/pymongo_api:1.0.0 + depends_on: + - mongos_router + ports: + - 8080:8080 + environment: + MONGODB_URL: "mongodb://mongos_router:27020" + MONGODB_DATABASE_NAME: "somedb" + networks: + app-network: + ipv4_address: 173.17.0.2 + + mongos_router: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: mongos_router + restart: always + ports: + - "27020:27020" + networks: + app-network: + ipv4_address: 173.17.0.7 +# volumes: +# - router-data:/data/db + command: + [ + "mongos", + "--configdb", + "config_server/configSrv:27017", + "--bind_ip_all", + "--port", + "27020" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + configSrv: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: configSrv + restart: always + ports: + - "27017:27017" + networks: + app-network: + ipv4_address: 173.17.0.10 + volumes: + - config-data:/data/db + command: + [ + "--configsvr", + "--replSet", + "config_server", + "--bind_ip_all", + "--port", + "27017" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard1: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard1 + restart: always + ports: + - "27018:27018" + networks: + app-network: + ipv4_address: 173.17.0.9 + volumes: + - shard1-data:/data/db + command: + [ + "--shardsvr", + "--replSet", + "shard1", + "--bind_ip_all", + "--port", + "27018" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard1_2: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard1_2 + restart: always + ports: + - "27021:27021" + networks: + app-network: + ipv4_address: 173.17.0.11 + volumes: + - shard1_2-data:/data/db + command: + [ + "--replSet", + "shard1", + "--bind_ip_all", + "--port", + "27021" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard1_3: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard1_3 + restart: always + ports: + - "27022:27022" + networks: + app-network: + ipv4_address: 173.17.0.12 + volumes: + - shard1_3-data:/data/db + command: + [ + "--replSet", + "shard1", + "--bind_ip_all", + "--port", + "27022" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard2: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard2 + restart: always + ports: + - "27019:27019" + networks: + app-network: + ipv4_address: 173.17.0.8 + volumes: + - shard2-data:/data/db + command: + [ + "--shardsvr", + "--replSet", + "shard2", + "--bind_ip_all", + "--port", + "27019" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard2_2: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard2_2 + restart: always + ports: + - "27023:27023" + networks: + app-network: + ipv4_address: 173.17.0.13 + volumes: + - shard2_2-data:/data/db + command: + [ + "--replSet", + "shard2", + "--bind_ip_all", + "--port", + "27023" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + + shard2_3: + image: dh-mirror.gitverse.ru/mongo:latest + container_name: shard2_3 + restart: always + ports: + - "27024:27024" + networks: + app-network: + ipv4_address: 173.17.0.14 + volumes: + - shard2_3-data:/data/db + command: + [ + "--replSet", + "shard2", + "--bind_ip_all", + "--port", + "27024" + ] + healthcheck: + test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ] + interval: 5s + start_period: 10s + +volumes: + config-data: + router-data: + shard1-data: + shard1_2-data: + shard1_3-data: + shard2-data: + shard2_2-data: + shard2_3-data: + +networks: + app-network: + driver: bridge + ipam: + driver: default + config: + - subnet: 173.17.0.0/16 diff --git a/mongo-sharding-repl/scripts/mongo-init.sh b/mongo-sharding-repl/scripts/mongo-init.sh new file mode 100644 index 00000000..b496cddd --- /dev/null +++ b/mongo-sharding-repl/scripts/mongo-init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +### +# Инициализируем бд +### + +docker compose exec -T mongodb1 mongosh < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ec2bc3a57a71ffb42b99303bbee8aca0af6bb4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=91=D0=B5=D0=BB=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 13:03:28 +0300 Subject: [PATCH 2/3] task 6 --- sharding-repl-cache/README.md | 38 +- sharding-repl-cache/task6.drawio | 975 +++++++++++++++++++++++++++++++ task1.drawio | 425 -------------- 3 files changed, 992 insertions(+), 446 deletions(-) create mode 100644 sharding-repl-cache/task6.drawio delete mode 100644 task1.drawio diff --git a/sharding-repl-cache/README.md b/sharding-repl-cache/README.md index e6ff22a8..01a0ce8f 100644 --- a/sharding-repl-cache/README.md +++ b/sharding-repl-cache/README.md @@ -1,10 +1,12 @@ -# Задание 1 +[Схема](task6.drawio) -# Задание 2 +# Запуск приложения -## Шардирование +```bash +docker-compose up -d +``` -### Инициализация сервера конфигурации +# Инициализация сервера конфигурации ```bash docker-compose exec -it configSrv mongosh --port 27017 @@ -22,9 +24,9 @@ rs.initiate( ); ``` -### Инициализаци реплик +# Инициализаци реплик -#### Шард 1 +## Шард 1 ```bash docker-compose exec -it shard1 mongosh --port 27018 @@ -38,7 +40,7 @@ rs.initiate({_id: "shard1", members: [ ]}) ``` -#### Шард 2 +## Шард 2 ```bash docker-compose exec -it shard2 mongosh --port 27019 @@ -53,7 +55,7 @@ rs.initiate({_id: "shard2", members: [ ``` -### Инициализация роутера +# Инициализация роутера ```bash docker-compose exec -it mongos_router mongosh --port 27020 @@ -87,9 +89,9 @@ for(var i = 0; i < 1000; i++) db.helloDoc.insert({age:i, name:"ly"+i}) db.helloDoc.countDocuments() ``` -### Проверка в шардах +# Проверка в шардах -#### Шард 1 +## Шард 1 ```bash docker-compose exec -it shard1 mongosh --port 27018 @@ -100,7 +102,7 @@ use somedb; db.helloDoc.countDocuments(); ``` -##### Реплика 2 +### Реплика 2 ```bash docker-compose exec -it shard1 mongosh --port 27021 @@ -111,7 +113,7 @@ use somedb; db.helloDoc.countDocuments(); ``` -##### Реплика 3 +### Реплика 3 ```bash docker-compose exec -it shard1 mongosh --port 27022 @@ -122,7 +124,7 @@ use somedb; db.helloDoc.countDocuments(); ``` -#### Шард 2 +## Шард 2 ```bash docker-compose exec -it shard2 mongosh --port 27019 @@ -133,7 +135,7 @@ use somedb; db.helloDoc.countDocuments(); ``` -##### Реплика 2 +### Реплика 2 ```bash docker-compose exec -it shard2 mongosh --port 27023 @@ -144,7 +146,7 @@ use somedb; db.helloDoc.countDocuments(); ``` -##### Реплика 3 +### Реплика 3 ```bash docker-compose exec -it shard2 mongosh --port 27024 @@ -155,11 +157,5 @@ use somedb; db.helloDoc.countDocuments(); ``` -### Запуск приложения - -```bash -docker-compose up -d pymongo_api -``` - Проверка [http://localhost:8080/](http://localhost:8080/) diff --git a/sharding-repl-cache/task6.drawio b/sharding-repl-cache/task6.drawio new file mode 100644 index 00000000..b2505a26 --- /dev/null +++ b/sharding-repl-cache/task6.drawio @@ -0,0 +1,975 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/task1.drawio b/task1.drawio deleted file mode 100644 index 2d4c83b0..00000000 --- a/task1.drawio +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 87e2af8f9b4ac005612dd26ad821b4395c8d9feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=91=D0=B5=D0=BB=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 13:04:55 +0300 Subject: [PATCH 3/3] task 6 --- README.md | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/README.md b/README.md index b6ddb826..c0ee5811 100644 --- a/README.md +++ b/README.md @@ -1,35 +1 @@ -# pymongo-api - -## Как запустить - -Запускаем mongodb и приложение - -```shell -docker compose up -d -``` - -Заполняем mongodb данными - -```shell -./scripts/mongo-init.sh -``` - -## Как проверить - -### Если вы запускаете проект на локальной машине - -Откройте в браузере http://localhost:8080 - -### Если вы запускаете проект на предоставленной виртуальной машине - -Узнать белый ip виртуальной машины - -```shell -curl --silent http://ifconfig.me -``` - -Откройте в браузере http://:8080 - -## Доступные эндпоинты - -Список доступных эндпоинтов, swagger http://:8080/docs \ No newline at end of file +см [последний вариант](./sharding-repl-cache/README.md) \ No newline at end of file