# 在新“本地”虚拟机上恢复备份文件后 - 站点无法运行

**URL:** <https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399>\
**Category:** Self-hosting\
**Created:** [2021年八月14日 11:51 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399 "2021-08-14T11:51:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月14日 11:51 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/1 "2021-08-14T11:51:44Z")

</div>

你好，

我从云实例中恢复了一个备份文件。将其恢复到我的 Debian 服务器后，页面的 URL 和标题可以正常显示，但登录页面却是空白的。

- “安全模式”无法生效。
- 已清理浏览器缓存。
- 我已重新构建应用，但问题依旧。

您是否有任何建议，看看还能做些什么？

根据浏览器控制台，已报告以下错误：

 ![report](https://global.discourse-cdn.com/meta/original/3X/7/d/7d334b21ac1fde56e7d7098883e42895953ff077.jpeg)

我也检查了生产日志，发现与 REDIS 服务器的连接似乎无法建立。

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/d/ddd18f00097f4dfadd8507a15e0e368f086db51b.jpeg)

我已删除容器，重启了虚拟机，并重新安装了 Discourse。但随后收到了以下错误：

Docker: driver failed programming external connectivity on endpoint app …

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/7/77a8ea03de744bbe4a177a80849664b8d7e7238e.jpeg)

感谢您的建议。

I.

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月14日 17:59 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/2 "2021-08-14T17:59:33Z")

</div>

您可能在 80 端口上有服务正在监听（例如 nginx）？

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 11:31 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/3 "2021-08-15T11:31:05Z")

</div>

我已停止 nginx 并重新构建了应用。

根据生产日志，REDIS 无法工作：

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/1/c182a9d286305d8cb9b427ff1cc71ffdbcc51219.jpeg)

您有什么建议吗？我已经尝试过重启、重新构建、销毁容器并重新拉取镜像等操作，但都没有效果……

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 11:55 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/4 "2021-08-15T11:55:49Z")

</div>

🤔 `sudo systemctl status redis`？

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:18 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/5 "2021-08-15T13:18:42Z")

</div>

未找到 Redis …

![image](https://global.discourse-cdn.com/meta/original/3X/0/6/064ce278f7e3fd4c022be1752dd85b6e89210d01.png)

如何正确在 Discourse 容器中启动 Redis？

如果我尝试启动它，却无法成功：

![image](https://global.discourse-cdn.com/meta/original/3X/f/3/f37815a7b7b74b04e5064706e6f39c7aeab05f41.png)

此致

I.

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:30 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/7 "2021-08-15T13:30:58Z")

</div>

我最初曾借助教程成功安装过。但在从 Discourse 托管商恢复备份后，页面只显示为空白。自那以后，我就无法再安装它了……

可能是我的多次重启或重建操作导致虚拟机本身崩溃了。

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 13:32 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/9 "2021-08-15T13:32:45Z")

</div>

> [@ITAS-Isti](#):
>
> 再次安装了 Discourse

你是怎么做的？  
再次运行 `./discourse-setup` 吗？

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:34 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/11 "2021-08-15T13:34:46Z")

</div>

Debian 10.5（Buster）

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:35 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/12 "2021-08-15T13:35:26Z")

</div>

我当然已经做过很多次了。

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:37 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/13 "2021-08-15T13:37:34Z")

</div>

我认为问题在于 Redis 已无法正常工作，而我不知如何启动它。  
我已经拉取了 Discourse 容器，但并未奏效。

我想：  
销毁容器，  
删除目录，  
从 Git 重新拉取容器，  
然后从头开始重新配置……

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 13:47 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/14 "2021-08-15T13:47:18Z")

</div>

如您所见，我已将其简化到极致：

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/d/adac5845add11358c7dad0926c7b4e16755f2c62.jpeg)

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 13:50 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/15 "2021-08-15T13:50:14Z")

</div>

确实，我以为 discourse-setup 会自动处理 Redis 的安装 🤔 不过，你可以尝试手动安装，并参考以下操作：[discourse\_docker/image/base/install-redis at main · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/blob/main/image/base/install-redis)

你的截图下方显示了什么？  
运行 `./discourse-setup` 后是否出现任何错误？

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 14:04 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/16 "2021-08-15T14:04:23Z")

</div>

安装的最终结果是：

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/6/e69f1e4a9b9c34a9ce8aabe63f604ffd3ac6e948.jpeg)

我将尝试手动安装 Redis…

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 14:05 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/17 "2021-08-15T14:05:38Z")

</div>

看来 Redis 在这里没问题：思考

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 14:08 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/18 "2021-08-15T14:08:47Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/a/8/a8d1c39bd50bc4d30072d5a4a35ff2f9b18bd77f.png)

Discourse 现在应该可以工作了！（实际上不行）

Docker 看起来没问题：

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/8/4825460598d179f9202c82e6ca8d9bb901db9a62.jpeg)

根据 “.launcher logs app” 的输出，问题应该出在证书上……：

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/a/aae2185e3d6b1e541dd9d28ab935ca084d34de9d.jpeg)

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 14:37 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/19 "2021-08-15T14:37:53Z")

</div>

抱歉，我在 systemctl 检查上犯了个错误。主机上确实安装了 Redis，但用于其他目的；您要找的 Redis 是安装在容器中的。

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 14:40 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/21 "2021-08-15T14:40:33Z")

</div>

好的，一个方案是获取一台新的 Ubuntu 虚拟机（不过对我们研究所来说，成本相当高）。  
我认为目前这是最佳方案，对吧？

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年八月15日 14:42 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/22 "2021-08-15T14:42:08Z")

</div>

这可能来自你的 app.yml，你那里的内容是什么？

```plaintext
## 如果你希望添加 Lets Encrypt (https)，请取消这两行的注释
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"

```

你可能也触发了 Lets Encrypt 的续订限制……

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 14:51 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/26 "2021-08-15T14:51:04Z")

</div>

不，我在这里是“root”。这是内部虚拟机，目前没有公开访问权限。

---

<div class="post-metadata">

**Author:** ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)\
**Post date:** [2021年八月15日 15:03 UTC](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399/27 "2021-08-15T15:03:39Z")

</div>

谢谢，这正是解决方案…… 🙂

现在我可以访问 GUI 了。我很好奇，如果备份恢复导致系统再次崩溃该怎么办。

从另一台服务器成功恢复前，需要做哪些准备工作？

[下一頁](https://meta.discourse.org/t/after-recoverying-a-backup-file-on-new-on-premise-vm-site-no-longer-works/200399.md?page=2)
