ingobaab
(Ingo Baab)
2018 年2 月 4 日 13:38
1
Hello Discourse Friends!
I managed to setup discourse inside a LXD/LXC and want to ask, is there a recommendation how to start the deamon process?
Is there a better ‘method’ than starting it with:
bundle exec rails s -b 0.0.0.0 2>&1 > /var/log/discourse.log
How can this be done with systemd? Thank you in advance.
Kind Regards,
Ingo Baab from Germany
2 个赞
pfaffman
(Jay Pfaffman)
2018 年2 月 4 日 15:57
2
If you want to install Discourse in anything resembling a production environment, you should follow the cloud install instructions. https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md
2 个赞
ingobaab
(Ingo Baab)
2018 年2 月 4 日 17:23
3
Thank you for this answer, Jay, but I am happy with my installation. Works fine inside Linuxcontainer… (I do not like docker at all…)
2 个赞
pfaffman
(Jay Pfaffman)
2018 年2 月 4 日 17:27
4
There are a zillion ways that you might install Discourse that can all work just fine, but only one is supported here.
9 个赞
madbox
(madbox)
2018 年11 月 20 日 11:22
5
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.
1 个赞
sam
(Sam Saffron)
2018 年11 月 21 日 22:44
6
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.
1 个赞
pfaffman
(Jay Pfaffman)
2018 年11 月 22 日 03:27
7
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.
3 个赞
Can you send this guide somewhere else? The site is blocking access for me, and I would also like to install discourse on LXC ProxMox
1 个赞
That’s wrong
Just follow the next post from the link above
edit: I installed Discourse the official way inside a LXC container this way
4 个赞
balupton
(Benjamin Lupton)
2024 年2 月 7 日 01:41
12
我在树莓派 4 的 Ubuntu 服务器上尝试通过 LXD 运行 Discourse,并使用 USB SSD。在重建过程中,它会挂起并超时。使用 btrfs 回环存储池时挂起更严重/更早,使用 zfs 回环存储池时挂起稍晚。内存占用稳定在 1GB 左右,峰值达到 3GB。挂起时 SSH/top 仍然响应,但所有使用活动都会下降到可忽略的水平,表明它已放弃。
如今,LXD 文档 仅建议将 security.nesting 设置为字符串值 true 来启用 Docker 使用,我就是这样做的。然而,LXD 文档还有一个关于生产环境配置 的页面,其中包含大约 20 个需要更改的设置,我还没有尝试过。
最后,我放弃了在 LXD 中运行 Discourse 的尝试,而是在同一台机器上通过 Docker 运行 Discourse。
我的努力细节如下:
Here the documentation of my mishaps and my eventual success getting a discourse instance migrated from scaleway to a raspberry pi 4, with cloudflare infront.
Created a backup from the scaleway discourse instance, and ./launcher stop app, and shutted down the machine.
Installed Ubuntu Server 23.10 on a usb connected sata ssd powering the Raspberry Pi 4
Installed LXD, created a 100GiB btfs loopback storage pool.
Update the default profile to:
config:
cloud-init.user-data: |
#cloud-conf…
奇怪的是,下面的 LXD Docker 指南推荐使用 btrfs,尽管LXD 文档不推荐它 ,并且似乎没有为它使用分区(但他们设置了一些额外的设置,安装了 docker.io 以外的其他软件包,并将 btrfs 卷仅附加到 Docker),所以我很想知道为什么我遇到了这些问题:
Key Value Summary Learn how to run Docker inside of LXD Containers. Categories containers Difficulty 3 Author Miona Aleksic miona.aleksic@canonical.com Overview Duration: 1:00 LXD and Docker containers serve different purposes. LXD...
Reading time: 3 mins 🕑
Likes: 6 ❤
@vmsman 你能分享更多关于你的 LXD 设置的细节吗?例如配置文件、存储池以及需要更改的任何系统设置,因为你似乎拥有迄今为止最成功的设置:
My installation of Discourse is very generic. After a reboot I got a clean backup. So, ultimately I decided to do a from scratch installation. The installation failed with the same errors I posted above. I have been running Discourse with 6GB of memory in a LXD container the past four years with no issues. The memory utilization is steady at 1.9GB. During an upgrade, the memory peaks out at 5.1GB. My database backup is only 30GB of data and so my installation is small as compared with ot…
对于 LXD,我有一些疑问:
使用存储池分区而不是回环文件是否足以解决性能问题,从而消除挂起问题?
使用 MicroCloud 或 LXD 集群是否有帮助,或者使用 Ceph 作为存储池是否有帮助?
总而言之,尽管没有在 LXD 中成功运行 Discourse,但我对 LXD 及其易用性印象深刻。我之前花了几个月的时间在 HashiCorp 上挣扎,因为 HashiCorp 似乎只对企业用例感兴趣。而 LXD 则能正常工作,而且人们似乎足够支持,能够让小型团队和独立开发者取得进展。