If I set a node attribute on a few nodes in a cluster, eg:
--attrs=ram:64gb
and other nodes like this:
--attrs=ram:16gb
the documents don't say how I can use zone configurations to select between them.
My own naive attempts were like this:
ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram:64gb]';
ERROR: constraint "+ram:64gb" matches no existing nodes within the cluster - did you enter it correctly?
SQLSTATE: 23514
I figured out I could do this, but it would not distinguish between nodes that were 64gb and those which were 16gb:
ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram]';
CONFIGURE ZONE 1
I've since learned that I could create levels of attribute selections using this format:
ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram, +64gb]';
or
ALTER DATABASE defaultdb CONFIGURE ZONE USING constraints = '[+ram, +16gb]';
Shaun McVey (smcvey) commented:
If I set a node attribute on a few nodes in a cluster, eg:
and other nodes like this:
the documents don't say how I can use zone configurations to select between them.
My own naive attempts were like this:
I figured out I could do this, but it would not distinguish between nodes that were 64gb and those which were 16gb:
I've since learned that I could create levels of attribute selections using this format:
The docs at https://www.cockroachlabs.com/docs/v21.2/configure-replication-zones need to offer some examples of using multi-level attributes like this, which they currently don't.
Jira Issue: DOC-2482