Set installation path


(Diego Barreiro) #1

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:


(Jay Pfaffman) #2

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


(Diego Barreiro) #3

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


(Jay Pfaffman) #4

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.


(Rafael dos Santos Silva) #5

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.


(Diego Barreiro) #6

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:


(Diego Barreiro) #7

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


(Rafael dos Santos Silva) #8

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.


(Diego Barreiro) #9

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


(Felix Freiberger) #10

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.


(Diego Barreiro) #11

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:


(RBoy) #12

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.


(RBoy) #13

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?


(Sam Saffron) #14

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


(RBoy) #15

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?


(Sam Saffron) #16

You could but your database would run very very slowly.