Set installation path

Hi :wave:

I hava an EC2 Server powered by AWS Educate. It has 8GiB of space, but I’ve also used an external drive of 25GiB that can be mounted anywhere
How can I make Discourse to install on it’s mount point?

Thanks :+1:

Discourse uses /var/discourse, so you could mount it there if you think it’s as fast as the local drive.

So, if I mount the drive to /var/discourse, I should have 25 GiB for it?

Because when I tried the warn of you have less than 5GB of space appeared

Hmm. Either you didn’t mount it there, or there is a bug with the space checking code.

Edit: that’s wrong. You need space for the docker images too, as explained below. 6gb is going to cause you problems.

There are several folders involved in a typical Discourse install:

  1. Docker root dir, typically /var/lib/docker, where docker images live.

  2. the folder where your Discourse installer lives, typically /var/discourse/

  3. folders of Discourse persistence, typically /var/discourse/shared.

If you are low on space on the main disk, you wanna change 1 and 3 first.

Our space detection code will check for enough space on 1, and will the check will follow a config change on docker just fine.

5 Likes

It worked now

There was an error in the space script, IDK why
I’ve disabled the exit 1 line and I see that on Discourse I have 25Gb of space

Thanks :+1:

Yeah, I supposed this, so in launcher.sh I dissabled the exit function when there’s no more than 5Gb of space

Cool, but if you don’t have space on the docker root dir, the next rebuilds will fail, so point that a bigger folder too.

4 Likes

I’ve added some plugins in app.yml, but when I execute ./launcher rebuild app, I get this:

2017-07-10 12:43:05.106 UTC [87] LOG:  shutting down
2017-07-10 12:43:05.133 UTC [87] LOG:  database system is shut down
Error response from daemon: Error processing tar file(exit status 1): write /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/ffi-1.9.18/ext/ffi_c/AbstractMemory.o: no space left on device
FAILED TO COMMIT
5c39f3937267b026e910baf7030d922fcb5a9efa4fc1863b7b14f17efd292227
Removing old container
+ /usr/bin/docker rm app
app

And I have enough space
Discourse Admin Dashboard said that I had more than 20Gb

1 Like

Well, one of your volumes is out of space – most likely, /var/lib/docker cannot be written to anymore, as @Falco mentioned above. You will need to make sure this folder sits on your external drive too.

2 Likes

Yep
Finally I’ve mounted the extra EBS device of 25GiB to the /var folder and now everything works fine :+1:

Also, 25GiB must be enough for a community, no?
Could I know how much space has used this community now? To know more or less the maximum that a community can reach :sweat_smile:

1 Like

Over time I’m guessing /var/discourse will grow as the site grows. Is that also true for /var/lib/docker? Will that grow with updates/new site content or is that relatively constant? I’m currently at about 3.5GB for that folder.

Anyone thoughts? Is it sufficient to put the /var/discourse folder on a virtual drive to make it portable or do I also need other folders?

/var/discourse and all the directories below it are the only place we store persistent data.

2 Likes

Thanks Sam, so for redundancy sake, I can move the entire /var/discourse into an external disk and run it from there. If the OS were to get corrupted, I can just reinstall a fresh clean version of Discourse on a new OS and then repoint /var/discourse to the external disk?

You could but your database would run very very slowly.

2 Likes

This topic was automatically closed after 2525 days. New replies are no longer allowed.