关于 Raspberry Pi 的讨论 | 博客

我一直在尝试在树莓派 4 上运行 discourse,但几个月来一直没有成功。

看起来可能是 docker 镜像已过时,所以我卸载并重新安装了另外两个 docker 镜像,但仍然没有成功。

有什么建议吗?

1 个赞

是的,在您的 Pi 上安装 arm64 发行版。

Raspberry Pi 基金会花了几年时间才发布正确的软件架构,因为他们仍在为 32 位硬件开发。请将您的映像更改为当前的 arm64 版本。好消息是,如果那是您的设备,它将允许您使用全部 8GB 内存。

1 个赞

我似乎已经在运行 arm64,但它不起作用。

1 个赞

您应该确认您正在运行的内容。

cat /proc/cpuinfo

1 个赞

呼,数据量真大,而且说实话,很多都不熟悉。哪一行指定了我正在运行的内容?

1 个赞

我认为
uname -a
应该会有帮助。

2 个赞

谢谢!
结果:
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

1 个赞

嗯,那是一个 64 位 (aarch64) 内核,但你却收到了关于 armv8 的 docker 消息。我对这个领域不太了解,也不知道你是如何走到这一步的……一个常见的建议是进行安全备份,然后恢复到一个全新的操作系统和全新的 discourse 安装中。

我希望成功安装后在升级时不会遇到麻烦。

1 个赞

你的 docker info 的输出是什么?
特别是显示 Architecture: 的那一行。

1 个赞

CPU 架构:8

1 个赞

哈哈,我以前做过很多次了,而且准备再做一次。

目前,我使用的是运行 Bullseye 64 lite 的 Raspberry Pi 400 Rev 1.0。
我尝试过 Bullseye 64、64 lite、32 lite;以及 Bookworm 64。如果我没记错的话,在每种情况下我都会收到我发布的相同错误。

经过一番研究,一位朋友建议重新刷写到 Bullseye 64 lite,这样应该可以解决问题。但它没有。

另外,当我运行 docker sudo docker run hello-world 时,它会产生预期的“Docker is working”消息。

1 个赞

不是那个 :stuck_out_tongue: 。请粘贴全部输出。

3 个赞

sudo docker info
Client: Docker Engine - Community
Version: 24.0.7
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.21.0
Path: /usr/libexec/docker/cli-plugins/docker-compose

Server:
Containers: 2
Running: 1
Paused: 0
Stopped: 1
Images: 4
Server Version: 24.0.7
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dd1e886e55dd695541fdcd67420c2888645a495
runc version: v1.1.10-0-g18a0cb0
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.21-v8+
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.705GiB
Name: raspberrypi
ID: 183a2a7a-8acf-40eb-9386-c99d70ee8ed3
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support

1 个赞

在 Raspberry Pi 4(8GB 内存)和通过 USB 连接的 SSD(作为唯一驱动器)上无法启动。它一直卡在以下位置(或者至少我在等待一个小时后感到不耐烦……)

I, [2024-02-06T00:58:51.743994 #1]  INFO -- : cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
warning "@discourse/lint-configs > eslint-plugin-ember > ember-eslint-parser@0.2.5" has unmet peer dependency "@typescript-eslint/parser@^6.15.0".
warning "@discourse/lint-configs > eslint-plugin-ember > ember-eslint-parser@0.2.5" has incorrect peer dependency "typescript@^5.3.3".
warning "> @glint/environment-ember-loose@1.3.0" has unmet peer dependency "@glimmer/component@^1.1.2".
2024-02-06 01:15:58.966 UTC [64] WARNING:  worker took too long to start; canceled
2024-02-06 01:16:19.640 UTC [480] WARNING:  autovacuum worker started without a worker entry
2024-02-06 01:21:46.504 UTC [64] WARNING:  worker took too long to start; canceled
2024-02-06 01:22:18.863 UTC [481] WARNING:  autovacuum worker started without a worker entry

它似乎仍在运行:

Tasks:  60 total,   7 running,  53 sleeping,   0 stopped,   0 zombie
%Cpu(s): 20.8 us, 60.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi, 18.8 si,  0.0 st
MiB Mem :   7807.7 total,   6783.7 free,    954.0 used,     70.0 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   6853.8 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   3422 root      20   0 1928888  33180   2512 S  40.6   0.4  28:18.52 dockerd
   9922 root      20   0 1105300   9984   2944 S  30.2   0.1   1:02.72 docker
   3362 root      20   0 1934276  19060   1408 S  20.8   0.2  20:24.57 containerd
   9416 ubuntu    20   0 1148560 298160      0 R  12.0   3.7  10:03.66 node
   9158 dnsmasq   20   0   54992   2432    128 R  11.7   0.0   5:01.56 redis-server
   8997 root      20   0 1238120   5704    256 S  10.7   0.1   9:06.51 containerd-shim
   9504 ubuntu    20   0  569128  51532      0 R   8.8   0.6   5:20.97 node
   9930 pollina+  20   0  353212   5692   3328 R   6.8   0.1   0:06.97 postmaster
   9931 pollina+  20   0  352820   4156   2048 R   5.2   0.1   0:02.70 postmaster
   9098 pollina+  20   0  352844   3004   1024 R   2.3   0.0   0:15.75 postmaster
    219 root      20   0 1259732  36000  20352 S   1.0   0.5   1:10.50 cloudflared
   9658 root      20   0    9116   4864   2816 R   0.6   0.1   0:18.19 top

如果编译包含进度条就好了。

最好的方法是什么:

  • 找出它在做什么?
  • 安全地关闭它以重试?我之前尝试过 sudo shutdown --reboot 0,但这会破坏 postgres 数据库,我不得不重新设置机器。
1 个赞

您可以搜索您收到的消息,并与论坛和互联网进行比较。另外,请尝试将其移至新帖子,而不是回复公告。

在搜索框中输入它,您将看到结果。再次将您发布的内容与论坛和互联网进行比较;应该能为您提供大量信息。
https://meta.discourse.org/search?q=has%20unmet%20peer%20dependency

1 个赞

该步骤不是编译步骤,只是下载 JS 文件。它包含数量惊人的小文件,所以我想这是你正在使用的不寻常存储解决方案的一个病态的糟糕案例?

7 个赞

好的,那我让它运行几天。否则,我想我需要用 SSD 替换 RPi4,改用 RPi5 和 SSD。

更新:

几个小时后,经过更多的阅读,我决定将 lxd 容器从使用 btrfs 存储池更改为使用 zfs 存储池。完成后,它在大约 5 分钟内就能够继续进行(而在使用 btrfs 时,它会挂起大约一个小时,然后工作程序就会开始失败)。

它仍在构建中,但一旦完成,并且我能够成功导入备份并解决 Cloudflare SSL 问题,我将发布我从运行在 Scaleway 上的 discourse docker 迁移到运行在 Raspberry Pi 4 + SSD 上的 lxd 容器内的 discourse docker 的过程。

更新 2:

4 个赞

你为什么使用裸金属实例?

1 个赞

@Falco 来得有点晚,但我遇到了同样的问题。

我按照 Pi 5 上的安装指南进行操作,运行的是 arm64。有什么办法可以解决这个问题吗?

1 个赞

您正在运行什么操作系统?