This commit is contained in:
2026-04-25 16:36:34 +08:00
commit db90e7579b
1876 changed files with 189777 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"label": "运维操作",
"position": 15
}

View File

@@ -0,0 +1,22 @@
---
sidebar_position: 1
title: 数据库管理
---
`tailchat` 使用 mongodb 作为主要数据库存储用户信息
`docker`中,常见的运维命令如下:
```bash
# 备份
docker exec -i <IMAGE_NAME> mongodump -d tailchat --archive > ./backup.archive
# 还原
docker exec -i <IMAGE_NAME> mongorestore -d tailchat --archive < ./backup.archive
```
其中`<IMAGE_NAME>` 表示mongodb镜像名`-d tailchat` 表示使用的数据库的名字,默认启动的数据库名为`tailchat`, 你可以通过环境变量`MONGO_URL`进行修改
:::info
为了用户数据安全,建议创建定时任务定期备份数据库文件
:::