# 重建悬挂

**URL:** https://meta.discourse.org/t/rebuild-hanging/304278
**Category:** Self-hosting
**Created:** [2024年四月17日 11:31 UTC](https://meta.discourse.org/t/rebuild-hanging/304278 "2024-04-17T11:31:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [2024年四月17日 11:31 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/1 "2024-04-17T11:31:19Z")

</div>

我已经卡在这里一个多小时了：

```plaintext
I, [2024-04-17T09:57:04.110084 #1] INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake assets:precompile:build'
97:M 17 Apr 2024 10:01:01.012 * 100 changes in 300 seconds. Saving...
97:M 17 Apr 2024 10:01:01.012 * Background saving started by pid 3733
3733:C 17 Apr 2024 10:01:01.026 * DB saved on disk
3733:C 17 Apr 2024 10:01:01.027 * Fork CoW for RDB: current 1 MB, peak 1 MB, average 0 MB
97:M 17 Apr 2024 10:01:01.112 * Background saving terminated with success
97:M 17 Apr 2024 10:56:01.848 * Replication backlog freed after 3600 seconds without connected replicas.

```

服务器有 64GB 内存，我认为不是内存问题，尽管在容器中我按照设置建议指定了 `db_shared_buffers: "4096MB"`。

有什么想法是什么原因造成的？如何排查？如何修复？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024年四月17日 12:29 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/2 "2024-04-17T12:29:25Z")

</div>

这很奇怪。我想我会按 Ctrl+C 再次尝试。

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [2024年四月17日 12:54 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/3 "2024-04-17T12:54:26Z")

</div>

谢谢 Jay，我等了两个小时并完成了操作（这是一个存档论坛，所以我不太在意停机时间）。

我唯一做的不一样的地方是，我添加了 `- git clone https://github.com/discourse/discourse-calendar`，但注意到它末尾没有 `.git` - 不确定这是否有任何区别。

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [2024年五月3日 03:52 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/4 "2024-05-03T03:52:02Z")

</div>

自从出现此问题以来，我们现在遇到了服务器方面的问题。当这种情况首次发生时，我们注意到服务器上的其他 Ruby 网站无法访问。这种情况发生了两次，相隔几天，重启解决了问题（这些网站使用 discourse 身份验证）。它又发生了，但这次有两个 discourse 论坛也出现了 `504 Gateway Time-out`。

我注意到其他人也遇到了类似的重建挂起问题，我想知道 Discourse 最近是否有什么变化会与此相关？Discourse 是否会更改容器外部的任何内容，例如系统 Ruby？这很奇怪 😕

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024年五月3日 09:34 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/5 "2024-05-03T09:34:31Z")

</div>

昨天有一个修复程序，可以让低内存服务器以更奇怪/更快的速度重建，但我认为它可能不起作用，因为它测试的是 2GB 内存，而您的问题很可能是您拥有超过 2GB 内存，但所有内存都被服务器上的其他东西占用了。

我猜您只是需要更多内存。

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [2024年五月3日 17:21 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/6 "2024-05-03T17:21:45Z")

</div>

服务器有 64GB RAM Jay，并且每个 DC 实例都配置了 `db_shared_buffers: \"4096MB\"`。

此外，这些进一步的问题并非在重建时出现，但似乎是原始问题的遗留。

我将清理 docker `./launcher cleanup` 以查看是否有帮助，但在此期间，如果您或其他人有其他想法，将不胜感激。

**编辑** ：运行 `docker container ls -a` 后，我注意到一些奇怪的事情，[将在此发布新主题](https://meta.discourse.org/t/what-is-the-cool-kepler-docker-image/306669) 讨论它。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024年六月2日 17:21 UTC](https://meta.discourse.org/t/rebuild-hanging/304278/7 "2024-06-02T17:21:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
