Less than 5GB of disk space, can't upgrade Discourse

Dear All,

I have an existing installation of discourse however i did not upgrade last few releases. Its hosted by digital ocean. This mornng when i tried to upgrade through manual, i am getting the following error. Please can you guide as what step i should take to upgrade this.

Cheers,
Muhammad

Run it again and say Yes. Your data won’t be touched, only old docker images will be removed.

1 个赞

Thanks. I did that but it does not seem working. Please see this snapshot. Sorry I forgot to attach this earlier. Thanks in advance

use either du -sh * and drill down into the large directories or ncdu if you have that package available, and try to figure out where exactly your space has gone

if it is user content you will probably have to increase diskspace on your server, but a common problem on servers that run docker for a while is that the default json logging engine never rotates the logs

[root@discocent discourse]# cd /var/lib/docker/containers/
[root@discocent containers]# du -sh *
5.1M	86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f
36K	cecf3b8565bce6156c61f61b27af425d0f956b8ce439f2519300ebfdc7bb4cf9
[root@discocent containers]# cd 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f/
[root@discocent 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f]# ls -lh
total 5.1M
-rw-r-----. 1 root root 5.0M Jan 16 10:07 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f-json.log

that’s 5M of log for my idle test instance after a couple days, an active server will be larger. if you run other containers they might be logging even more.

You can configure docker to handle log rotation, check out Configure logging drivers | Docker Documentation …not sure why it’s not the default.

1 个赞

Hi @ssvenn

Many thanks. this is much appreciated. I have run the commands and i can see the following statistics. Would you mind to advise, how does this look like as I am unable to interpret I am afraid. Thanks in advance.

Sorry here is the lastest one please.

I have been surprised to see the occupied space. As we have very minimal activty on our forum. Thanks

ok, that’s not your problem then. Only one container and only 0.5MB of logs.

if you run du -sh * again in the / top directory maybe you will get a better picture of where the space has gone. I highly recommend ncdu to make it easier ( NCurses Disk Usage )

on my test instance docker uses about 8GB on images, check out Prune unused Docker objects | Docker Documentation for help on how to clean that up.

docker image prune -a usually frees up a lot of space for me, you might have to docker rm app to delete your old Discourse app container first. If you have lots of forum backups maybe you could download them to your local machine to free up some additional space.

another thing you should check is docker ps -a to see if you have any unexpected containers. Sometimes a failed rebuild will leave a dangling container that you have to remove manually.

[root@discocent /]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                  PORTS               NAMES
86981cd18ab1        da251a932851        "/bin/bash -c 'cp -r…"   4 days ago          Exited (0) 4 days ago                       festive_margulis
[root@discocent /]# docker rm festive_margulis
festive_margulis
[root@discocent /]# docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:da251a9328516f691f0fc3bcdd685e218fa075ae744766996a25b7fe0008b4fc
deleted: sha256:3adfc688f9c999f5f08caae668a722c273311c3f84da33161bf23184218fa74b
deleted: sha256:ea31cd77735ab3d86f3d8903425d4157320b7047a07da4555a4752614c6e5265
deleted: sha256:b375a11cf89e3f124f9151688c2952ef8ca45f5ab5f2bd0751ea3f617708df87
deleted: sha256:cce92fda689ab9033f0b8db214bc63edd1ae3e05831a0f3a9418976d7dc7ccdd
deleted: sha256:d22094bbd65447c59a42c580eaa3a44cee9cd855f00905f59409be21bcefc745
deleted: sha256:b8976847450013f3eb5e9a81a5778f73ed7bef67e6393049712ef17102b4b7b7
deleted: sha256:b8c891f0ffec910a12757d733b178e3f62d81dbbde2b31d3b754071c416108ed

Total reclaimed space: 2.33GB

Have you checked your backups? It’s quite easy for them to fill your disk.

2 个赞

@pfaffman 关于这个有个快速问题。我遇到了同样的问题,所以我运行了 du -sh *。没有文件超过 1MB。

所以我没有删除。

但我尝试了 docker image “prune -a”,回收空间:0B。

还有什么我应该做的吗?我的问题与我最近的升级有关,该升级导致应用程序关闭。

你检查过 /var/discourse/shared/standalone/backups/default 吗?这很可能是罪魁祸首。

我正在 https://www.pfaffmanager.com/ 开发一款新产品。如果你登录那里,点击顶部的“服务器列表”按钮,然后点击“免费!管理现有服务器”按钮,并按照(我希望)它建议的那样为你的服务器配置它,我会为你弄清楚。

2 个赞

谢谢,是的,我检查了备份。总共 5 个文件 * 16M。这很小,对吧?

我也运行了这个


==================== 内存信息 ====================
RAM (MB): 1002

              total        used        free      shared  buff/cache   available
Mem:            978         692          68          33         216         110
Swap:          2047         242        1805

==================== 磁盘空间检查 ====================
---------- 操作系统磁盘空间 ----------
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       12G   11G  848M  93% /

---------- 容器磁盘空间 ----------
Filesystem      Size  Used Avail Use% Mounted on
overlay          12G   11G  848M  93% /
/dev/xvda1       12G   11G  848M  93% /shared
/dev/xvda1       12G   11G  848M  93% /var/log


我现在正在尝试你的新产品建议。

哦。你只有 12G。这不够。我建议至少 25G,最好是 50G。

1 个赞

好的,明白了。几分钟前,我将音量增加了 30,可能还在优化中
image

顺便说一句,我对您的产品的用户界面感到困惑,但也突然对您将如何从中调试感到好奇。哈哈哈。我将通过私信与您联系,以避免在此违反任何规则。

2 个赞