Configuring node "flavors" in a cluster
- Dominant language
- Erlang
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 9
Description
For a while now we’ve had this capability to control the placement of database shards on various nodes throughout a cluster by using the “zone” attribute of documents in the /nodes DB:
http://docs.couchdb.org/en/2.1.1/cluster/databases.html?highlight=zone#placing-a-database-on-specific-nodes
Recently I’ve been exploring whether we might benefit from introducing an ability for nodes in a cluster to further specialize in their roles; e.g., a pool of nodes in a cluster could be reserved just for HTTP processing and request coordination (but not data storage), another pool could mediate replication jobs, etc. I think there are a lot of benefits to this design in busy clusters, particularly that it improves the observability of each node in the cluster as the specific nature of the workload consuming resources on that node is more clear.
I think any work in this direction would benefit for a richer interface for labeling nodes with specific attributes. The current “zone" design has a couple of limitations that I see:
1. `zone` is a single tag, whereas we may want to assign multiple labels / tags / roles to a node
2. `zone` can only be set once the node is up and running which complicates cluster setup
I'd like to solicit input on an alternative design that would be more flexible and user-friendly. I would certainly recommend that we support setting these properties in our normal config files (although we may still find it important internally to copy them into `/nodes` so that every node in the cluster learns about the capabilities of its peers). One thought I have is introducing a new top-level configuration section like so:
```
[node]
coordinator = true ; listens on HTTPS, issues fabric requests
replicator = false ; will not mediate any replication jobs
storage = false ; will not store any user data
zone = us-metro-1a
```
Of course, `coordinator`, `replicator`, `storage` would all default to true which would recover the current configuration where all cluster nodes share in all workloads equally.
What do you all think?
Contributor guide
Research direction
The issue names no implementation files or tests. Start by reviewing how the existing zone attribute is stored in the /nodes DB and how normal config files initialize cluster nodes; a completed effort would have an agreed design for multi-label roles, startup configuration, defaults, and propagation to peers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100