-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring node "flavors" in a cluster #1338
Comments
I think that we need to specialize type of nodes for following reasons:
In order to achieve This architecture makes it possible to instantiate dedicated
The same for |
This patch allows administrators to configure settings in the [node] block of the server configuration and have those settings propagated to the internal nodes database. A current use case for this functionality is to configure the `zone` of the node for use in cluster placement topologies. Additional attributes can be written directly into the document in the nodes DB, but in case of a conflict between the entry in the database and the entry in the server configuration the latter will be preferred (and the attribute in the database overwritten). Related to #1338.
It occurs to me: We have some of these things already in the Still munching over the idea in general. Other than proposing the general infrastructure for this @kocolosk are you willing to share what other roles you're considering - or alternative deployment architectures that differ from the current configuration? That would help me think about the proposal more reasonably. |
Good point on the capabilities thing in the The gist of my thinking is to make it possible to have the different capabilities inside a CouchDB cluster delivered by processes that have a slightly higher degree of isolation between them (say, separate containers). I think the best ROI comes from these different groupings:
In this design steps 1-3 don't change anything about the communication protocols and interfaces used to communicate between different parts of the stack inside CouchDB. Each of those containers is a full Erlang VM and a full member of the distributed Erlang cluster. In the future it may well make sense to investigate some alternatives there but no changes would be required initially. Does that help? |
I like the idea. It could allow for interesting configurations. Here are some thoughts I had:
It is also interesting to think about what happens during membership changes. That is in the period of time during and immediately after a node changes its membership. A bit like the case with a replicator above. But say if a node becomes a storage node, then stops being a storage node. Does all data it stored auto-migrate to other storage nodes and what happens during that transition. That would be great to have, and it would open the door to auto-resharding (but that's for a different discussion). |
Thoughts on config, I'd likely go for something that put the node's "role" as a single config concept in some manner, either:
or:
What would happen to existing clusters if we expand the role set? I can see the true/false approach handles this quite simply by defaulting true. For @iilyak:
I am definitely for this approach. I think consolidating access checks makes it easier to be confident in the security properties of the system and makes unit testing many combinations simpler. For @nickva:
I think it opens the door to automatic rebalancing of shards rather than resharding (isn't that about increasing or decreasing the number of shards for a given database?). A key thing for me about this is allowing a shard replica itself to be able to flag its (including primary data and indexes) "readiness state".
I think dealing with this scenario is likely very important, even if it's along the lines of a refusal to change one's role within a cluster. The semantics otherwise end up quite subtle (e.g.,
I would likely put them into the storage nodes, as they'd be what you'd be backing up in this scenario. |
I think defaulting to |
@kocolosk Yes, that does help, thank you! While we're bike-shedding it, Another thing that comes up often are nodes that are ephemeral (in-memory-only) replicas for performance. Many CouchDB users at scale are using Redis alongside (with nutty client libraries that know how to speak Redis and CouchDB) treated as write-thru caches. I'd love to see room for a native CouchDB implementation within your proposal. @chewbranca 's already prototyped this. Given we're talking about node roles, how would you separate the |
@wohali I wonder about that proposal, whether we're overloading the database by giving it different storage layers in that sense vs. using a well known caching layer like redis? I'd also like to understand what the semantics of these nodes are -- and whether to be effective at decreasing load on the cluster whether first you have to consider things like preferentially asking certain nodes for answers to queries/writes/reads (i.e., the in-mem ones) before considering this. It also feels like a potentially complicated design for what should be more like, as you say, a write-through cache. |
@mikerhodes Perhaps, but it's an extremely prevalent design choice at scale for CouchDB. I leave the hard thinking to others, and am only thinking along the lines of - we play with it, or we play against it. And we've already built the idea of an in-memory-only Couch PSE backend. |
Definitely open to more hard thinking on the caching topic. Typically I'd say that a caching system should be separate from the database cluster so it can be closer to the app; i.e. I'd not want to run a mixed cluster with storage and cache together. |
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:
zone
is a single tag, whereas we may want to assign multiple labels / tags / roles to a nodezone
can only be set once the node is up and running which complicates cluster setupI'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: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?
The text was updated successfully, but these errors were encountered: