diff --git a/content/en/apps/guides/hosting/4.x/_index.md b/content/en/apps/guides/hosting/4.x/_index.md index fd5190d56..f6f022b72 100644 --- a/content/en/apps/guides/hosting/4.x/_index.md +++ b/content/en/apps/guides/hosting/4.x/_index.md @@ -11,6 +11,6 @@ relatedContent: > Before beginning any of these guides, be sure to meet all of the [CHT hosting requirements]({{< relref "apps/guides/hosting/requirements" >}}) first. -To host a production instance of CHT, use either the [Self Hosting in CHT 4.x]({{< relref "apps/guides/hosting/4.x/self-hosting-single-node" >}}) guide. To do app development, see our [App Developer]({{< relref "apps/guides/hosting/4.x/app-developer" >}}) hosting guide. +To host a production instance of CHT, use the [Self Hosting in CHT 4.x]({{< relref "apps/guides/hosting/4.x/self-hosting" >}}) guide. To do app development, see our [App Developer]({{< relref "apps/guides/hosting/4.x/app-developer" >}}) hosting guide. To view 3.x hosting options, see the [3.x hosting section]({{< relref "apps/guides/hosting/3.x" >}}) diff --git a/content/en/apps/guides/hosting/4.x/backups.md b/content/en/apps/guides/hosting/4.x/backups.md index 2b7e4067d..289d9f1ac 100644 --- a/content/en/apps/guides/hosting/4.x/backups.md +++ b/content/en/apps/guides/hosting/4.x/backups.md @@ -33,7 +33,7 @@ Therefore, you do **not** need to back up the docker images for: ## Assumptions -This guide assumes you have an Ubuntu server running CHT 4.x in Docker as described in our [Self Hosting in CHT 4.x - Single CouchDB Node]({{< relref "apps/guides/hosting/4.x/self-hosting-single-node" >}}) guide. If you run `docker ps --format '{{.Names}}'` you should see something like this: +This guide assumes you have an Ubuntu server running CHT 4.x in Docker as described in our [Self Hosting in CHT 4.x - Single CouchDB Node]({{< relref "apps/guides/hosting/4.x/self-hosting/single-node" >}}) guide. If you run `docker ps --format '{{.Names}}'` you should see something like this: ``` cht_nginx_1 diff --git a/content/en/apps/guides/hosting/4.x/self-hosting/_index.md b/content/en/apps/guides/hosting/4.x/self-hosting/_index.md new file mode 100644 index 000000000..27c05360c --- /dev/null +++ b/content/en/apps/guides/hosting/4.x/self-hosting/_index.md @@ -0,0 +1,31 @@ +--- +title: "Self Hosting in CHT 4.x" +linkTitle: "Self Hosting" +weight: 10 +description: > + Details for hosting the CHT on self run infrastructure +--- + +# Recommendations and considerations + +## Multi vs Single node couchdb requirements + +For smaller deployments a [single node CouchDB][single-couch] instance can be used, for larger deployments a [multi-node CouchDB][multi-couch] cluster is generally recommended + +| Consideration | [Single node CouchDB][single-couch] | [Multi-node clustered CouchDB][multi-couch] | +| -------------------------------------------------------- | ----------------------------------- | ------------------------------------------- | +| Less than {{< format-number 4_000 >}} users | {{< icon/yes >}} | {{< icon/yes >}} | +| More than {{< format-number 4_000 >}} users | {{< icon/no >}} | {{< icon/yes >}} | +| Less than {{< format-number 10_000 >}} documents per day | {{< icon/yes >}} | {{< icon/yes >}} | +| More than {{< format-number 10_000 >}} documents per day | {{< icon/no >}} | {{< icon/yes >}} | +| Seamless upgrade with multi-node docker compose | {{< icon/yes >}} | {{< icon/no >}} | +| Seamless upgrade with multi-node kubernetes/k3s | {{< icon/yes >}} | {{< icon/yes >}} | + +[single-couch]: {{< relref "apps/guides/hosting/4.x/self-hosting/single-node" >}} +[multi-couch]: {{< relref "apps/guides/hosting/4.x/self-hosting/multiple-nodes" >}} + +## Cloud provider vs Bare metal + +| Consideration | Cloud provider | Bare Metal | +| --------------------------- | --------------- | ---------------- | +| Data needs to be in-country | {{< icon/no >}} | {{< icon/yes >}} | diff --git a/content/en/apps/guides/hosting/4.x/self-hosting-multiple-nodes.md b/content/en/apps/guides/hosting/4.x/self-hosting/multiple-nodes.md similarity index 96% rename from content/en/apps/guides/hosting/4.x/self-hosting-multiple-nodes.md rename to content/en/apps/guides/hosting/4.x/self-hosting/multiple-nodes.md index a6538af70..0187541f1 100644 --- a/content/en/apps/guides/hosting/4.x/self-hosting-multiple-nodes.md +++ b/content/en/apps/guides/hosting/4.x/self-hosting/multiple-nodes.md @@ -1,17 +1,18 @@ --- title: "Self Hosting in CHT 4.x - Multiple CouchDB Nodes" -linkTitle: "Self Hosting - Multiple Nodes" +linkTitle: "Multiple Nodes" weight: 20 +aliases: + - ../self-hosting-multiple-nodes description: > Hosting the CHT on self run infrastructure with horizontally scaled CouchDB nodes --- {{% pageinfo %}} -The clustered multi-node hosting described below is only recommended for deployments that need extreme performance gains. These gains will greatly increase the complexity of troubleshooting and decrease the ease ongoing maintenance. +The clustered multi-node hosting described below is recommended for deployments that need increased performance gains. These gains will increase the complexity of troubleshooting and decrease the ease ongoing maintenance. -Instead, we recommended most deployment go with the [single node hosting]({{< ref "apps/guides/hosting/4.x/self-hosting-single-node" >}}). +If you are unsure which deployment to use check out [Self-hosting recommendations]({{< ref "apps/guides/hosting/4.x/self-hosting#recommendations-and-considerations" >}}). -As well, there's the [self hosted guide for 3.x]({{< relref "apps/guides/hosting/3.x/self-hosting" >}}). {{% /pageinfo %}} ### About clustered deployments diff --git a/content/en/apps/guides/hosting/4.x/self-hosting-single-node.md b/content/en/apps/guides/hosting/4.x/self-hosting/single-node.md similarity index 94% rename from content/en/apps/guides/hosting/4.x/self-hosting-single-node.md rename to content/en/apps/guides/hosting/4.x/self-hosting/single-node.md index 4a37c5828..2b44f009b 100644 --- a/content/en/apps/guides/hosting/4.x/self-hosting-single-node.md +++ b/content/en/apps/guides/hosting/4.x/self-hosting/single-node.md @@ -1,14 +1,15 @@ --- title: "Self Hosting in CHT 4.x - Single CouchDB Node" -linkTitle: "Self Hosting - Single Node" +linkTitle: "Single Node" weight: 10 +aliases: + - ../self-hosting-single-node description: > Self Hosting in CHT 4.x - Single CouchDB Node --- -[//]: # (todo - fix this link to multi-node) {{% pageinfo %}} -This for a single node CHT 4.x instance and is the recommended solution for most deployments. While not recommended, if you want a more powerful setup, check out [the 4.x multi-node install docs]({{< relref "apps/guides/hosting/requirements" >}}). As well, there's the [self hosted guide for CHT 3.x]({{< relref "apps/guides/hosting/3.x/self-hosting" >}}). +This for a single node CHT 4.x instance and is the recommended solution for small deployments. If you want a more powerful setup, check out [the 4.x multi-node install docs]({{< relref "apps/guides/hosting/4.x/self-hosting/multiple-nodes" >}}). {{% /pageinfo %}} ## Prerequisites diff --git a/content/en/apps/guides/hosting/monitoring/integration.md b/content/en/apps/guides/hosting/monitoring/integration.md index 7f963d4d2..7bc7cb90b 100644 --- a/content/en/apps/guides/hosting/monitoring/integration.md +++ b/content/en/apps/guides/hosting/monitoring/integration.md @@ -144,7 +144,7 @@ services: Now that we have all the config files in place, you need to have Docker start everything together. This is so that the containers can see each other on the same `CHT Net` Docker network. You will need to specify each of the compose files every time you start, stop or restart CHT instance so all the services stay running and connected. -Assuming you followed the [production steps]({{< relref "apps/guides/hosting/4.x/self-hosting-single-node" >}}) to install the CHT, you use this Compose call to first stop all containers and then start them all up, including the new services: +Assuming you followed the [production steps]({{< relref "apps/guides/hosting/4.x/self-hosting" >}}) to install the CHT, you use this Compose call to first stop all containers and then start them all up, including the new services: ```shell cd /home/ubuntu/cht/upgrade-service diff --git a/content/en/apps/guides/hosting/requirements.md b/content/en/apps/guides/hosting/requirements.md index 345f8c6e7..54ec4f6da 100644 --- a/content/en/apps/guides/hosting/requirements.md +++ b/content/en/apps/guides/hosting/requirements.md @@ -9,7 +9,6 @@ relatedContent: > apps/guides/hosting/3.x/ec2-setup-guide --- - {{% pageinfo %}} For production CHT deployments, Linux is recommended, with [Ubuntu](https://ubuntu.com/server) the most commonly used. For CHT development, Linux or macOS may be used. Windows can be used for either, but without recommendation. {{% /pageinfo %}} @@ -26,30 +25,30 @@ Hosting a CHT instance in a cloud provider like AWS or on bare-metal requires yo - A DNS Entry pointing to the IP - TLS certificates -## Hardware Requirements +## Minimum Hardware Requirements - 4 GiB RAM - 2 CPU/vCPU - 8 GB Hard Disk (SSD preferred) -- Root Access +- Root Access -Depending on the scale of your operation these may need to be adjusted. Be sure to monitor disk usage so that the 8 GB can be increased as needed. +Depending on the scale of your operation these may need to be increased. Be sure to monitor disk usage so that the 8 GB can be increased as needed. -## Docker +## Docker Install both `docker` and `docker-compose` to run CHT and related containers. {{% alert title="Note" %}} -Skip this step if you're following the [EC2 guide 3.x]({{< relref "apps/guides/hosting/3.x/ec2-setup-guide#create-and-configure-ec2-instance" >}}) as `docker` and `docker-compose` are automatically installed when following the setup scripts. +Skip this step if you're following the [EC2 guide 3.x]({{< relref "apps/guides/hosting/3.x/ec2-setup-guide#create-and-configure-ec2-instance" >}}) as `docker` and `docker-compose` are automatically installed when following the setup scripts. {{% /alert %}} ### Linux -Depending on which distro you run, install the Docker packages from [Docker's Linux options](https://docs.docker.com/engine/install/#server). Historically, Medic runs Ubuntu: see [Docker CE](https://docs.docker.com/engine/install/ubuntu/) and [Docker-compose](https://docs.docker.com/compose/install/) install pages. +Depending on which distro you run, install the Docker packages from [Docker's Linux options](https://docs.docker.com/engine/install/#server). Historically, Medic runs Ubuntu: see [Docker CE](https://docs.docker.com/engine/install/ubuntu/) and [Docker-compose](https://docs.docker.com/compose/install/) install pages. -### Windows +### Windows -Docker Desktop for Windows needs either Hyper-V support or Windows Subsystem for Linux 2 (WSL 2). [Docker's Windows Docker Desktop install page](https://docs.docker.com/docker-for-windows/install/) covers both scenarios. +Docker Desktop for Windows needs either Hyper-V support or Windows Subsystem for Linux 2 (WSL 2). [Docker's Windows Docker Desktop install page](https://docs.docker.com/docker-for-windows/install/) covers both scenarios. ### macOS @@ -72,13 +71,14 @@ Finally, confirm you can run the "hello world" docker container: `sudo docker ru ## Considerations -There are serious implications to consider when deploying a CHT instance beyond the above requirements. Be sure to account for: +There are serious implications to consider when deploying a CHT instance beyond the above requirements. Be sure to account for: + +- Alerting - How will alerts be sent in the case of downtime or degraded service? +- Power failures and unplanned restarts - Will the server cleanly restart such that the CHT resumes service correctly? +- Backups - What happens to the CHT data if there's a hard drive failure? +- Disaster Recovery - What happens if there is a flood at the facility and on-site active and backup data are destroyed? +- Scale - What happens when the hardware deployed needs to be upgraded to increase capacity? +- Updates - By definition TLS certificates expire and software needs to be updated - how will the deployment get these updates on a regular basis? +- Security - While the TLS certificate will protect data on the LAN, is the server hard drive encrypted in the event of property theft? +- Privacy - The CHT inherently carries sensitive patient medical information in the database. Are there sufficient measures in place to protect this sensitive data? -* Alerting - How will alerts be sent in the case of downtime or degraded service? -* Power failures and unplanned restarts - Will the server cleanly restart such that the CHT resumes service correctly? -* Backups - What happens to the CHT data if there's a hard drive failure? -* Disaster Recovery - What happens if there is a flood at the facility and on-site active and backup data are destroyed? -* Scale - What happens when the hardware deployed needs to be upgraded to increase capacity? -* Updates - By definition TLS certificates expire and software needs to be updated - how will the deployment get these updates on a regular basis? -* Security - While the TLS certificate will protect data on the LAN, is the server hard drive encrypted in the event of property theft? -* Privacy - The CHT inherently carries sensitive patient medical information in the database. Are there sufficient measures in place to protect this sensitive data? diff --git a/content/en/apps/guides/hosting/vertical-vs-horizontal.md b/content/en/apps/guides/hosting/vertical-vs-horizontal.md index a220398e1..4929319da 100644 --- a/content/en/apps/guides/hosting/vertical-vs-horizontal.md +++ b/content/en/apps/guides/hosting/vertical-vs-horizontal.md @@ -5,7 +5,7 @@ weight: 20 description: > The power of clustered CouchDB to horizontally scale the CHT relatedContent: > - apps/guides/hosting/4.x/self-hosting-multiple-nodes + apps/guides/hosting/4.x/self-hosting/multiple-nodes apps/guides/hosting/4.x/data-migration core/overview/architecture/ --- diff --git a/content/en/apps/tutorials/_partial_docker_setup.md b/content/en/apps/tutorials/_partial_docker_setup.md index f3702ca50..39abf061c 100644 --- a/content/en/apps/tutorials/_partial_docker_setup.md +++ b/content/en/apps/tutorials/_partial_docker_setup.md @@ -15,7 +15,7 @@ echo "export DOCKER_HOST=unix:///run/user/1000/docker.sock" >> ~/.$(basename $SH ``` {{% /tab %}} {{% tab header="macOS" %}} -Download and install [Docker Desktop](https://www.docker.com/products/docker-desktop). +Download and install [Docker Desktop](https://www.docker.com/products/docker-desktop) or [Colima](https://github.com/abiosoft/colima#readme). {{% /tab %}} {{% tab header="Windows (WSL2)" %}} Download and install [Docker Desktop](https://www.docker.com/products/docker-desktop). diff --git a/content/en/apps/tutorials/local-setup.md b/content/en/apps/tutorials/local-setup.md index 28aacf453..c47fd9068 100644 --- a/content/en/apps/tutorials/local-setup.md +++ b/content/en/apps/tutorials/local-setup.md @@ -51,7 +51,7 @@ Before you begin, ensure you have the following tools: ### Initialize project directory -Using the terminal (or the WLS shell on Windows: _Start > wsl_), run the following commands to create a new project directory for your CHT app: +Using the terminal (or the WSL shell on Windows: _Start > wsl_), run the following commands to create a new project directory for your CHT app: ```shell mkdir -p ~/cht-project diff --git a/layouts/shortcodes/format-number.html b/layouts/shortcodes/format-number.html new file mode 100644 index 000000000..0e14c23fe --- /dev/null +++ b/layouts/shortcodes/format-number.html @@ -0,0 +1,2 @@ +{{/* Replace _ with unicode character Thin Space (U+2009) for international number formating */}} +{{ with .Get 0 }}{{ replace . "_" " " }}{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/icon/no.html b/layouts/shortcodes/icon/no.html new file mode 100644 index 000000000..cab0429db --- /dev/null +++ b/layouts/shortcodes/icon/no.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/shortcodes/icon/yes.html b/layouts/shortcodes/icon/yes.html new file mode 100644 index 000000000..f80e30a25 --- /dev/null +++ b/layouts/shortcodes/icon/yes.html @@ -0,0 +1 @@ + \ No newline at end of file