Тип сервиса
Сервис MongoDB
Самостоятельно размещаемая база данных MongoDB для приложений, которые хранят JSON-подобные документы внутри стека и выполняют к ним запросы.
Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.
В StackMaster
Как MongoDB работает в StackMaster
Database, user and passwords
Wodby manages the database and its user; the application does not create them.
- One database and one user are created for the environment, both named after the application and the environment.
- The user is created in the
admindatabase and has thereadWriterole on the environment's database only. A client therefore authenticates againstadmin(authSource=admin), not against the application database. Authenticating against the application database is the usual reason a correct password is refused. - Wodby creates the database by creating a collection named
__wodbyin it. Leave that collection in place. - The administrator is
root(MONGO_INITDB_ROOT_USERNAME,MONGO_INITDB_ROOT_PASSWORDin the container). Its password and the user's password are generated once per environment (tokensroot_passwordandpassword). - Creating the user is safe to repeat. A user of the same name that accepts the generated password is kept. One with a different password is left unchanged and the creation fails, so a password changed inside MongoDB is never reset.
How a linked service reaches it
- Host: the name of this app service inside the environment. Port:
27017. - A service linked to this one receives the connection details as environment variables defined by its own link. Read those in the application; do not hardcode them and do not use
rootfrom the application. - A connection URL that Wodby builds for a link already carries
authSource=admin. A URL assembled in the application from host, port, user and password has to add it.
Data, backups and imports
- Data is on the
datavolume, mounted at/data/db. The service runs a single instance. - The backup is a
.tar.gzholding a gzippedmongodumparchive of the environment's database and a restore script. - The database import takes a
.tar.gzor.tgzbackup made by this service. - The manifest declares no configuration settings; the server runs with the image's defaults.
Check the result
In the database container, mongosh --quiet -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin --eval 'db.adminCommand({listDatabases: 1})' lists the databases.
Обзор
Технический профиль MongoDB
Версии
Репозиторий исходного кода
Публичный Helm-чарт
Постоянные тома
Страница базы данных
Стеки
Стеки, в которые входит MongoDB
Данные
Резервные копии и импорт данных: MongoDB
Резервные копии вручную и по расписанию
Создавайте резервную копию, когда она нужна, или задайте расписание в пресете резервного копирования.
Импорт из архива, по URL или из резервной копии
Источником импорта может быть загруженный архив, публичный URL или готовая резервная копия совместимого сервиса.
Где хранятся архивы
StackMaster записывает каждый архив в StackMaster Blob Storage или в бакет у провайдера хранилища, подключённого как интеграция.
Конфигурация
Конфигурация сервиса MongoDB
Тома