Apache Casbin Gateway
5. 运维

5.3 备份与云同步

备份

一份备份就是配置的一个快照,写在数据库旁边而不是数据库里面,所以它比它来源的那个数据库活得更久。

设置→备份:

  • 打开它,并设定频率。
  • 备份存放位置是快照写入的目录。把它指向Dropbox、OneDrive、iCloud Drive或NAS已经在同步的文件夹,每份备份写出来就顺带上传了。
  • 面板会显示上一次和下一次备份,上一次失败时也会说。
  • 恢复把某一份还原回去,删除移除某一份。

每次导入之前也会自动拍一份(3.5),所以从CC Switch搬过来这件事是可以撤销的。

云同步

把每份备份再存一份到这台机器之外。设置→云同步:

目标适用
WebDAVNextcloud、ownCloud、群晖、威联通,以及大多数NAS固件
S3S3本身、Cloudflare R2、Backblaze B2、MinIO、阿里云OSS、腾讯云COS

WebDAV这边,大多数服务要的是应用专用密码,而不是你登录用的那个。

快照是不可变文件,所以同步没有什么可合并的:两边最后各自都拿到了对方有的东西,其中任何一份都可以从备份面板的列表里还原。

导入与导出

设置→导入与导出是把配置作为一个文件:要搬到另一台机器上的,和要从那边读回来的。

配一台新机器成这台的样子,走这条路;把这台机器救回来,走备份。

快照带走的是:供应商、连接、Agent及其路由与权限、探测用例、模型价格、设置——每一项都是可以单独去掉的分区。密钥是单独的一个勾选项,决定这些分区里的凭据要不要一起走;不带密钥的快照描述的是一份还不能跑流量的配置,落地后每个密钥都要重新填。

恢复到另一台机器上的连接,会按那台机器的Gateway端口和程序路径写进它的Agent,而不是取快照时的那一套。

下一节:5.4 Docker与Podman。

在GitHub上编辑
Apache Incubator

Apache Casbin (Incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright © 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.

Apache, Apache Casbin, the names of Apache projects, and the feather logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

本页内容