commit b8921ed465349f5548cb4be8da274fbec13d3411 parent bf302a44fb488a5be571cc97a75b9f1d2b974698 Author: Andreas Gruhler <andreas.gruhler@adfinis.com> Date: Wed, 19 Jul 2023 23:39:06 +0200 doc: client-server architecture Diffstat:
M | README.md | | | 34 | ++++++++++++++++++++++++++++++++++ |
1 file changed, 34 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md @@ -4,6 +4,40 @@ A RaspberryPi test cluster for HashiCorp Vault and Nomad with Consul storage bac ![HashiPi](./img/HashiPi-small.jpg) +## Client-Server Architecture +The cluster can be built with 3 or 5 nodes. + +For 5 nodes, it is recommended to only have 3 server nodes for Nomad and Consul to keep the Raft traffic minimal. + +Example architecture with 5 RaspberyPi nodes: + +| Node | RAM | Nomad function | Consul function | +|------|-----|----------------|-----------------| +| 00 | 1GB | server | client/server | +| 01 | 1GB | client | client | +| 02 | 4GB | client/server | client/server | +| 03 | 1GB | client | client | +| 04 | 4GB | client/server | client/server | + +For best performance on low power devices, the [`raft_multiplier`](https://developer.hashicorp.com/consul/docs/install/performance) is set to the default value 5 (or higher): + +``` +performance { + raft_multiplier = 5 +} +``` + +The nomad clients have a higher [heartbeat timeout](https://developer.hashicorp.com/nomad/docs/configuration/server#client-heartbeats) set to make sure the low powered devices are not reported down too often: + +``` +# https://developer.hashicorp.com/nomad/docs/configuration/server#client-heartbeats +# Increase heartbeat ttl under unreliable network conditions to prevent +# client: error heartbeating. retrying: error="failed to update status: rpc +# error: Not ready to serve consistent reads" +heartbeat_grace = "30s" +min_heartbeat_ttl = "30s" +``` + ## ARM Builder These Packer files use the [Packer builder for ARM](https://github.com/mkaczanowski/packer-builder-arm). Follow the instructions in the repo to setup the builder and use the provided [examples](https://github.com/mkaczanowski/packer-builder-arm/tree/master/boards) to modify to your liking.