登录
ZH▾
语言
下载
测试版 此语言为测试版:由 AI 翻译和检查,尚未经过母语人士审校。 此页面尚未翻译,因此以英文显示。
文档 › 运行 MCDock

数据库和备用服务器

默认使用 SQLite,生产环境使用带备用服务器的 PostgreSQL。

Choosing

  • SQLite: one server, up to a few hundred users. Nothing to install.
  • PostgreSQL: production, a standby MCDock server, replicas and point-in-time recovery run by IT.

Moving

IT admin → Database. Every move takes a server backup, copies all records, reads them back and compares, then switches. The old copy is kept. If any step fails, nothing changes, and Git keeps working during the move.

Setting up PostgreSQL

On the database server (PostgreSQL 14 or later):

CREATE ROLE mcdock LOGIN PASSWORD '<strong password from the vault>';
CREATE DATABASE mcdock OWNER mcdock ENCODING 'UTF8';
  • Allow the MCDock servers in pg_hba.conf with scram-sha-256 and turn on TLS.
  • Connection string (no password in it): host=db1.company.local port=5432 dbname=mcdock user=mcdock sslmode=verify-full
  • The password goes in the password field and is stored sealed.

When the database stops answering

Pages show a red banner. Reading, clone and pull keep working, saving pauses, and MCDock reconnects by itself. Use Database → Diagnose, then Fix the connection if the password changed.

更新于 2026/11/20 · 缺少内容?请在此提问: 社区.