大家好,Discourse 的朋友们!
我成功在 LXD/LXC 中搭建了 Discourse,想请教一下,有什么推荐的启动守护进程的方法吗?
是否有比以下命令更好的“方法”来启动它:
bundle exec rails s -b 0.0.0.0 2>&1 > /var/log/discourse.log
如何使用 systemd 来实现这一点?提前感谢。
此致,
来自德国的 Ingo Baab
大家好,Discourse 的朋友们!
我成功在 LXD/LXC 中搭建了 Discourse,想请教一下,有什么推荐的启动守护进程的方法吗?
是否有比以下命令更好的“方法”来启动它:
bundle exec rails s -b 0.0.0.0 2>&1 > /var/log/discourse.log
如何使用 systemd 来实现这一点?提前感谢。
此致,
来自德国的 Ingo Baab
If you want to install Discourse in anything resembling a production environment, you should follow the cloud install instructions. discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub
Thank you for this answer, Jay, but I am happy with my installation. Works fine inside Linuxcontainer… (I do not like docker at all…)
There are a zillion ways that you might install Discourse that can all work just fine, but only one is supported here.
Hi,
how to install it using LCX container. I dont want to use docker, because I use proxmox to manage VMs and docker cant be installed in LCX container.
You would be entering uncharted territory and would need to build something that you alone support. The code for discourse docker is open so you could adapt it, I guess.
You mean an LXC container? I know someone who worked for canonical and had a lot to do with LXC. He uses docker now.
I just installed Discourse in a Docker container inside an LXD container, which may seem weird but it’s something LXD was intentionally designed to support.
How to Install Discourse in an LXD / Docker Container
If you encounter problems with Docker / Discourse failing to run in LXD then you’ll likely need to tweak some settings in your host’s /etc/sysctl.conf namely:
kernel.keys.maxkeys=2000
kernel.keys.maxbytes=200000
net.ipv4.tcp_mem=182757 243679 365514
net.core.netdev_max_backlog=182757
These are production values for LXD and for me they were neccessary to get Discourse running.
你能把这份指南发到其他地方吗?该网站阻止了我访问,我也想安装在 LXC ProxMox 上的 Discourse。
我在树莓派 4 的 Ubuntu 服务器上尝试通过 LXD 运行 Discourse,并使用 USB SSD。在重建过程中,它会挂起并超时。使用 btrfs 回环存储池时挂起更严重/更早,使用 zfs 回环存储池时挂起稍晚。内存占用稳定在 1GB 左右,峰值达到 3GB。挂起时 SSH/top 仍然响应,但所有使用活动都会下降到可忽略的水平,表明它已放弃。
如今,LXD 文档仅建议将 security.nesting 设置为字符串值 true 来启用 Docker 使用,我就是这样做的。然而,LXD 文档还有一个关于生产环境配置的页面,其中包含大约 20 个需要更改的设置,我还没有尝试过。
最后,我放弃了在 LXD 中运行 Discourse 的尝试,而是在同一台机器上通过 Docker 运行 Discourse。
我的努力细节如下:
奇怪的是,下面的 LXD Docker 指南推荐使用 btrfs,尽管LXD 文档不推荐它,并且似乎没有为它使用分区(但他们设置了一些额外的设置,安装了 docker.io 以外的其他软件包,并将 btrfs 卷仅附加到 Docker),所以我很想知道为什么我遇到了这些问题:
@vmsman 你能分享更多关于你的 LXD 设置的细节吗?例如配置文件、存储池以及需要更改的任何系统设置,因为你似乎拥有迄今为止最成功的设置:
对于 LXD,我有一些疑问:
总而言之,尽管没有在 LXD 中成功运行 Discourse,但我对 LXD 及其易用性印象深刻。我之前花了几个月的时间在 HashiCorp 上挣扎,因为 HashiCorp 似乎只对企业用例感兴趣。而 LXD 则能正常工作,而且人们似乎足够支持,能够让小型团队和独立开发者取得进展。