From 72d702a522764a34ac9b8f64f64e884e980d1463 Mon Sep 17 00:00:00 2001 From: Andrea Rabbaglietti Date: Fri, 27 Oct 2017 14:01:11 +0200 Subject: [PATCH 1/4] Add doc page 'Run Dokku on External Volume' --- docs/advanced-usage/run-on-external-volume.md | 75 +++++++++++++++++++ docs/template.html | 1 + 2 files changed, 76 insertions(+) create mode 100644 docs/advanced-usage/run-on-external-volume.md diff --git a/docs/advanced-usage/run-on-external-volume.md b/docs/advanced-usage/run-on-external-volume.md new file mode 100644 index 000000000..21af500bb --- /dev/null +++ b/docs/advanced-usage/run-on-external-volume.md @@ -0,0 +1,75 @@ +# Run Dokku on External Volume + +In order to leverage cloud-provider facilities like _attachable volumes_, (_a.k.a. block storage_) +the following is an easy tutorial to achieve Dokku runs on them. + +## Tutorial +The following is intended to be executed on the dokku host machine as `root`. +Say, _for instance_, that our volume is mapped into the systems as `/dev/vdb1`. + +Stop docker daemon + +```shell +services docker stop +``` + +Prepare the filesystem: + +```shell +mkfs -t ext4 /dev/vdb1 +mkdir /mnt/volume +mount /dev/vdb1 /mnt/volume +``` + +Move the old data directories: + +```shell +mv /home/dokku /home/dokku.OLD +mv /var/lib/docker /var/lib/docker.OLD +mv /var/lib/dokku /var/lib/dokku.OLD +``` + +Move the data on the volume + +```shell +mkdir /mnt/volume/home/ +mkdir /mnt/volume/var/lib/ +mv /home/dokku.OLD /mnt/volume/home/dokku +mv /var/lib/dokku.OLD /mnt/volume/var/lib/dokku +mv /var/lib/docker.OLD /mnt/volume/var/lib/docker +``` + +Prepare the mountpoints + +```shell +mkdir /home/dokku +mkdir /var/lib/dokku +mkdir /var/lib/docker +chown dokku:dokku /home/dokku # respect the original ownership +chmod 711 /var/lib/docker # respect the original permissions +``` + +Mount bind + +```shell +mount -o bind /mnt/volume/home/dokku /home/dokku +mount -o bind /mnt/volume/var/lib/dokku /var/lib/dokku +mount -o bind /mnt/volume/var/lib/docker /var/lib/docker +``` + +Start docker daemon + +```shell +services docker start +``` + +At this point all should be working fine, please check it out. + +Then, let the changes be reboot-persistent + +```shell +echo '/dev/vdb1 /mnt/volume ext4 defaults 0 2' | sudo tee -a /etc/fstab +echo '/mnt/volume/home/dokku /home/dokku none defaults,bind 0 0' | sudo tee -a /etc/fstab +echo '/mnt/volume/var/lib/dokku /var/lib/dokku none defaults,bind 0 0' | sudo tee -a /etc/fstab +echo '/mnt/volume/var/lib/docker /var/lib/docker none defaults,bind 0 0' | sudo tee -a /etc/fstab +``` diff --git a/docs/template.html b/docs/template.html index 81ced6701..c2c1c436e 100644 --- a/docs/template.html +++ b/docs/template.html @@ -155,6 +155,7 @@ Persistent Storage Plugin Management Repository Management + Run on External Volume Community Contributions From 1ddef4183d746db7102dac2342c7e9cb375a1aaf Mon Sep 17 00:00:00 2001 From: Andrea Rabbaglietti Date: Sun, 12 Nov 2017 20:11:53 +0100 Subject: [PATCH 2/4] Update run-on-external-volume.md --- docs/advanced-usage/run-on-external-volume.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced-usage/run-on-external-volume.md b/docs/advanced-usage/run-on-external-volume.md index 21af500bb..2476f0505 100644 --- a/docs/advanced-usage/run-on-external-volume.md +++ b/docs/advanced-usage/run-on-external-volume.md @@ -10,7 +10,7 @@ Say, _for instance_, that our volume is mapped into the systems as `/dev/vdb1`. Stop docker daemon ```shell -services docker stop +systemctl stop docker ``` Prepare the filesystem: @@ -60,7 +60,7 @@ mount -o bind /mnt/volume/var/lib/docker /var/lib/docker Start docker daemon ```shell -services docker start +systemctl start docker ``` At this point all should be working fine, please check it out. From 748c43fcfd8c726df13010e91465b4351252ee49 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 24 Feb 2018 17:23:40 -0500 Subject: [PATCH 3/4] feat: create a community tutorials section [ci skip] --- docs/template.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/template.html b/docs/template.html index c2c1c436e..b3591aa40 100644 --- a/docs/template.html +++ b/docs/template.html @@ -155,12 +155,6 @@ Persistent Storage Plugin Management Repository Management - Run on External Volume - - Community Contributions - - Clients - Plugins Development @@ -168,6 +162,13 @@ Plugin Triggers Running Tests Release Process + + Community Contributions + Clients + Plugins + + Community Tutorials + Run on External Volume From 2f5ed8c591cf23d57aba54a3d200d7811ae2ef31 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 24 Feb 2018 17:23:59 -0500 Subject: [PATCH 4/4] Rename docs/advanced-usage/run-on-external-volume.md to docs/community/tutorials/run-on-external-volume.md [ci skip] --- .../tutorials}/run-on-external-volume.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{advanced-usage => community/tutorials}/run-on-external-volume.md (100%) diff --git a/docs/advanced-usage/run-on-external-volume.md b/docs/community/tutorials/run-on-external-volume.md similarity index 100% rename from docs/advanced-usage/run-on-external-volume.md rename to docs/community/tutorials/run-on-external-volume.md